Execution
post/v1/workflows/{id}/command

Execute a workflow command

Sends a control command to a workflow. The command field determines the action:

start — Creates a new run. Pass inputs to provide the trigger payload; step arguments can reference these values via {{input.<field>}}. Returns the new run object with status: "pending" or status: "running". Execution continues asynchronously — subscribe to the WebSocket stream to follow progress.

pause — Halts dispatching of new steps for the specified run_id. In-flight steps complete normally. The run moves to status: "paused".

resume — Re-evaluates the graph from the current state and resumes dispatching ready steps. The run moves back to status: "running".

cancel — Terminates all in-flight steps and moves the run to status: "cancelled". This action is irreversible.

> Tip: Subscribe to GET /workflows/{id}/stream before sending start to capture > all events from the beginning of the run.

Server

https://api.agentruntime.io/v1/workflows/{id}/command
Production
AuthenticationRequiredBearerAuth

API key obtained from the AgentRuntime dashboard. Pass as Authorization: Bearer <key> on every request.

Stored only in this page session. It is not saved to local storage.

Test Request

Runs from your browser. Non-GET requests require explicit confirmation and tokens are sent only when you click Send.

Enter a bearer token and confirm the non-GET request to enable testing.

Client Libraries
Shell
curl -sS -X POST \
  'https://api.agentruntime.io/v1/workflows/{id}/command' \
  -H 'Authorization: Bearer <token>'

application/json

commandrequired

stringenum: start | pause | resume | cancel

The action to perform.

Example: "start"

inputs
context
run_id

string

Required for pause, resume, and cancel commands — identifies the specific run to act on.

Example: "run_01hw3k9x4v8m"

  • 200Command accepted. Returns current run state.

    application/json

    id

    string

    Unique run identifier.

    Example: "run_01hw3k9x4v8m"

    workflow_id

    string

    Example: "wf_01hw3k9x4v8m"

    status

    stringenum: pending | running | paused | completed | failed | cancelled

    • pending: accepted but not yet dispatched
    • running: actively executing steps
    • paused: execution halted (manual pause or awaiting human task)
    • completed: all steps finished successfully
    • failed: one or more steps failed with no remaining retries
    • cancelled: stopped via a cancel command

    Example: "running"

    started_at

    string

    Example: "2026-04-10T11:00:00Z"

    completed_at

    string

    Example: null

    inputs
    outputs
    {
      "id": "run_01hw3k9x4v8m",
      "workflow_id": "wf_01hw3k9x4v8m",
      "status": "running",
      "started_at": "2026-04-10T11:00:00Z",
      "completed_at": null,
      "inputs": {
        "message": "I need help cancelling my subscription",
        "customer_id": "cust_8821"
      }
    }
  • 401Missing or invalid Bearer token.

    application/json

    errorrequired

    string

    Human-readable description of what went wrong.

    Example: "workflow not found"

    code

    string

    Machine-readable error code for programmatic handling.

    Example: "NOT_FOUND"

    {
      "error": "unauthorized",
      "code": "UNAUTHORIZED"
    }
  • 404The requested resource does not exist.

    application/json

    errorrequired

    string

    Human-readable description of what went wrong.

    Example: "workflow not found"

    code

    string

    Machine-readable error code for programmatic handling.

    Example: "NOT_FOUND"

    {
      "error": "workflow not found",
      "code": "NOT_FOUND"
    }
  • 422The request body is valid JSON but fails business validation.

    application/json

    errorrequired

    string

    Human-readable description of what went wrong.

    Example: "workflow not found"

    code

    string

    Machine-readable error code for programmatic handling.

    Example: "NOT_FOUND"

    {
      "error": "workflow definition is missing required field: steps",
      "code": "VALIDATION_ERROR"
    }
  • 500Unexpected server error.

    application/json

    errorrequired

    string

    Human-readable description of what went wrong.

    Example: "workflow not found"

    code

    string

    Machine-readable error code for programmatic handling.

    Example: "NOT_FOUND"

    {
      "error": "internal server error",
      "code": "INTERNAL_ERROR"
    }