Workflows
Durable runs of a function's workflow export, step by step. A finished step never runs again after a crash or a deploy; steps retry on their own; a run sleeps for months or waits for an event. Started over the API, with idempotency keys.
/v1/workflows/configWhether workflows are served#
available: whether runs can be started and read here.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Response
200object
availableboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/workflows/config" \
-H "Authorization: Bearer $KEY"/v1/workflows/runsThe team's runs#
Every project's runs, oldest first, or one project's with project.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anystatusstringqueryonly runs in this state
one of
running,sleeping,waiting,completed,failed,cancelledfunctionstringqueryonly this function's runs (its name or id; in the team's list
<project>/<name>)anyany
Response
200object
runsWorkflowRun[]idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
next_cursorstring
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param, bad_cursor |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl "https://api.ibel.ai/v1/workflows/runs" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/workflows/runsA project's runs#
The runs of the project's functions, oldest first.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anyanyrequiredstatusstringqueryonly runs in this state
one of
running,sleeping,waiting,completed,failed,cancelledfunctionstringqueryonly this function's runs (its name or id; in the team's list
<project>/<name>)anyany
Response
200object
runsWorkflowRun[]idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
next_cursorstring
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param, bad_cursor, bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl "https://api.ibel.ai/v1/projects/my-api/workflows/runs" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/workflows/runsStart a run#
Starts the workflow of one of the project's functions with input. With an idempotency_key already used, the same run is answered (200, created: false).
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
anyanyrequired
Request bodyapplication/json
functionstringrequiredthe function's name in the project (any case) or its id
inputanyany JSON value, given to the workflow as its event
idempotency_keystring1 to 128 letters, digits,
.,:,_or-; a start with a key used before answers that run
Response
200WorkflowRunThe run started before with this idempotency key
idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
201WorkflowRun
idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)createdboolean
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_function, bad_idempotency_key, bad_request, bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden, account_blocked |
| 404 | Not found: not_found |
| 409 | Conflict: not_deployed (the function has no live version) |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl -X POST "https://api.ibel.ai/v1/projects/my-api/workflows/runs" \
-H "Authorization: Bearer $KEY" \
-d '{"function":"…"}'/v1/projects/{project}/workflows/runs/{id}One run#
Its state, input, output, error and the step it is on.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anyidstringpathrequiredthe run's id (
run_…)anyrequired
Response
200WorkflowRun
idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl "https://api.ibel.ai/v1/projects/my-api/workflows/runs/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/workflows/runs/{id}/historyA run's history#
Every line of the run's history in order (started, each step and retry with its attempt and error, sleeps, waits, events, the end) and each finished step's result.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anyidstringpathrequiredthe run's id (
run_…)anyrequiredanyany
Response
200object
runWorkflowRunidstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
historyWorkflowEntry[]seqintegeratstring (date-time)kindstringone of
started,step,retry,sleep,woke,wait,event,timeout,completed,failed,cancelledstepstringattemptintegererrorstringuntilstring (date-time)eventstring
resultsobjecteach finished step's result, by the step's name
next_cursorstring
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_cursor, bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl "https://api.ibel.ai/v1/projects/my-api/workflows/runs/88e2fe1d-6d75-4de5-8c8f-27380ec66903/history" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/workflows/runs/{id}/eventsSend an event to a run#
An event for a step that waits for its type; one that arrives early is kept for it. The same id twice is kept once (stored: false).
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
anyidstringpathrequiredthe run's id (
run_…)anyrequired
Request bodyapplication/json
typestringrequired1 to 128 letters, digits,
.,:,_or-idstringthe event's own id, the same characters (default a new one)
payloadanyany JSON value
Response
200object
runstringtypestringidstringstoredboolean
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_event, bad_request, bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: run_finished |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl -X POST "https://api.ibel.ai/v1/projects/my-api/workflows/runs/88e2fe1d-6d75-4de5-8c8f-27380ec66903/events" \
-H "Authorization: Bearer $KEY" \
-d '{"type":"…"}'/v1/projects/{project}/workflows/runs/{id}/cancelCancel a run#
Stops the run: no further step starts.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
anyidstringpathrequiredthe run's id (
run_…)anyrequired
Response
200WorkflowRun
idstringrun_…functionstringthe function whose workflow it runs (null once that function is deleted)
kindstringprojectobjectidstringnamestring
versionstringthe deployment it started on; it keeps it across later deploys
statusstringone of
running,sleeping,waiting,completed,failed,cancelledinputanyoutputanyerrorstringidempotency_keystringstepsintegerfinished steps
currentstringthe step being retried, slept or waited
attemptintegerfailed attempts of the current step
wake_atstring (date-time)wait_forstringthe event type a waiting run waits for
created_atstring (date-time)updated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_environment |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: run_finished |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: workflows_unavailable (try again shortly) |
Example
curl -X POST "https://api.ibel.ai/v1/projects/my-api/workflows/runs/88e2fe1d-6d75-4de5-8c8f-27380ec66903/cancel" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/workflows/usageRuns and steps used#
Runs started and steps run per day by the project's functions, and their cost at list price once a step has a price (priced).
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anydaysintegerqueryhow many days back (default 30, at most 90)
1–90
Response
200object
daysintegerrunsintegerstepsintegerper_dayobject[]daystringrunsintegerstepsinteger
metersobject[]list_rialsintegerpricedboolean
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/projects/my-api/workflows/usage" \
-H "Authorization: Bearer $KEY"/v1/workflows/usageThe team's runs and steps#
Runs started and steps run per day by every project's functions added up (the team view), or one project's with project, and their cost at list price once a step has a price (priced). project in the answer is the project asked for, or null.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anydaysintegerqueryhow many days back: 1 to 90 (default 30)
1–90 · default
30
Response
200object
daysintegerrunsintegerstepsintegerper_dayobject[]daystringrunsintegerstepsinteger
metersobject[]list_rialsintegerpricedboolean
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found (no such project) |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/workflows/usage" \
-H "Authorization: Bearer $KEY"