Skip to main content

Run a workflow

POST /projects/:projectid/workflows/:workflowid/runsync

Run a workflow and wait for its outputs.

Runs the workflow and holds the connection open until it finishes, returning its outputs directly. Use the queued endpoint instead for work that takes more than a few seconds.

Authentication

  • Project API key: The credential for everything external. Created in Project Settings, bound to one project, and limited to the scopes it was granted. Format: proj.<keyId>.<secret>.
  • Required permission: workflows.run on :workflowid.

Path parameters

NameTypeRequiredDefaultDescription
projectidstringYes-The project id.
workflowidstringYes-The workflow to run.

Request body

Content type: application/json

NameTypeRequiredDefaultDescription
inputsobjectNonullValues passed to the workflow. The shape is whatever your workflow reads.
runEventstringNo"run"Which entry point to trigger.
versionstringNonullA published version to pin to. Omit for the latest.

Example

{
"runEvent": "run",
"inputs": {
"name": "Ada"
}
}

Example request

curl -X POST \
-H "Authorization: proj.KEY_ID.SECRET" \
-H "Content-Type: application/json" \
-d '{"runEvent":"run","inputs":{"name":"Ada"}}' \
{{BASE_URL}}/projects/{{PROJECT_ID}}/workflows/YOUR_WORKFLOW_ID/runsync

Responses

200

The run finished. Check success — a failed workflow also returns 200.

{
"success": true,
"statusCode": 200,
"result": {
"outputs": {
"greeting": "Hello Ada"
}
}
}

200 — failure

The workflow itself failed.

{
"success": false,
"statusCode": 400,
"err": {
"message": "Node AIWrite failed: model unavailable"
}
}

403

The key lacks run permission on this workflow.