Skip to main content

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

FieldDefaultNotes
nameMade unique automatically — a clash gets a suffix rather than an error.
triggerEventTypeThe 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.
scheduleFor time-triggered workflows instead of event-triggered ones.

Responsedata 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

FieldDefaultNotes
ids[]Documents to act on.
nids[]Documents to exclude.
selectAllfalseAct on everything matching the query-string filter instead of an id list.

Responsedata 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
idRequired

Responsedata 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
idRequired

Request body

FieldDefault
name
triggerEventType
config
nodes
edges
status
schedule

Responsedata 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
idRequired

Responsedata 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

  1. A workflow with a graph. Create it, then publish — an unpublished workflow never runs. POST /workflow · PUT /workflow/:id

Path parameters

Name
idRequired

Responsedata 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
idRequired

Responsedata 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
idRequired

Responsedata 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

Responsedata 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

Responsedata 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
runIdRequired

Responsedata 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
runIdRequired

POST /workflow/runs/:runId/pause

Pause workflow run.

Auth apikey

Path parameters

Name
runIdRequired

POST /workflow/runs/:runId/restart

Restart workflow run.

Auth apikey

Path parameters

Name
runIdRequired

Responsedata is one RunWorkflow object.

POST /workflow/runs/:runId/resume

Resume workflow run.

Auth apikey

Path parameters

Name
runIdRequired