Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt

Use this file to discover all available pages before exploring further.

Tasks.aget loads a full Task object: input, status, result, token usage, deep-planning state, attached files, and everything else stored against the task record.
from xpander_sdk import Tasks

tasks = Tasks()
task = await tasks.aget(task_id="task_xyz")
print(task.status.value, task.result)

Parameters

ParameterTypeRequiredDescription
task_idstrYesTask ID.

Returns Task

A full Task. See the Task class reference for attributes.

Examples

Wait for completion

import asyncio
from xpander_sdk import AgentExecutionStatus

terminal = {
    AgentExecutionStatus.Completed,
    AgentExecutionStatus.Failed,
    AgentExecutionStatus.Error,
    AgentExecutionStatus.Stopped,
}

while True:
    task = await tasks.aget(task_id=task.id)
    if task.status in terminal:
        break
    await asyncio.sleep(2)

print(task.result)
For finer-grained progress, use task.aevents() instead: see streaming events.

Reload an existing instance

If you already have a Task instance and want fresh data, prefer task.areload() over a fresh aget: it preserves any in-flight deep_planning state that the API might briefly return as empty:
await task.areload()

Sync version

task = tasks.get(task_id="task_xyz")

Errors

Raises ModuleException on failure. Common statuses:
StatusCause
404Task doesn’t exist (or wrong organization).
403Task exists but isn’t accessible.
500Server error.