KosmoKrator

productivity

Asana Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Asana KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.asana.*. Use lua_read_doc("integrations.asana") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Asana workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.asana.create_task({name = "example_name", notes = "example_notes", projects = "example_projects", assignee = "example_assignee", due_on = "example_due_on", tags = "example_tags", workspace = "example_workspace"}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("asana"))' --json
kosmo integrations:lua --eval 'print(docs.read("asana.create_task"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local asana = app.integrations.asana
local result = asana.create_task({name = "example_name", notes = "example_notes", projects = "example_projects", assignee = "example_assignee", due_on = "example_due_on", tags = "example_tags", workspace = "example_workspace"})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.asana, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.asana.default.* or app.integrations.asana.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Asana, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Asana — Lua API Supplement

Namespace: app.integrations.asana

Asana uses a personal access token or OAuth access token as a bearer token. The API returns a top-level data key and may include pagination metadata such as next_page; this integration preserves that shape.

Tasks

Create a task:

local task = app.integrations.asana.create_task({
  name = "Draft launch plan",
  notes = "Collect open work and owners.",
  projects = { "1200000000000001" },
  assignee = "me",
  due_on = "2026-05-20"
})

List tasks with cursor pagination:

local page = app.integrations.asana.list_tasks({
  project = "1200000000000001",
  limit = 50
})

for _, task in ipairs(page.data) do
  print(task.gid .. " " .. task.name)
end

if page.next_page then
  local next_page = app.integrations.asana.list_tasks({
    project = "1200000000000001",
    offset = page.next_page.offset
  })
end

Update or delete a task:

app.integrations.asana.update_task({
  id = "1200000000000002",
  completed = true
})

app.integrations.asana.delete_task({
  id = "1200000000000002"
})

Comments And Subtasks

app.integrations.asana.add_comment({
  task_id = "1200000000000002",
  text = "This is ready for review."
})

local comments = app.integrations.asana.list_comments({
  task_id = "1200000000000002",
  limit = 20
})

local subtask = app.integrations.asana.create_subtask({
  parent_id = "1200000000000002",
  name = "Check screenshots",
  assignee = "me"
})

Projects, Sections, Teams, Users, And Tags

local workspaces = app.integrations.asana.list_workspaces({})
local projects = app.integrations.asana.list_projects({
  workspace = workspaces.data[1].gid,
  archived = false
})

local sections = app.integrations.asana.list_sections({
  project_id = projects.data[1].gid
})

local teams = app.integrations.asana.list_teams({
  workspace_id = workspaces.data[1].gid
})

local users = app.integrations.asana.list_users({
  workspace = workspaces.data[1].gid,
  limit = 50
})

local tags = app.integrations.asana.list_tags({
  workspace = workspaces.data[1].gid
})

Output Notes

Write tools return Asana’s response object, usually { data = {...} }. List tools return { data = {...}, next_page = {...} } when another page exists. Use offset = result.next_page.offset to fetch the next page.

Multi-Account Usage

app.integrations.asana.create_task({...})
app.integrations.asana.default.create_task({...})
app.integrations.asana.operations.create_task({...})
Raw agent markdown
# Asana — Lua API Supplement

Namespace: `app.integrations.asana`

Asana uses a personal access token or OAuth access token as a bearer token. The API returns a top-level `data` key and may include pagination metadata such as `next_page`; this integration preserves that shape.

## Tasks

Create a task:

```lua
local task = app.integrations.asana.create_task({
  name = "Draft launch plan",
  notes = "Collect open work and owners.",
  projects = { "1200000000000001" },
  assignee = "me",
  due_on = "2026-05-20"
})
```

List tasks with cursor pagination:

```lua
local page = app.integrations.asana.list_tasks({
  project = "1200000000000001",
  limit = 50
})

for _, task in ipairs(page.data) do
  print(task.gid .. " " .. task.name)
end

if page.next_page then
  local next_page = app.integrations.asana.list_tasks({
    project = "1200000000000001",
    offset = page.next_page.offset
  })
end
```

