ورکفلو
مرحلههای یک کار طولانی که بعد از هر خطا یا جابهجایی از همانجا ادامه میدهد.
/v1/workflows/configWhether workflows are served#
available: whether runs can be started and read here.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پاسخ
200object
availableboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anystatusstringکوئریonly runs in this state
one of
running,sleeping,waiting,completed,failed,cancelledfunctionstringکوئریonly this function's runs (its name or id; in the team's list
<project>/<name>)anyany
پاسخ
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
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyanyالزامیstatusstringکوئریonly runs in this state
one of
running,sleeping,waiting,completed,failed,cancelledfunctionstringکوئریonly this function's runs (its name or id; in the team's list
<project>/<name>)anyany
پاسخ
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
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyanyالزامی
بدنهٔ درخواستapplication/json
functionstringالزامیthe 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
پاسخ
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
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyidstringمسیرالزامیthe run's id (
run_…)anyالزامی
پاسخ
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)
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyidstringمسیرالزامیthe run's id (
run_…)anyالزامیanyany
پاسخ
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
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyidstringمسیرالزامیthe run's id (
run_…)anyالزامی
بدنهٔ درخواستapplication/json
typestringالزامی1 to 128 letters, digits,
.,:,_or-idstringthe event's own id, the same characters (default a new one)
payloadanyany JSON value
پاسخ
200object
runstringtypestringidstringstoredboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyidstringمسیرالزامیthe run's id (
run_…)anyالزامی
پاسخ
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)
خطاها
| وضعیت | توضیح |
|---|---|
| 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) |
نمونه
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).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anydaysintegerکوئریhow many days back (default 30, at most 90)
1–90
پاسخ
200object
daysintegerrunsintegerstepsintegerper_dayobject[]daystringrunsintegerstepsinteger
metersobject[]list_rialsintegerpricedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anydaysintegerکوئریhow many days back: 1 to 90 (default 30)
1–90 · default
30
پاسخ
200object
daysintegerrunsintegerstepsintegerper_dayobject[]daystringrunsintegerstepsinteger
metersobject[]list_rialsintegerpricedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
curl "https://api.ibel.ai/v1/workflows/usage" \
-H "Authorization: Bearer $KEY"