Skip to content
中文

Run a published target or execute draft source

Execute a published script or workflow with target, or test unpublished code directly with source and language (ts for TypeScript, yaml for workflow YAML), without first saving or publishing a definition. Minimal script: export default async ({ file_id }: { file_id: string }) => { const result = await call("ocr", { document: { type: "file", file_id } }); return result; }; send it as source with language="ts", input={"file_id":""} and wait=0, using a PDF or image already uploaded to your account. To call a platform API directly in the same script, use the praxis SDK object, for example praxis.model.ocr.create({ body: { model: "glm-ocr", document: { type: "file", file_id } } }); Action IDs are strings passed to call(), not SDK methods such as praxis.ocr(...). praxis, call, invoke, console and codemode are module-scope bindings, not on globalThis, and need no import; invoke("namespace/name", input) starts a child run. target and source are mutually exclusive; target accepts ns/name@version, @tag or @range and defaults to latest when @ is omitted. Source/input validation precedes run creation, so a separate validate call is optional. input defaults to {} and must match the input schema and fit within 1 MiB. wait is 0–60 seconds (default 0): a terminal run returns 200, otherwise 202. Use the returned id with praxis.automation.runs.retrieve and inspect status, output and error; acceptance does not mean successful completion. For long-running, background or batch work, use wait: 0 and poll the run, or split work into child runs or a workflow; wait only controls the response wait and does not extend execution limits. Actions time out after 5 min (run-sandbox after 6 h); scripts have a 30 min wall-clock limit and a 30 s CPU limit; workflows default to 24 h and allow up to 30 days. Each run can start at most 1,000 child runs, with at most 100 active at once; nesting depth is limited to 10. Idempotency-Key is scoped to tenant, method and path for 24 hours, excluding wait from the fingerprint; replay returns the current run with Idempotent-Replayed: true, changed contents return 422 and an in-flight request returns 409. With language=yaml, source is a workflow YAML: the run input is . in the first step, and the shape is described in create workflow. Error details are in errors[] (pointer, detail, hint). New non-deterministic run IDs contain 78 characters, compared with 46 for legacy random IDs; treat IDs as opaque strings. Historical and deterministic IDs remain valid; same-millisecond order is not guaranteed.

POST /automation/v1/runs

Authentication

Authorization: Bearer $PRAXIS_API_KEY

Request fields

Parameter Type Description
header: Idempotency-Key string optional; 1–256 characters; deduplicates within tenant, method and path for 24 hours, excluding wait from the fingerprint.

application/json

Field Type Description
(variant 1).target string required; Script/workflow reference ns/name@tag, ns/name@version or ns/name@range; omission of @ selects latest. Mutually exclusive with source.
(variant 1).input null / string / number / boolean / object / null / string / number / boolean / object / JSON[][] optional; JSON run input, default {}; must satisfy the target input schema and fit within 1 MiB.
(variant 1).input (variant 5).* (variant 5) object Recursive JSON value.
(variant 1).input (variant 5).* (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 1).input (variant 6)[] (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 1).input (variant 6)[] (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 1).wait number optional; Seconds to wait for a terminal state, 0–60, default 0; excluded from the idempotency fingerprint. minimum: 0; maximum: 60
(variant 1).labels object optional; At most 50 labels; keys contain 1–40 characters and values at most 500 characters.
(variant 1).deadline_seconds integer optional; Positive integer seconds up to 2,592,000. Scripts default to and are capped at 300 seconds; workflows default to 86,400 seconds and allow up to 30 days. minimum: 1
(variant 2).source string required; Source; for ad hoc runs it excludes target, requires language and is limited to 1 MiB.
(variant 2).language "ts" / "yaml" required; Source language: ts for scripts, yaml for workflows.
(variant 2).input null / string / number / boolean / object / null / string / number / boolean / object / JSON[][] optional; JSON run input, default {}; must satisfy the target input schema and fit within 1 MiB.
(variant 2).input (variant 5).* (variant 5) object Recursive JSON value.
(variant 2).input (variant 5).* (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 2).input (variant 6)[] (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 2).input (variant 6)[] (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
(variant 2).wait number optional; Seconds to wait for a terminal state, 0–60, default 0; excluded from the idempotency fingerprint. minimum: 0; maximum: 60
(variant 2).labels object optional; At most 50 labels; keys contain 1–40 characters and values at most 500 characters.
(variant 2).deadline_seconds integer optional; Positive integer seconds up to 2,592,000. Scripts default to and are capped at 300 seconds; workflows default to 86,400 seconds and allow up to 30 days. minimum: 1

Examples

curl --fail-with-body -X POST "https://api.deepraxis.com/automation/v1/runs" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "source": "export default async (input: { n: number }) => ({ answer: input.n + 1 });",
  "language": "ts",
  "input": {
    "n": 41
  },
  "wait": 60,
  "labels": {
    "namespace": "docs-samples",
    "name": "sample-run"
  }
}'
import { createAutomationClient } from '@deepraxis/sdk/automation';

