Developer docs SDK

Tasks API

Create, await, and orchestrate project tasks, and answer approval gates — the orchestration primitives available from any script.

Python

create_task(identifier, ...) spawns a task instance; the remaining methods observe and orchestrate:

MethodDescription
create(identifier, options)Spawn a task; with wait=true it blocks until settled
wait(task_id, timeout=300, poll_interval=2, on_feedback)Blocks until settled and returns the task dict with "result"
feedback(task_id, message)Answer a sub-task waiting in pending_approval
flush(timeout=300)Join background on_complete threads before exit
list(status?, limit=50, offset=0)List tasks — filter by status: pending / running / success / failed / pending_approval / rejected; limit up to 200
get(task_id)Snapshot of one task, with its result when finished
from workflow import create_task, wait_task, feedback, flush_tasks

tid = create_task(
    "summariser",
    params={"url": "https://example.com"},
    on_feedback=lambda task: feedback(task["id"], "deploy to staging"),
)
result = wait_task(tid, timeout=600)
flush_tasks()
OptionDefaultDescription
identifierrequiredMeta-task identifier; must belong to the same project
name{identifier}-{timestamp}Kanban display name
params{}Values matching the meta-task param schema
waitFalseBlock until the task settles and return its result
timeout300Max seconds for wait / callbacks
poll_interval2Status poll interval (seconds)
on_complete / on_errorNoneSettle / failure callbacks (background threads); errors are silently ignored without a callback
on_feedbackNoneCalled each time the task enters pending_approval; task["current_phase"] carries the question or approval context
show_in_kanbanFalse in servicesWhether the task appears on the kanban
workspace_slugNoneRun in a specific workspace

TypeScript

createTask(identifier, options) mirrors the contract:

const tid = await createTask("summariser", {
  params: { url: "https://example.com" },
  onFeedback: (task) => feedback(task.id, "deploy to staging"),
});
const result = await waitTask(tid, { timeoutMs: 600_000 });
await flushTasks();
OptionDefaultDescription
name{identifier}-{timestamp}Kanban display name
params{}Values matching the meta-task param schema
waitfalseBlock until the task settles and return its result
timeoutMs300000Max milliseconds for wait / callbacks
pollIntervalMs2000Status poll interval (milliseconds)
onComplete / onError—Settle / failure callbacks; errors are silently ignored without a callback
onFeedback—Called each time the task enters pending_approval; task.current_phase carries the question or approval context
showInKanbanfalse in servicesWhether the task appears on the kanban
workspaceSlugmeta-task defaultRun in a specific workspace