What is a Run?
When you callclient.run(), Subconscious creates a Run that:
- Receives your instructions and tools
- Processes the request through our inference engine
- Executes tool calls as needed
- Returns structured results
Run Lifecycle
Every Run progresses through a series of states:| Status | Description |
|---|---|
queued | Run is waiting to be processed |
running | Run is actively being executed |
succeeded | Run completed successfully |
failed | Run encountered an error |
canceled | Run was canceled by the user |
timed_out | Run exceeded the timeout limit |
Creating a Run
Synchronous (Wait for Completion)
The simplest approach—wait for the run to complete:Asynchronous (Fire and Forget)
Some workloads are better suited for async execution:- Long-running tasks — Many tool calls, large searches, multi-step plans
- Durability requirements — You care that they finish, not that you watch every token
- Fan-out to other systems — Pipelines, CRMs, warehouses
Polling with client.wait()
For convenience, use client.wait() to automatically poll until the run completes:
When to Use What
| Pattern | Best For |
|---|---|
Sync (await_completion: true) | Simple tasks, quick responses |
| Streaming | Human watching, chat UIs |
| Async + Polling | Background jobs, dashboards |
| Async + Webhooks | Integrations, pipelines (see Webhooks) |
Run Response Structure
When a run completes, you receive a response with these fields:Key Fields
| Field | Description |
|---|---|
runId | Unique identifier for this run |
status | Current state of the run |
result.answer | The agent’s final answer |
result.reasoning | Step-by-step reasoning process (when available) |
usage | Token usage and timing information |
error | Error details if the run failed |