function env(name: string): string {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
}
const automation = createAutomationClient({
  apiKey: env('PRAXIS_API_KEY'),
  baseUrl: 'https://api.deepraxis.com',
  maxRetries: 0,
  timeoutMs: 90_000,
});
const result = await automation.runs.create({
  "body": {
    "source": "export default async (input: { n: number }) => ({ answer: input.n + 1 });",
    "language": "ts",
    "input": {
      "n": 41
    },
    "wait": 60,
    "labels": {
      "namespace": "docs-samples",
      "name": "sample-run"
    }
  }
});
console.log(result);

Response

HTTP 200

Success

Header Type Description
Idempotent-Replayed boolean true when returning a replayed run.

application/json

Field Type Description
id string required; Opaque run_ ID. New non-deterministic IDs have 78 characters: run_ + 10-character base36 millisecond timestamp + 64-character hexadecimal DO ID. Legacy random IDs have 46 characters; historical and deterministic IDs remain valid. Same-millisecond creation order is not guaranteed.
kind "script" / "workflow" required; Orchestration kind. script is a TypeScript script that executes once; workflow is a YAML workflow made of steps that can wait for events, timers or child runs and can be suspended.
number null / number required; Increasing sequence number of the run within its script or workflow; null for ad-hoc runs.
definition null / object required; The script or workflow {namespace, name} the run belongs to; null for ad-hoc runs created with source.
definition (variant 2).namespace string required; Namespace of the script or workflow.
definition (variant 2).name string required; Name of the script or workflow.
target null / string required; The target string as supplied at creation (for example acme/report@latest); null for ad-hoc runs.
resolved_version null / string required; Exact version the target resolved to; null for ad-hoc runs.
source_digest null / string required; Digest of the source of an ad-hoc run, usable to read that source; null for runs started from a published definition.
language "ts" / "yaml" required; Source language. ts is a TypeScript script; yaml is workflow YAML.
status "running" / "completed" / "faulted" / "cancelled" / "pending" / "waiting" / "suspended" required; Run status. pending is created but not started; running is executing; waiting means a workflow is waiting on an event, timer or child run; suspended means a workflow was suspended; cancelled was cancelled; faulted failed and error says why; completed finished successfully and output holds the result. The last three are terminal.
progress null / object required; Latest progress reported by the run as {label, current, total, updated_at}; null if none was reported.
progress (variant 2).label string required; Short progress label, such as the current stage.
progress (variant 2).current null / number required; Amount completed so far, or null if not reported.
progress (variant 2).total null / number required; Total amount, or null when unknown.
progress (variant 2).updated_at string required; Time progress was last updated (RFC 3339 UTC).
current_wait null / object required; The wait point the run is currently blocked on, or null when it is not waiting.
current_wait (variant 2).id string required; Wait point id, prefixed wait_; use it as wait_id when completing an event wait.
current_wait (variant 2).run_id string required; Id (run_) of the run this wait belongs to.
current_wait (variant 2).kind "event" / "timer" / "child" required; Wait kind. event waits for an external event that can be submitted with runs.completeWait; timer waits until resume_at; child waits for a child run to finish.
current_wait (variant 2).state "cancelled" / "open" / "resolved" / "expired" required; Deprecated, read status, which holds the same value. Wait point state. open is still waiting; resolved was satisfied; expired passed its expires_at; cancelled was cancelled and can no longer be satisfied.
current_wait (variant 2).task null / object required; The workflow step {reference, name} that produced the wait; null when there is no such step.
current_wait (variant 2).task (variant 2).reference string required; JSON Pointer of the step, for example /do/2/wait_payment.
current_wait (variant 2).task (variant 2).name string required; Step name, the key in the workflow YAML.
current_wait (variant 2).resume_at null / string required; For kind=timer, the instant the run resumes (RFC 3339 UTC); null for other kinds.
current_wait (variant 2).event_type null / string required; For kind=event, the event type being awaited; null for other kinds.
current_wait (variant 2).child_run_id null / string required; For kind=child, the id of the child run being awaited; null for other kinds.
current_wait (variant 2).created_at string required; Time the wait point was created (RFC 3339 UTC).
current_wait (variant 2).expires_at null / string required; Time the wait point expires (RFC 3339 UTC), or null if it has no deadline.
current_wait (variant 2).resolved_at null / string required; Time the wait point was resolved (RFC 3339 UTC), or null if still open.
current_wait (variant 2).status "cancelled" / "open" / "resolved" / "expired" required; Wait point status. open is still waiting; resolved was satisfied; expired passed its expires_at; cancelled was cancelled and can no longer be satisfied.
counters object required; Cumulative counters of a run. no additional fields.
counters.calls number required; Total number of calls the script made.
counters.action_calls number required; How many of those calls invoked actions.
counters.child_runs number required; Number of child runs started.
counters.tasks_completed number required; Number of workflow steps completed.
counters.tasks_total null / number required; Number of top-level steps in the workflow; null for script runs.
input null / string / number / boolean / object / JSON[] required; Any JSON value: null, boolean, number, string, array or object.
input (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
input (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
output null / string / number / boolean / object / JSON[] required; Any JSON value: null, boolean, number, string, array or object.
output (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
output (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
error null / object required; Error details when the run faulted; null otherwise.
error (variant 2).type string required; Platform error category, or the verbatim URI defined by a workflow raise.
error (variant 2).code null / string required; Stable error code callers can branch on, or null.
error (variant 2).title string required; Short error title.
error (variant 2).detail null / string required; Detailed explanation of the error, or null.
error (variant 2).source null / object required; Where the error happened: a workflow step or script call; null when unknown.
error (variant 2).source (variant 2).kind "call" / "task" required; Location kind. task is a workflow step; call is a call in a script.
error (variant 2).source (variant 2).reference string optional; For task: the JSON Pointer of the failing step.
error (variant 2).source (variant 2).seq number optional; For call: sequence number of the failing call (matches Call.seq).
error (variant 2).source (variant 2).action object optional; The failing action {name, revision}; present only when the error came from an action. no additional fields.
error (variant 2).source (variant 2).action.name string required; Full action name, ns/name.
error (variant 2).source (variant 2).action.revision string required; Id (actr_) of the action revision that ran.
error (variant 2).request_id string / null optional; X-Request-Id of the downstream response that caused the failure; null or omitted when unavailable.
error (variant 2).errors object[] optional; Field validation errors with RFC 6901 pointers and Chinese correction details.
error (variant 2).errors[].pointer string required; RFC 6901 field pointer. TypeScript source diagnostics use /source for scripts or /implementation/source for actions; line/column are separate, not pointer segments.
error (variant 2).errors[].detail string required; Chinese correction text saying what is wrong at this location and how to fix it.
error (variant 2).errors[].hint string optional; Optional extra hint giving an actionable next step, such as using a different endpoint.
error (variant 2).errors[].line integer optional; Line number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).errors[].column integer optional; Column number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).status number optional; Optional HTTP-style status declared by a workflow raise; platform errors may omit it.
initiator object required; Principal {type, id} injected by the gateway that says who initiated or acted. This service does not resolve names; the console resolves them in batches. no additional fields.
initiator.type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
initiator.id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
channel "run" / "console" / "api" / "internal" / "trigger" required; Entry channel of the request. console is the console (through its BFF); api is a public API call; internal is an internal platform call; run is a child run created by another run; trigger is started by a trigger.
owner string required; Tenant that owns the run, injected by the gateway; treat it as an opaque string.
parent null / object required; The parent run {id, number, definition} that derived this run, or null for root runs.
parent (variant 2).id string required; Id (run_) of the parent run.
parent (variant 2).number null / number required; Sequence number of the parent run within its definition; null when the parent is ad-hoc.
parent (variant 2).definition null / object required; Script or workflow {namespace, name} of the parent run; null for an ad-hoc parent.
parent (variant 2).definition (variant 2).namespace string required; Namespace of the parent run's definition.
parent (variant 2).definition (variant 2).name string required; Name of the parent run's definition.
parent_run_id string / null required; ID of the parent run that derived this run; null for root runs
root_run_id string required; Id of the root run of this run tree; a root run points to itself.
depth number required; Depth in the run tree: 0 for the root run, plus 1 per child level, at most 10.
attach null / "wait" / "detach" required; Relationship of a child run to its parent. wait means the parent waits for the child and the child's deadline is not later than the parent's; detach means the parent does not wait and the child is not cancelled when the parent is; null for root runs.
deadline_at string required; Deadline of the run (RFC 3339 UTC): creation time plus deadline_seconds (scripts default to and are capped at 300 seconds; workflows default to 86400 and are capped at 2592000 (30 days)), and an awaited child ends at least 1 second before its parent's deadline.
created_at string required; Time the run was created (RFC 3339 UTC).
started_at null / string required; Time execution started (RFC 3339 UTC), or null while still queued.
ended_at null / string required; Time the run reached a terminal status (RFC 3339 UTC), or null while it is still active.
updated_at string required; Time the run record was last updated (RFC 3339 UTC).
heartbeat_at null / string required; Time of the executor's last liveness signal (RFC 3339 UTC), or null before the run starts.
cancel_requested_at null / string required; Time the cancellation was requested (RFC 3339 UTC), or null.
cancelled_by null / object required; Principal that requested cancellation, or null if not cancelled or not requested by a principal.
cancelled_by (variant 2).type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
cancelled_by (variant 2).id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
cancel_reason null / "user" / "parent_cancelled" / "deadline" / "executor_lost" required; Why the run was cancelled. user is a user request; parent_cancelled is a cascade from a cancelled parent run; deadline means the deadline passed; executor_lost means the executor was lost; null if not cancelled.
suspend_requested_at null / string required; Time suspension of the workflow was requested (RFC 3339 UTC), or null.
suspended_by null / object required; Principal that requested suspension, or null.
suspended_by (variant 2).type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
suspended_by (variant 2).id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
queued_ms null / number required; Milliseconds between creation and the start of execution; null until the run starts.
run_ms null / number required; Milliseconds spent executing, excluding time spent waiting on wait points; fixed once the run ends.
wait_ms null / number required; Total milliseconds spent waiting on wait points; null before any wait.
usage object / null required; Returned only in single-run details (including expand); null in lists. Runs themselves are free; these are actual charges for capabilities such as models and search called during the run, attributed by call. Unrated usage is included later. Aggregation failure or timeout (1.5 seconds) returns null while details still return 200.
usage (variant 1).currency "USD" required; Charge currency, always USD.
usage (variant 1).cost string required; Rated actual charges for this run alone, excluding descendants, as an exact dollar decimal string with six fractional digits; 0.000000 when there is no usage. pattern: "^[0-9]+\.[0-9]{6}$"
usage (variant 1).pending_events integer required; Number of this run's own unrated usage events whose charges will be included later. minimum: 0
usage (variant 1).by_service object[] required; This run's actual charges grouped by service, each with service and cost (a six-decimal dollar string); empty when there is no usage.
usage (variant 1).by_service[].service string required; Name of the service that incurred the usage, for example router or search.
usage (variant 1).by_service[].cost string required; Rated actual charges for that service as an exact dollar decimal string with six fractional digits. pattern: "^[0-9]+\.[0-9]{6}$"
usage (variant 1).tree_cost string / null required; Rated actual charges for the entire run tree including the root, as a six-decimal dollar string; null for child runs.
rerun_of null / string required; If this run was created by re-running another run, that run's id (run_); otherwise null.
labels object required; User labels and system labels; trigger runs support 64 user labels, excluding system labels.
trigger object / null required; Trigger {id, name} that started this run, or null when it was not started by a trigger.
trigger (variant 1).id string required; Id (trg_) of the trigger that started this run.
trigger (variant 1).name string required; Name of the trigger that started this run.
cancel_message string / null required; User cancellation note (1–500 characters), or null when omitted. The cancel_reason enum is unchanged.
input_truncated boolean optional; True when the list omits blob-backed input, setting input to null; inline values remain intact and run details return the full value.
output_truncated boolean optional; True when the list omits blob-backed output, setting output to null; inline values remain intact and run details return the full value.

HTTP 202

Run accepted; still pending or executing when wait expires.

Header Type Description
Idempotent-Replayed boolean true when returning a replayed run.

application/json

Field Type Description
id string required; Opaque run_ ID. New non-deterministic IDs have 78 characters: run_ + 10-character base36 millisecond timestamp + 64-character hexadecimal DO ID. Legacy random IDs have 46 characters; historical and deterministic IDs remain valid. Same-millisecond creation order is not guaranteed.
kind "script" / "workflow" required; Orchestration kind. script is a TypeScript script that executes once; workflow is a YAML workflow made of steps that can wait for events, timers or child runs and can be suspended.
number null / number required; Increasing sequence number of the run within its script or workflow; null for ad-hoc runs.
definition null / object required; The script or workflow {namespace, name} the run belongs to; null for ad-hoc runs created with source.
definition (variant 2).namespace string required; Namespace of the script or workflow.
definition (variant 2).name string required; Name of the script or workflow.
target null / string required; The target string as supplied at creation (for example acme/report@latest); null for ad-hoc runs.
resolved_version null / string required; Exact version the target resolved to; null for ad-hoc runs.
source_digest null / string required; Digest of the source of an ad-hoc run, usable to read that source; null for runs started from a published definition.
language "ts" / "yaml" required; Source language. ts is a TypeScript script; yaml is workflow YAML.
status "running" / "completed" / "faulted" / "cancelled" / "pending" / "waiting" / "suspended" required; Run status. pending is created but not started; running is executing; waiting means a workflow is waiting on an event, timer or child run; suspended means a workflow was suspended; cancelled was cancelled; faulted failed and error says why; completed finished successfully and output holds the result. The last three are terminal.
progress null / object required; Latest progress reported by the run as {label, current, total, updated_at}; null if none was reported.
progress (variant 2).label string required; Short progress label, such as the current stage.
progress (variant 2).current null / number required; Amount completed so far, or null if not reported.
progress (variant 2).total null / number required; Total amount, or null when unknown.
progress (variant 2).updated_at string required; Time progress was last updated (RFC 3339 UTC).
current_wait null / object required; The wait point the run is currently blocked on, or null when it is not waiting.
current_wait (variant 2).id string required; Wait point id, prefixed wait_; use it as wait_id when completing an event wait.
current_wait (variant 2).run_id string required; Id (run_) of the run this wait belongs to.
current_wait (variant 2).kind "event" / "timer" / "child" required; Wait kind. event waits for an external event that can be submitted with runs.completeWait; timer waits until resume_at; child waits for a child run to finish.
current_wait (variant 2).state "cancelled" / "open" / "resolved" / "expired" required; Deprecated, read status, which holds the same value. Wait point state. open is still waiting; resolved was satisfied; expired passed its expires_at; cancelled was cancelled and can no longer be satisfied.
current_wait (variant 2).task null / object required; The workflow step {reference, name} that produced the wait; null when there is no such step.
current_wait (variant 2).task (variant 2).reference string required; JSON Pointer of the step, for example /do/2/wait_payment.
current_wait (variant 2).task (variant 2).name string required; Step name, the key in the workflow YAML.
current_wait (variant 2).resume_at null / string required; For kind=timer, the instant the run resumes (RFC 3339 UTC); null for other kinds.
current_wait (variant 2).event_type null / string required; For kind=event, the event type being awaited; null for other kinds.
current_wait (variant 2).child_run_id null / string required; For kind=child, the id of the child run being awaited; null for other kinds.
current_wait (variant 2).created_at string required; Time the wait point was created (RFC 3339 UTC).
current_wait (variant 2).expires_at null / string required; Time the wait point expires (RFC 3339 UTC), or null if it has no deadline.
current_wait (variant 2).resolved_at null / string required; Time the wait point was resolved (RFC 3339 UTC), or null if still open.
current_wait (variant 2).status "cancelled" / "open" / "resolved" / "expired" required; Wait point status. open is still waiting; resolved was satisfied; expired passed its expires_at; cancelled was cancelled and can no longer be satisfied.
counters object required; Cumulative counters of a run. no additional fields.
counters.calls number required; Total number of calls the script made.
counters.action_calls number required; How many of those calls invoked actions.
counters.child_runs number required; Number of child runs started.
counters.tasks_completed number required; Number of workflow steps completed.
counters.tasks_total null / number required; Number of top-level steps in the workflow; null for script runs.
input null / string / number / boolean / object / JSON[] required; Any JSON value: null, boolean, number, string, array or object.
input (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
input (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
output null / string / number / boolean / object / JSON[] required; Any JSON value: null, boolean, number, string, array or object.
output (variant 5).* null / string / number / boolean / object / JSON[] Recursive JSON value.
output (variant 6)[] null / string / number / boolean / object / JSON[] Recursive JSON value.
error null / object required; Error details when the run faulted; null otherwise.
error (variant 2).type string required; Platform error category, or the verbatim URI defined by a workflow raise.
error (variant 2).code null / string required; Stable error code callers can branch on, or null.
error (variant 2).title string required; Short error title.
error (variant 2).detail null / string required; Detailed explanation of the error, or null.
error (variant 2).source null / object required; Where the error happened: a workflow step or script call; null when unknown.
error (variant 2).source (variant 2).kind "call" / "task" required; Location kind. task is a workflow step; call is a call in a script.
error (variant 2).source (variant 2).reference string optional; For task: the JSON Pointer of the failing step.
error (variant 2).source (variant 2).seq number optional; For call: sequence number of the failing call (matches Call.seq).
error (variant 2).source (variant 2).action object optional; The failing action {name, revision}; present only when the error came from an action. no additional fields.
error (variant 2).source (variant 2).action.name string required; Full action name, ns/name.
error (variant 2).source (variant 2).action.revision string required; Id (actr_) of the action revision that ran.
error (variant 2).request_id string / null optional; X-Request-Id of the downstream response that caused the failure; null or omitted when unavailable.
error (variant 2).errors object[] optional; Field validation errors with RFC 6901 pointers and Chinese correction details.
error (variant 2).errors[].pointer string required; RFC 6901 field pointer. TypeScript source diagnostics use /source for scripts or /implementation/source for actions; line/column are separate, not pointer segments.
error (variant 2).errors[].detail string required; Chinese correction text saying what is wrong at this location and how to fix it.
error (variant 2).errors[].hint string optional; Optional extra hint giving an actionable next step, such as using a different endpoint.
error (variant 2).errors[].line integer optional; Line number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).errors[].column integer optional; Column number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).status number optional; Optional HTTP-style status declared by a workflow raise; platform errors may omit it.
initiator object required; Principal {type, id} injected by the gateway that says who initiated or acted. This service does not resolve names; the console resolves them in batches. no additional fields.
initiator.type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
initiator.id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
channel "run" / "console" / "api" / "internal" / "trigger" required; Entry channel of the request. console is the console (through its BFF); api is a public API call; internal is an internal platform call; run is a child run created by another run; trigger is started by a trigger.
owner string required; Tenant that owns the run, injected by the gateway; treat it as an opaque string.
parent null / object required; The parent run {id, number, definition} that derived this run, or null for root runs.
parent (variant 2).id string required; Id (run_) of the parent run.
parent (variant 2).number null / number required; Sequence number of the parent run within its definition; null when the parent is ad-hoc.
parent (variant 2).definition null / object required; Script or workflow {namespace, name} of the parent run; null for an ad-hoc parent.
parent (variant 2).definition (variant 2).namespace string required; Namespace of the parent run's definition.
parent (variant 2).definition (variant 2).name string required; Name of the parent run's definition.
parent_run_id string / null required; ID of the parent run that derived this run; null for root runs
root_run_id string required; Id of the root run of this run tree; a root run points to itself.
depth number required; Depth in the run tree: 0 for the root run, plus 1 per child level, at most 10.
attach null / "wait" / "detach" required; Relationship of a child run to its parent. wait means the parent waits for the child and the child's deadline is not later than the parent's; detach means the parent does not wait and the child is not cancelled when the parent is; null for root runs.
deadline_at string required; Deadline of the run (RFC 3339 UTC): creation time plus deadline_seconds (scripts default to and are capped at 300 seconds; workflows default to 86400 and are capped at 2592000 (30 days)), and an awaited child ends at least 1 second before its parent's deadline.
created_at string required; Time the run was created (RFC 3339 UTC).
started_at null / string required; Time execution started (RFC 3339 UTC), or null while still queued.
ended_at null / string required; Time the run reached a terminal status (RFC 3339 UTC), or null while it is still active.
updated_at string required; Time the run record was last updated (RFC 3339 UTC).
heartbeat_at null / string required; Time of the executor's last liveness signal (RFC 3339 UTC), or null before the run starts.
cancel_requested_at null / string required; Time the cancellation was requested (RFC 3339 UTC), or null.
cancelled_by null / object required; Principal that requested cancellation, or null if not cancelled or not requested by a principal.
cancelled_by (variant 2).type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
cancelled_by (variant 2).id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
cancel_reason null / "user" / "parent_cancelled" / "deadline" / "executor_lost" required; Why the run was cancelled. user is a user request; parent_cancelled is a cascade from a cancelled parent run; deadline means the deadline passed; executor_lost means the executor was lost; null if not cancelled.
suspend_requested_at null / string required; Time suspension of the workflow was requested (RFC 3339 UTC), or null.
suspended_by null / object required; Principal that requested suspension, or null.
suspended_by (variant 2).type "user" / "api_key" / "agent" / "run" / "trigger" required; Principal type. user is a signed-in user; api_key is a platform API key; agent is an agent; run is an action performed by a run itself (for example a parent run); trigger is a trigger; application is an application.
suspended_by (variant 2).id string required; Principal identifier whose meaning follows type: a user, API key, agent, run, trigger or application id. Treat it as an opaque string.
queued_ms null / number required; Milliseconds between creation and the start of execution; null until the run starts.
run_ms null / number required; Milliseconds spent executing, excluding time spent waiting on wait points; fixed once the run ends.
wait_ms null / number required; Total milliseconds spent waiting on wait points; null before any wait.
usage object / null required; Returned only in single-run details (including expand); null in lists. Runs themselves are free; these are actual charges for capabilities such as models and search called during the run, attributed by call. Unrated usage is included later. Aggregation failure or timeout (1.5 seconds) returns null while details still return 200.
usage (variant 1).currency "USD" required; Charge currency, always USD.
usage (variant 1).cost string required; Rated actual charges for this run alone, excluding descendants, as an exact dollar decimal string with six fractional digits; 0.000000 when there is no usage. pattern: "^[0-9]+\.[0-9]{6}$"
usage (variant 1).pending_events integer required; Number of this run's own unrated usage events whose charges will be included later. minimum: 0
usage (variant 1).by_service object[] required; This run's actual charges grouped by service, each with service and cost (a six-decimal dollar string); empty when there is no usage.
usage (variant 1).by_service[].service string required; Name of the service that incurred the usage, for example router or search.
usage (variant 1).by_service[].cost string required; Rated actual charges for that service as an exact dollar decimal string with six fractional digits. pattern: "^[0-9]+\.[0-9]{6}$"
usage (variant 1).tree_cost string / null required; Rated actual charges for the entire run tree including the root, as a six-decimal dollar string; null for child runs.
rerun_of null / string required; If this run was created by re-running another run, that run's id (run_); otherwise null.
labels object required; User labels and system labels; trigger runs support 64 user labels, excluding system labels.
trigger object / null required; Trigger {id, name} that started this run, or null when it was not started by a trigger.
trigger (variant 1).id string required; Id (trg_) of the trigger that started this run.
trigger (variant 1).name string required; Name of the trigger that started this run.
cancel_message string / null required; User cancellation note (1–500 characters), or null when omitted. The cancel_reason enum is unchanged.
input_truncated boolean optional; True when the list omits blob-backed input, setting input to null; inline values remain intact and run details return the full value.
output_truncated boolean optional; True when the list omits blob-backed output, setting output to null; inline values remain intact and run details return the full value.

Measured response

HTTP 200

{
  "id": "run_00mvoxmhd5515a0ff756216efc1cc0464a681b6f639c81d6c5444b0d67d43df0ffaa04995d",
  "kind": "script",
  "number": null,
  "definition": null,
  "target": null,
  "resolved_version": null,
  "source_digest": "7ae6678882a4ef2ea96e401c105d5c6ef512917cd72a9235289d2a3bf1f1b49d",
  "language": "ts",
  "status": "completed",
  "progress": null,
  "current_wait": null,
  "counters": {
    "calls": 0,
    "action_calls": 0,
    "child_runs": 0,
    "tasks_completed": 0,
    "tasks_total": null
  },
  "input": {
    "n": 41
  },
  "output": {
    "answer": 42
  },
  "error": null,
  "initiator": {
    "type": "api_key",
    "id": "key_rbq66f5v9vxqbk6cd702x5er"
  },
  "channel": "api",
  "owner": "org_prxp50ywsssv6s86nhcn8yytb",
  "trigger": null,
  "parent": null,
  "parent_run_id": null,
  "root_run_id": "run_00mvoxmhd5515a0ff756216efc1cc0464a681b6f639c81d6c5444b0d67d43df0ffaa04995d",
  "depth": 0,
  "attach": null,
  "deadline_at": "2026-10-26T07:30:27.017Z",
  "created_at": "2026-10-26T07:25:27.017Z",
  "started_at": "2026-10-26T07:25:28.941Z",
  "ended_at": "2026-10-26T07:25:29.436Z",
  "updated_at": "2026-10-26T07:25:29.436Z",
  "heartbeat_at": "2026-10-26T07:25:28.941Z",
  "cancel_requested_at": null,
  "cancelled_by": null,
  "cancel_reason": null,
  "cancel_message": null,
  "suspend_requested_at": null,
  "suspended_by": null,
  "queued_ms": 1924,
  "run_ms": 495,
  "wait_ms": null,
  "usage": null,
  "rerun_of": null,
  "labels": {
    "namespace": "docs-samples",
    "name": "sample-run-1792999476245-c2cdb2"
  }
}

Errors

HTTP Codes and description
400 INVALID_PARAMS: Invalid request parameters, path, cursor, or body format. DEFINITION_INVALID: The source failed definition validation. INPUT_INVALID: The input does not satisfy the target contract or validation rules.
403 NAMESPACE_FORBIDDEN: The namespace is read-only, or the run token does not permit this call.
404 TARGET_NOT_FOUND: The target does not exist or has an incompatible type. VERSION_NOT_FOUND: The requested version or revision does not exist. RUN_NOT_FOUND: The run does not exist or is not visible to this tenant.
409 TARGET_ARCHIVED: The target is archived and cannot be used for this operation; action execution error detail includes ns/name. IDEMPOTENCY_IN_FLIGHT: A request with the same idempotency key is still in progress.
413 PAYLOAD_TOO_LARGE: The request exceeds the size allowed for this operation.
422 NO_MATCHING_VERSION: No published version matches the requested tag, version, or range. IDEMPOTENCY_KEY_MISMATCH: The idempotency key was already used for different request content.
default RFC 9457 automation problem. 429 includes Retry-After.

Authentication and common errors · Retain the X-Request-Id response header for troubleshooting.