Schema
TaskResponse
Task response model.
| Field | Type | Description |
|---|---|---|
idrequired | string (uuid) | Task UUID |
permakey | string | null | Stable human-readable task/instance key for the nested deep-link URL .../cycles/{cycle}/instance/{permakey}. Null on legacy rows. |
cycle_idrequired | string (uuid) | Parent cycle UUID |
step_id | string | null | Blueprint step id this task corresponds to (FE OutputsViewer resolver) |
step_indexrequired | integer | Step index in workflow |
namerequired | string | Task name |
typerequired | string | Task type (domain type for display: extraction, validation, etc.) |
statusrequired | "pending" | "planning" | "pending_approval" | "upload_document" | "running" | "paused" | "blocked" | "awaiting_approval" | "approved" | "rejected" | "done" | "completed" | "failed" | "skipped" | Status for individual tasks.
Database constraint: pending, running, paused, blocked, done, skipped, failed
Additional API statuses: planning, pending_approval, awaiting_approval, approved, rejected, completedpendingplanningpending_approvalupload_documentrunningpausedblockedawaiting_approvalapprovedrejecteddonecompletedfailedskipped |
requires_approval | boolean | Whether task requires approval |
gate_record | RunGateRecord | null | — |
description | string | null | Plain-English description of what this step does, derived once at save time from the step definition and stored. NULL on legacy rows that were never derived. |
input_data | object | Task inputshow nestedEmpty object. |
output_data | object | Task outputshow nestedEmpty object. |
error_message | string | null | Why this step did not complete, written for an accountant. Composed by src.workstreams.language — the raw engine/approver text is on error_details and is the only place it appears. |
error_details | string | null | The step's recorded reason, with ids, secrets, email addresses and file paths removed, shown under "This step stopped" on the run page. |
started_at | string (date-time) | null | Start timestamp |
completed_at | string (date-time) | null | Completion timestamp |
approved_by | string (uuid) | null | Approver user ID |
approved_at | string (date-time) | null | Approval timestamp |
created_atrequired | string (date-time) | Creation timestamp |
updated_atrequired | string (date-time) | Last update timestamp |
reasoning_summary | string | null | The step's reasoning trace summary (workstreams.task.thinking_summary). NULL on older cycles or steps that recorded no reasoning. |
tokens_input | integer | null | Input tokens consumed by this step. NULL on legacy rows. |
tokens_output | integer | null | Output tokens produced by this step. NULL on legacy rows. |
duration_ms | integer | null | Wall-time of this step in ms (persisted duration_ms, else completed_at - started_at). NULL when not started / no timestamps. |
customer_cost_gbp | number | null | What this STEP cost the customer: its execution time x the organisation's hourly rate. Same figure as the cycle-level field of the same name, one grain finer. Named `customer_cost_gbp`, not `cost_gbp`: the wire-boundary contract bans any read model carrying a bare cost noun, because `cost_cents` (our token spend) must never reach a browser. A field called `cost_gbp` cannot be told apart from that at a glance, and the guard was right to refuse it. The value was already being computed and passed by _cycles.py and silently discarded, because no such field existed here. |
tool | string | null | Tool/action that performed this step (step_definition.tool, else the structural type). Drives the FE tool chip + payload typing. |
summary | string | null | One accountant-English line authored at step completion (e.g. 'Read Doc 1 — 36pp · 4s'); the honesty line when no judgment was recorded. Server-capped < 500 chars; never a dump. |
payload_ref | string | null | content_uri reference to this step's raw payload: 'inline:<base64>' when <= 8 KB, else 'workstreams://step/{id}/payload' resolved by GET /cycles/{cycle_id}/steps/{step_id}/payload. Absent when the step produced no payload. |
payload_size_bytes | integer | null | Byte size of the raw payload (UTF-8 JSON) — the UI's size hint for the Show-payload disclosure. Null when no payload, and null when the step's stored outputs are over 8192 bytes (they are not read to size them; the size arrives as `size_bytes` from the payload address). Exact for every other step, and for every step under `?include=payloads`. |
orphaned | boolean | True only when the step's own cycle is cancelled, the step is failed, and the finalising sweep closed it (stored error_context.orphaned is true and error_context.message starts with 'orphaned:'). Distinguishes a step cut off mid-flight by the cancellation from one that failed on its own; the stored status is unchanged. False in every other case, including every row that predates the sweep. |