Update or delete a task:

```lua
app.integrations.asana.update_task({
  id = "1200000000000002",
  completed = true
})

app.integrations.asana.delete_task({
  id = "1200000000000002"
})
```

## Comments And Subtasks

```lua
app.integrations.asana.add_comment({
  task_id = "1200000000000002",
  text = "This is ready for review."
})

local comments = app.integrations.asana.list_comments({
  task_id = "1200000000000002",
  limit = 20
})

local subtask = app.integrations.asana.create_subtask({
  parent_id = "1200000000000002",
  name = "Check screenshots",
  assignee = "me"
})
```

## Projects, Sections, Teams, Users, And Tags

```lua
local workspaces = app.integrations.asana.list_workspaces({})
local projects = app.integrations.asana.list_projects({
  workspace = workspaces.data[1].gid,
  archived = false
})

local sections = app.integrations.asana.list_sections({
  project_id = projects.data[1].gid
})

local teams = app.integrations.asana.list_teams({
  workspace_id = workspaces.data[1].gid
})

local users = app.integrations.asana.list_users({
  workspace = workspaces.data[1].gid,
  limit = 50
})

local tags = app.integrations.asana.list_tags({
  workspace = workspaces.data[1].gid
})
```

## Output Notes

Write tools return Asana's response object, usually `{ data = {...} }`. List tools return `{ data = {...}, next_page = {...} }` when another page exists. Use `offset = result.next_page.offset` to fetch the next page.

## Multi-Account Usage

```lua
app.integrations.asana.create_task({...})
app.integrations.asana.default.create_task({...})
app.integrations.asana.operations.create_task({...})
```
Metadata-derived Lua example
local result = app.integrations.asana.create_task({name = "example_name", notes = "example_notes", projects = "example_projects", assignee = "example_assignee", due_on = "example_due_on", tags = "example_tags", workspace = "example_workspace"})
print(result)

Functions

create_task Write

Create a new task in Asana.

Lua path
app.integrations.asana.create_task
Full name
asana.asana_create_task
ParameterTypeRequiredDescription
name string yes Name of the task.
notes string no Free-form textual description (supports HTML).
projects array no Array of project GIDs to add the task to.
assignee string no User GID to assign the task to, or "me".
due_on string no Due date in YYYY-MM-DD format.
tags array no Array of tag GIDs to add to the task.
workspace string no Workspace GID (required if not adding to a project).
get_task Read

Get detailed information about an Asana task.

Lua path
app.integrations.asana.get_task
Full name
asana.asana_get_task
ParameterTypeRequiredDescription
id string yes The task GID.
update_task Write

Update an existing Asana task.

Lua path
app.integrations.asana.update_task
Full name
asana.asana_update_task
ParameterTypeRequiredDescription
id string yes The task GID to update.
name string no New name for the task.
notes string no New description.
assignee string no User GID to assign the task to, or "me".
due_on string no Due date in YYYY-MM-DD format.
completed boolean no Set to true to mark the task complete.
tags array no Array of tag GIDs to set on the task.
delete_task Write

Delete an Asana task permanently.

Lua path
app.integrations.asana.delete_task
Full name
asana.asana_delete_task
ParameterTypeRequiredDescription
id string yes The task GID to delete.
list_tasks Read

List tasks in Asana with optional filters.

Lua path
app.integrations.asana.list_tasks
Full name
asana.asana_list_tasks
ParameterTypeRequiredDescription
project string no Project GID to filter tasks by.
assignee string no User GID to filter by assignee, or "me".
workspace string no Workspace GID to filter tasks by.
completed_since string no Only return tasks completed after this ISO 8601 date.
limit integer no Max number of tasks to return (1–100).
offset string no Cursor for pagination from a previous response.
create_subtask Write

Create a subtask under an existing Asana task.

Lua path
app.integrations.asana.create_subtask
Full name
asana.asana_create_subtask
ParameterTypeRequiredDescription
parent_id string yes GID of the parent task.
name string yes Name of the subtask.
notes string no Description for the subtask.
assignee string no User GID to assign the subtask to, or "me".
add_comment Write

