Factories

Dispatch a run to a factory

Changed on

Dispatch a run to a factory, using prompt as the run's prompt and an optional title, ticket_ref, and ticket_url. Returns the created run; its factory task is created asynchronously and can be resolved afterwards with GET /factory/{uid}/task-by-run.

post/factory/{uid}/runs

Request

  • Base URL
    https://app.warp.dev/api/v1
  • Auth
    HTTP bearer

Path parameters

uidstring required

The public UID of the factory.

Request body

branchstring nullable

Exact named head in the registered source repository, optionally prefixed with refs/heads/. Case and slashes are preserved. Omission, null, or the registered production branch uses production. Empty strings, revision expressions, tags, forks, and alternate repository coordinates are not accepted. Non-production selection is rejected when factory_branches is off.

promptstring required

The prompt sent to the factory's foreman, not wrapped in any factory intake envelope. Required and non-empty.

titlestring

Human-readable title for the dispatched run and its factory task. Omit to derive one automatically from the prompt.

ticket_refstring

Originating ticket reference in <source>:<id> form (for example, linear:REMOTE-123); omit to mint an adhoc reference. Stamped onto the run as ticket_id/ticket_source metadata.

ticket_urlstring

Optional URL of the ticket named by ticket_ref. Stamped onto the run as ticket_url metadata when given.

Response

Run dispatched successfully

run_idstring required

Unique identifier for the dispatched run.

run_urlstring

URL to view the dispatched run in the Factory app. Empty when the Factory app origin is not configured.

state'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED' | 'BLOCKED' | 'ERROR' | 'CANCELLED' required

Current state of the run:

  • QUEUED: Run is waiting to be picked up
  • PENDING: Run is being prepared
  • CLAIMED: Run has been claimed by a worker
  • INPROGRESS: Run is actively being executed
  • SUCCEEDED: Run completed successfully
  • FAILED: Run failed
  • BLOCKED: Run is blocked (e.g., awaiting user input or approval)
  • ERROR: Run encountered an error
  • CANCELLED: Run was cancelled by user
factory_uidstring required

Public UID of the factory the run was dispatched to.

foreman_agentstring required

Name of the factory's foreman agent that received the run.

ticket_refstring required

The canonical <source>:<id> ticket reference the run was stamped with, either the caller-supplied ticket_ref or a minted adhoc reference.

Changes