Workflows
Automation graphs and their runs. A workflow only executes once published. See the Workflows guide.
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
16 endpoints.
GET /workflow
Get all workflows.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowPage.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
POST /workflow
Create workflow.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowPage.jsx
:::
Request body
| Field | Default | Notes |
|---|---|---|
name | — | Made unique automatically — a clash gets a suffix rather than an error. |
triggerEventType | — | The event that starts a run, e.g. lead.created. |
config | {} | Workflow-level settings. |
nodes | [] | The graph's nodes. Sent whole. |
edges | [] | The graph's edges. Sent whole. |
schedule | — | For time-triggered workflows instead of event-triggered ones. |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
DELETE /workflow
Delete workflows.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowPage.jsx
:::
Request body
| Field | Default | Notes |
|---|---|---|
ids | [] | Documents to act on. |
nids | [] | Documents to exclude. |
selectAll | false | Act on everything matching the query-string filter instead of an id list. |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
GET /workflow/:id
Get workflow.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowRunsPage.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
PUT /workflow/:id
Update workflow.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowRunsPage.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default |
|---|---|
name | — |
triggerEventType | — |
config | — |
nodes | — |
edges | — |
status | — |
schedule | — |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
DELETE /workflow/:id
Delete workflow.
Auth apikey
:::note Used by the web app
pages/AddWorkflow.jsx, pages/WorkflowRunsPage.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
POST /workflow/:id/publish
Publish workflow.
Auth apikey
:::note Used by the web app
pages/WorkflowRunsPage.jsx
:::
Prerequisites
- A workflow with a graph. Create it, then publish — an unpublished workflow never runs.
POST /workflow·PUT /workflow/:id
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
POST /workflow/:id/runs/pause
Pause every in-flight run of one workflow.
Auth apikey
:::note Used by the web app
pages/WorkflowRunsPage.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
POST /workflow/:id/unpublish
Unpublish workflow.
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Workflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
GET /workflow/runs
Get workflow runs.
Auth apikey
Response — data is an array of RunWorkflow objects, alongside the pagination fields described in Response format. (Resource deduced from the collections this handler reads, not read off an explicit return.)
DELETE /workflow/runs
Delete workflow runs.
Auth apikey
Response — data is one RunWorkflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
DELETE /workflow/runs/:runId
Delete workflow run.
Auth apikey
Path parameters
| Name | |
|---|---|
runId | Required |
Response — data is one RunWorkflow object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
POST /workflow/runs/:runId/cancel
Cancel workflow run.
Auth apikey
Path parameters
| Name | |
|---|---|
runId | Required |
POST /workflow/runs/:runId/pause
Pause workflow run.
Auth apikey
Path parameters
| Name | |
|---|---|
runId | Required |
POST /workflow/runs/:runId/restart
Restart workflow run.
Auth apikey
Path parameters
| Name | |
|---|---|
runId | Required |
Response — data is one RunWorkflow object.
POST /workflow/runs/:runId/resume
Resume workflow run.
Auth apikey
Path parameters
| Name | |
|---|---|
runId | Required |