Skip to content

Execute workflow

POST
/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs
curl --request POST \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/workflows/:workflow_id/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"inputs": {},
"session_id": "<uuid>",
"session_name": "<string>"
}'

Start a workflow execution. Returns immediately with a run ID. Poll with GET /workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id} for results. Creative Units are not checked here: an underfunded workspace is still accepted and the run then reports FAILURE with error_code BlueprintInsufficientBalanceError. Use the estimate endpoint’s has_sufficient_creative_units to check before submitting.

workspace_id
required
Workspace Id
string format: uuid
workflow_id
required
Workflow Id
string format: uuid
Media typeapplication/json
ExecuteWorkflowRequest
object
inputs
required
Inputs

Input values matching the workflow’s input schema.

object
key
additional properties
any
session_id
Any of:
string format: uuid
session_name
Any of:
string
Examplegenerated
{
"inputs": {},
"session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"session_name": "example"
}

Successful Response

Media typeapplication/json
ExecuteWorkflowOutput
object
run_id
required
Run Id

Unique identifier for this workflow run.

string format: uuid
status
required
BlueprintRunStatus

Current run status: PENDING or RUNNING.

string
Allowed values: pending running success failure cancelled
estimated_price_creative_units
required
Estimated Price Creative Units

Estimated price in Creative Units.

number
poll_interval_seconds
required
Poll Interval Seconds

Suggested polling interval in seconds.

integer
created_at
required
Created At

Timestamp of when the run was created.

string format: date-time
session_id
Any of:
string format: uuid
Example
{
"status": "pending"
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Forbidden — insufficient permissions.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Invalid input parameters.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Rate limited — too many concurrent requests.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}