Add a comment to an Asana task.

Lua path
app.integrations.asana.add_comment
Full name
asana.asana_add_comment
ParameterTypeRequiredDescription
task_id string yes GID of the task to comment on.
text string yes Comment text (supports Markdown).
list_comments Read

List comments (stories) on an Asana task.

Lua path
app.integrations.asana.list_comments
Full name
asana.asana_list_comments
ParameterTypeRequiredDescription
task_id string yes GID of the task to list comments for.
limit integer no Max number of comments to return (1–100).
offset string no Cursor for pagination from a previous response.
create_project Write

Create a new project in Asana.

Lua path
app.integrations.asana.create_project
Full name
asana.asana_create_project
ParameterTypeRequiredDescription
name string yes Name of the project.
notes string no Free-form description of the project.
workspace string yes Workspace GID where the project will be created.
team string no Team GID to add the project to.
color string no Color for the project (e.g. "dark-pink", "dark-green").
get_project Read

Get detailed information about an Asana project.

Lua path
app.integrations.asana.get_project
Full name
asana.asana_get_project
ParameterTypeRequiredDescription
id string yes The project GID.
list_projects Read

List projects in Asana with optional filters.

Lua path
app.integrations.asana.list_projects
Full name
asana.asana_list_projects
ParameterTypeRequiredDescription
workspace string no Workspace GID to filter projects by.
team string no Team GID to filter projects by.
archived boolean no Filter by archived status.
limit integer no Max number of projects to return (1–100).
offset string no Cursor for pagination from a previous response.
list_sections Read

List sections in an Asana project.

Lua path
app.integrations.asana.list_sections
Full name
asana.asana_list_sections
ParameterTypeRequiredDescription
project_id string yes GID of the project to list sections for.
limit integer no Max number of sections to return (1–100).
offset string no Cursor for pagination from a previous response.
list_workspaces Read

List all workspaces the authenticated user has access to.

Lua path
app.integrations.asana.list_workspaces
Full name
asana.asana_list_workspaces
ParameterTypeRequiredDescription
No parameters.
list_teams Read

List teams in an Asana workspace.

Lua path
app.integrations.asana.list_teams
Full name
asana.asana_list_teams
ParameterTypeRequiredDescription
workspace_id string yes GID of the workspace to list teams for.
list_users Read

List users in an Asana workspace.

Lua path
app.integrations.asana.list_users
Full name
asana.asana_list_users
ParameterTypeRequiredDescription
workspace string yes Workspace GID to filter users by.
limit integer no Max number of users to return (1–100).
offset string no Cursor for pagination from a previous response.
get_user Read

Get detailed information about an Asana user.

Lua path
app.integrations.asana.get_user
Full name
asana.asana_get_user
ParameterTypeRequiredDescription
id string yes The user GID.
get_user_task_list Read

Get the user task list for a given user and workspace.

Lua path
app.integrations.asana.get_user_task_list
Full name
asana.asana_get_user_task_list
ParameterTypeRequiredDescription
user_id string yes GID of the user.
workspace_id string yes GID of the workspace.
list_tags Read

List tags in an Asana workspace.

Lua path
app.integrations.asana.list_tags
Full name
asana.asana_list_tags
ParameterTypeRequiredDescription
workspace string yes Workspace GID to filter tags by.
limit integer no Max number of tags to return (1–100).
offset string no Cursor for pagination from a previous response.
create_tag Write

Create a new tag in Asana.

Lua path
app.integrations.asana.create_tag
Full name
asana.asana_create_tag
ParameterTypeRequiredDescription
name string yes Name of the tag.
workspace string yes Workspace GID where the tag will be created.
color string no Color for the tag (e.g. "dark-pink", "dark-green").
get_current_user Read

Get the currently authenticated Asana user.

Lua path
app.integrations.asana.get_current_user
Full name
asana.asana_get_current_user
ParameterTypeRequiredDescription
No parameters.