Skip to main content
POST
Execute a workflow by slug or slug@version

Authorizations

Authorization
string
header
required

User session JWT (Bearer ). Must be paired with the X-Team-ID request header on team-scoped endpoints so the server knows which team's resources to operate on.

Headers

X-Team-ID
string<uuid>

UUID of the team to scope the request to. Used by dual-auth endpoints (runtime + scoped management):

  • JWT callers MUST send it — a user may belong to multiple teams and the runtime cannot otherwise know which one to operate on. Missing header → 400.
  • Credential callers (sk-, dk-) can omit it because the team is derived from the credential row itself. Any value sent is ignored.
Example:

"019abc12-4567-7890-abcd-ef1234567891"

Path Parameters

workflowSlug
string
required

Workflow slug for runtime lookup. Use slug for the latest version or slug@version to reference an immutable workflow snapshot, e.g. text-to-image@2.

Maximum string length: 128
Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*(?:@[1-9][0-9]*)?$
Example:

"text-to-image@2"

Body

application/json

Request body to execute a workflow with optional parameter overrides.

Workflow run usage

Step 1 — Discover available parameters

Call GET /r/workflows/{workflowId} or GET /r/workflows/slug/{workflowSlug} to retrieve the workflow detail. To target a previous workflow version, use slug@version (for example, text-to-image@2). The parameters array contains ParameterDef entries that describe every user-configurable input. Each entry has:

Example parameters from a workflow detail response:

Step 2 — Build the run request

Use the key values from the parameter definitions as keys in the parameters object:

For type: file parameters, upload the file first, then pass the file_key:

  1. POST /r/files/presign with {"file_name": "photo.png", "file_size": 1048576, "content_type": "image/png"}
  2. Upload the file to the returned upload_url via HTTP PUT.
  3. Pass the file_key as the parameter value:

Step 3 — Validation rules

  • Unknown keys400 Bad Request (only keys from ParameterDef are accepted).
  • Missing required keys400 Bad Request.
  • Type mismatch400 Bad Request (e.g. string for a number parameter).
  • Out of range400 Bad Request (number outside min/max bounds).
  • Invalid select value400 Bad Request (value not in the options list).
  • File not uploaded400 Bad Request (file_key not found in S3).
  • File wrong team400 Bad Request (file_key must belong to the team).
  • File type rejected400 Bad Request (file MIME doesn't match accept pattern).
  • Omitted optional keys → the workflow's default value is used automatically.
  • Empty body {} → valid if no parameters are required (all have defaults).
  • Workflow with no parameters → send {} or omit parameters entirely.

Step 4 — Poll for results

The response contains a task_id. Poll status:

When task_status is completed, fetch the output:

parameters
object

Key-value map of parameter overrides. Keys must match the key field of a ParameterDef entry defined in the workflow's parameters array.

For type: file parameters, the value must be a file_key string obtained from POST /r/files/presign. Upload the file first, then pass the key here.

Retrieve available keys by calling GET /r/workflows/{workflowId} or GET /r/workflows/slug/{workflowSlug} and inspecting the parameters array in the response. Use workflowSlug@version to discover parameters for a previous workflow version.

Maximum 100 parameter keys per request.

Example:
dispatch_target
enum<string>

Where to execute this task:

  • agent (default): Execute on a local BYOC agent.
  • comfy_cloud: Execute on ComfyUI Cloud (requires configured API key).

If omitted, the workflow's default_dispatch_target is used, falling back to agent.

Available options:
agent,
comfy_cloud
Example:

"agent"

target_pool
enum<string>

Dispatch pool for this task. Only meaningful when dispatch_target=agent.

  • team (default): route to an agent in the same team — the P2.1 behaviour.
  • community: route to any opted-in agent across teams via the Cyberun community pool. Submitting team does not need to opt in to consume; the serving agent does.

If omitted, defaults to team.

Available options:
team,
community
Example:

"team"

submitter_region
string

Submitter's declared geographic / network locality, used by the P3.1 scoring engine to favour region-matching agents when multiple candidates are eligible. Opaque user-supplied string (e.g. us-east, eu-central, ap-southeast); normalised server-side to lowercase + trimmed. Empty / omitted → scorer treats as unknown (neutral 0.5 region factor; no agent is disqualified). Has no effect on dispatch_target=comfy_cloud.

Maximum string length: 64
Example:

"us-east"

tool_type
enum<string>

Tool runtime used by this workflow:

  • comfyui: ComfyUI API workflow JSON (default, backward compatible).
  • nerfstudio: Nerfstudio 3DGS pipeline spec.
Available options:
comfyui,
nerfstudio
Example:

"comfyui"

Response

Task submitted

task_id
string<uuid>
required

ID of the created task. Use this to poll task status and results.

Example:

"019abc12-9012-7890-abcd-ef1234567896"