POST
/
v2
/
runs
curl --request POST \
  --url https://api.workflows.tryleap.ai/v2/runs \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "workflow_id": "wkfv2_bZNg4zPR44mA",
  "trigger_id": "ncc6725",
  "webhook_url": "https://myapp.com/webhook",
  "input": {
    "first_name": "Sam",
    "last_name": "Altman"
  }
}'
{
  "id": "<string>",
  "version_id": "<string>",
  "workflow_id": "<string>",
  "status": "completed",
  "created_at": "<string>",
  "error": null,
  "result": null
}

This endpoint initiates a workflow run asynchronously. It returns a workflow run id immediately and does not wait for completion.

To monitor the workflow’s progress and get results, use the Get Workflow Run endpoint with the returned id. A common pattern is to poll this endpoint periodically until the workflow completes.

Authorizations

X-Api-Key
string
header
required

Body

application/json
workflow_id
string
required

The ID of the workflow to be run.

trigger_id
string

The ID of the node to start the workflow with.

webhook_url
string

The URL to which the workflow results should be sent to on completion.

input
object

Variables that the workflow can use globally and their values.

Response

200
application/json
The workflow has been successfully initiated.
id
string
required
version_id
string
required
workflow_id
string
required
status
enum<string>
required
Available options:
completed,
running,
failed,
queued,
cancelled
created_at
string
required
error
string | null
required
result
object | null
required