Automation

Rerun a run

Create a new root run from the original exact version or ad hoc source, retaining labels and setting rerun_of.

Create a new root run from the original exact version or ad hoc source, retaining labels and setting rerun_of. Override input or omit it to reuse the original input; archived targets and run tokens are rejected.

POST /automation/v1/runs/{id}/rerun

Authentication

Authorization: Bearer $PRAXIS_API_KEY

Request fields

ParameterTypeDescription
path: idstringrequired; Run ID (run_).
header: Idempotency-Keystringoptional; Optional; 1–256 characters. Within 24 hours, the same key replays the first response with Idempotent-Replayed: true; a different request body returns 422; an in-flight request returns 409. minLength: 1; maxLength: 256

application/json

no additional fields.

FieldTypeDescription
inputnull / string / number / boolean / object / null / string / number / boolean / object / JSON[][]optional; Optional replacement input; omit to reuse the original run input. Must satisfy the target schema.
input (variant 5).* (variant 5)objectRecursive JSON value.
input (variant 5).* (variant 6)[]null / string / number / boolean / object / JSON[]Recursive JSON value.
input (variant 6)[] (variant 5).*null / string / number / boolean / object / JSON[]Recursive JSON value.
input (variant 6)[] (variant 6)[]null / string / number / boolean / object / JSON[]Recursive JSON value.

Examples

Set these environment variables to your own resources:

: "${RUN_ID:?Set RUN_ID}"
curl --fail-with-body -X POST "https://api.deepraxis.ai/automation/v1/runs/${RUN_ID}/rerun" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "input": {
    "n": 42
  }
}'
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.ai',
  maxRetries: 0,
  timeoutMs: 90_000,
});
const result = await automation.runs.rerun({
  "path": {
    "id": env("RUN_ID")
  },
  "body": {
    "input": {
      "n": 42
    }
  }
});
console.log(result);

Response

HTTP 200

Success

HeaderTypeDescription
Idempotent-ReplayedbooleanPresent and true when replaying the first response for this key.

application/json

FieldTypeDescription
idstringrequired; 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.
numbernull / numberrequired; Increasing sequence number of the run within its script or workflow; null for ad-hoc runs.
definitionnull / objectrequired; The script or workflow {namespace, name} the run belongs to; null for ad-hoc runs created with source.
definition (variant 2).namespacestringrequired; Namespace of the script or workflow.
definition (variant 2).namestringrequired; Name of the script or workflow.
targetnull / stringrequired; The target string as supplied at creation (for example acme/report@latest); null for ad-hoc runs.
resolved_versionnull / stringrequired; Exact version the target resolved to; null for ad-hoc runs.
source_digestnull / stringrequired; 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.
progressnull / objectrequired; Latest progress reported by the run as {label, current, total, updated_at}; null if none was reported.
progress (variant 2).labelstringrequired; Short progress label, such as the current stage.
progress (variant 2).currentnull / numberrequired; Amount completed so far, or null if not reported.
progress (variant 2).totalnull / numberrequired; Total amount, or null when unknown.
progress (variant 2).updated_atstringrequired; Time progress was last updated (RFC 3339 UTC).
current_waitnull / objectrequired; The wait point the run is currently blocked on, or null when it is not waiting.
current_wait (variant 2).idstringrequired; Wait point id, prefixed wait_; use it as wait_id when completing an event wait.
current_wait (variant 2).run_idstringrequired; 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; 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).tasknull / objectrequired; The workflow step {reference, name} that produced the wait; null when there is no such step.
current_wait (variant 2).task (variant 2).referencestringrequired; JSON Pointer of the step, for example /do/2/wait_payment.
current_wait (variant 2).task (variant 2).namestringrequired; Step name, the key in the workflow YAML.
current_wait (variant 2).resume_atnull / stringrequired; For kind=timer, the instant the run resumes (RFC 3339 UTC); null for other kinds.
current_wait (variant 2).event_typenull / stringrequired; For kind=event, the event type being awaited; null for other kinds.
current_wait (variant 2).child_run_idnull / stringrequired; For kind=child, the id of the child run being awaited; null for other kinds.
current_wait (variant 2).created_atstringrequired; Time the wait point was created (RFC 3339 UTC).
current_wait (variant 2).expires_atnull / stringrequired; Time the wait point expires (RFC 3339 UTC), or null if it has no deadline.
current_wait (variant 2).resolved_atnull / stringrequired; Time the wait point was resolved (RFC 3339 UTC), or null if still open.
countersobjectrequired; Cumulative counters of a run. no additional fields.
counters.callsnumberrequired; Total number of calls the script made.
counters.action_callsnumberrequired; How many of those calls invoked actions.
counters.child_runsnumberrequired; Number of child runs started.
counters.tasks_completednumberrequired; Number of workflow steps completed.
counters.tasks_totalnull / numberrequired; Number of top-level steps in the workflow; null for script runs.
inputnull / 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.
outputnull / 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.
errornull / objectrequired; Error details when the run faulted; null otherwise.
error (variant 2).typestringrequired; Platform error category, or the verbatim URI defined by a workflow raise.
error (variant 2).codenull / stringrequired; Stable error code callers can branch on, or null.
error (variant 2).titlestringrequired; Short error title.
error (variant 2).detailnull / stringrequired; Detailed explanation of the error, or null.
error (variant 2).sourcenull / objectrequired; 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).referencestringoptional; For task: the JSON Pointer of the failing step.
error (variant 2).source (variant 2).seqnumberoptional; For call: sequence number of the failing call (matches Call.seq).
error (variant 2).source (variant 2).actionobjectoptional; The failing action {name, revision}; present only when the error came from an action. no additional fields.
error (variant 2).source (variant 2).action.namestringrequired; Full action name, ns/name.
error (variant 2).source (variant 2).action.revisionstringrequired; Id (actr_) of the action revision that ran.
error (variant 2).request_idstring / nulloptional; X-Request-Id of the downstream response that caused the failure; null or omitted when unavailable.
error (variant 2).errorsobject[]optional; Field validation errors with RFC 6901 pointers and Chinese correction details.
error (variant 2).errors[].pointerstringrequired; 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[].detailstringrequired; Chinese correction text saying what is wrong at this location and how to fix it.
error (variant 2).errors[].hintstringoptional; Optional extra hint giving an actionable next step, such as using a different endpoint.
error (variant 2).errors[].lineintegeroptional; Line number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).errors[].columnintegeroptional; Column number, 1-based; present only when a source location is available. minimum: 1
error (variant 2).statusnumberoptional; Optional HTTP-style status declared by a workflow raise; platform errors may omit it.
initiatorobjectrequired; 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.
initiator.idstringrequired; Principal identifier whose meaning follows type: a user, API key, agent, run or trigger 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.
ownerstringrequired; Tenant that owns the run, injected by the gateway; treat it as an opaque string.
parentnull / objectrequired; The parent run {id, number, definition} that derived this run, or null for root runs.
parent (variant 2).idstringrequired; Id (run_) of the parent run.
parent (variant 2).numbernull / numberrequired; Sequence number of the parent run within its definition; null when the parent is ad-hoc.
parent (variant 2).definitionnull / objectrequired; Script or workflow {namespace, name} of the parent run; null for an ad-hoc parent.
parent (variant 2).definition (variant 2).namespacestringrequired; Namespace of the parent run's definition.
parent (variant 2).definition (variant 2).namestringrequired; Name of the parent run's definition.
parent_run_idstring / nullrequired; ID of the parent run that derived this run; null for root runs
root_run_idstringrequired; Id of the root run of this run tree; a root run points to itself.
depthnumberrequired; Depth in the run tree: 0 for the root run, plus 1 per child level, at most 10.
attachnull / "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_atstringrequired; 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 604800), and an awaited child ends at least 1 second before its parent's deadline.
created_atstringrequired; Time the run was created (RFC 3339 UTC).
started_atnull / stringrequired; Time execution started (RFC 3339 UTC), or null while still queued.
ended_atnull / stringrequired; Time the run reached a terminal status (RFC 3339 UTC), or null while it is still active.
updated_atstringrequired; Time the run record was last updated (RFC 3339 UTC).
heartbeat_atnull / stringrequired; Time of the executor's last liveness signal (RFC 3339 UTC), or null before the run starts.
cancel_requested_atnull / stringrequired; Time the cancellation was requested (RFC 3339 UTC), or null.
cancelled_bynull / objectrequired; 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.
cancelled_by (variant 2).idstringrequired; Principal identifier whose meaning follows type: a user, API key, agent, run or trigger id. Treat it as an opaque string.
cancel_reasonnull / "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_atnull / stringrequired; Time suspension of the workflow was requested (RFC 3339 UTC), or null.
suspended_bynull / objectrequired; 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.
suspended_by (variant 2).idstringrequired; Principal identifier whose meaning follows type: a user, API key, agent, run or trigger id. Treat it as an opaque string.
queued_msnull / numberrequired; Milliseconds between creation and the start of execution; null until the run starts.
run_msnull / numberrequired; Milliseconds spent executing, excluding time spent waiting on wait points; fixed once the run ends.
wait_msnull / numberrequired; Total milliseconds spent waiting on wait points; null before any wait.
usageobject / nullrequired; 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).coststringrequired; 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_eventsintegerrequired; Number of this run's own unrated usage events whose charges will be included later. minimum: 0
usage (variant 1).by_serviceobject[]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[].servicestringrequired; Name of the service that incurred the usage, for example router or search.
usage (variant 1).by_service[].coststringrequired; 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_coststring / nullrequired; Rated actual charges for the entire run tree including the root, as a six-decimal dollar string; null for child runs.
rerun_ofnull / stringrequired; If this run was created by re-running another run, that run's id (run_); otherwise null.
labelsobjectrequired; User labels and system labels; trigger runs support 64 user labels, excluding system labels.
triggerobject / nullrequired; Trigger {id, name} that started this run, or null when it was not started by a trigger.
trigger (variant 1).idstringrequired; Id (trg_) of the trigger that started this run.
trigger (variant 1).namestringrequired; Name of the trigger that started this run.
cancel_messagestring / nullrequired; User cancellation note (1–500 characters), or null when omitted. The cancel_reason enum is unchanged.
input_truncatedbooleanoptional; True when the list omits blob-backed input, setting input to null; inline values remain intact and run details return the full value.
output_truncatedbooleanoptional; 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_00mv67mj3s5141d7514d6e0c18cd71ba7e821b89faadad8897cc6bedb103209efe6de40b4d",
  "kind": "script",
  "number": null,
  "definition": null,
  "target": null,
  "resolved_version": null,
  "source_digest": "7ae6678882a4ef2ea96e401c105d5c6ef512917cd72a9235289d2a3bf1f1b49d",
  "language": "ts",
  "status": "running",
  "progress": null,
  "current_wait": null,
  "counters": {
    "calls": 0,
    "action_calls": 0,
    "child_runs": 0,
    "tasks_completed": 0,
    "tasks_total": null
  },
  "input": {
    "n": 42
  },
  "output": null,
  "error": null,
  "initiator": {
    "type": "api_key",
    "id": "key_3e00b8984967"
  },
  "channel": "api",
  "owner": "tnt_3a9759864ccb4e00",
  "trigger": null,
  "parent": null,
  "parent_run_id": null,
  "root_run_id": "run_00mv67mj3s5141d7514d6e0c18cd71ba7e821b89faadad8897cc6bedb103209efe6de40b4d",
  "depth": 0,
  "attach": null,
  "deadline_at": "2026-10-13T05:02:48.088Z",
  "created_at": "2026-10-13T04:57:48.088Z",
  "started_at": "2026-10-13T04:57:49.075Z",
  "ended_at": null,
  "updated_at": "2026-10-13T04:57:49.075Z",
  "heartbeat_at": "2026-10-13T04:57:49.075Z",
  "cancel_requested_at": null,
  "cancelled_by": null,
  "cancel_reason": null,
  "cancel_message": null,
  "suspend_requested_at": null,
  "suspended_by": null,
  "queued_ms": 987,
  "run_ms": null,
  "wait_ms": null,
  "usage": null,
  "rerun_of": "run_00mv67mdlm5d5d707cd031744e8437f67f6acf02afaabd18e76bf8db9d674333de6f1fb2f1",
  "labels": {
    "namespace": "docs-samples",
    "name": "sample-run-1791867412840-b05e8a"
  }
}

Errors

HTTPCodes and description
400INVALID_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.
403NAMESPACE_FORBIDDEN: The namespace is read-only, or the run token does not permit this call.
404TARGET_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.
409IDEMPOTENCY_IN_FLIGHT: A request with the same idempotency key is still in progress. TARGET_ARCHIVED: The target is archived and cannot be used for this operation; action execution error detail includes ns/name.
413PAYLOAD_TOO_LARGE: The request exceeds the size allowed for this operation.
422IDEMPOTENCY_KEY_MISMATCH: The idempotency key was already used for different request content. NO_MATCHING_VERSION: No published version matches the requested tag, version, or range.
defaultRFC 9457 automation problem. 429 includes Retry-After.

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

Export

On this page