Skip to main content

Workflows Executions

Usageโ€‹

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.workflow.getExecutions(...)

Tree-shakeable importโ€‹

import { getClient, authorize } from '@epilot/sdk/workflow'

const workflowClient = getClient()
authorize(workflowClient, () => '<token>')
const { data } = await workflowClient.getExecutions(...)

Operationsโ€‹

Workflow Executions

Workflow Steps

Closing Reasons

Flows V2

Schemas

getExecutionsโ€‹

Retrieve Workflow Executions. Optionally, you can filter them by context & schema. Please be aware, these executions are more light weight - steps are not loaded with all information.

GET /v1/workflows/executions

const { data } = await client.getExecutions({
context: 'example',
schema: 'example',
})
Response
[
{
"id": "8gja72h6kas6h",
"name": "Lead Qualification",
"trigger": "MANUAL",
"status": "STARTED",
"creationTime": "2021-04-27T12:01:13.000Z",
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:01:13.000Z",
"flow": [
{
"id": "sectionId1",
"definitionId": "section_definition_id_1",
"name": "Initial Information Gathering",
"type": "SECTION",
"steps": [
{
"id": "sada5641f3a21",
"definitionId": "step_definition_id_1",
"name": "Call client"
},
{
"id": "sada5641f3a22",
"definitionId": "step_definition_id_2",
"name": "Check product availability"
}
]
},
{
"id": "firstLevelStepId1",
"definitionId": "step_definition_id_4",
"name": "Print and send catalog",
"type": "STEP"
}
]
}
]

createExecutionโ€‹

Create a Workflow Execution. Start a new workflow execution, based on a workflow definition (template).

POST /v1/workflows/executions

const { data } = await client.createExecution(
null,
{
workflowId: 'j3f23fh23uif98',
trigger: 'AUTOMATIC',
contexts: [
{
id: '3fa3fa86-0907-4642-a57e-0fe30a19874d',
schema: 'contact'
},
{
id: '3a6d42fa-5070-4723-b90f-41ead4303e33',
schema: 'opportunity'
}
]
},
)
Response
{
"id": "8gja72h6kas6h",
"name": "Lead Qualification",
"trigger": "MANUAL",
"status": "STARTED",
"creationTime": "2021-04-27T12:01:13.000Z",
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:01:13.000Z",
"assignedTo": ["252", "29052"],
"flow": [
{
"id": "sectionId1",
"name": "Initial Information Gathering",
"steps": [
{
"id": "sada5641f3a21",
"name": "Call client and confirm address and product",
"definitionId": "step_definition_id_1",
"status": "ASSIGNED",
"assignedTo": ["11"]
},
{
"id": "sada5641f3a22",
"name": "Check product availability",
"status": "UNASSIGNED",
"definitionId": "step_definition_id_2"
}
]
},
{
"id": "firstLevelStepId1",
"definitionId": "step_definition_id_4",
"name": "Print and send catalog",
"status": "SKIPPED",
"dueDate": "2023-01-15T20:00:00"
}
]
}

getExecutionโ€‹

Get a full workflow execution, included steps information, by execution id.

GET /v1/workflows/executions/{executionId}

const { data } = await client.getExecution({
executionId: 'example',
})
Response
{
"id": "8gja72h6kas6h",
"name": "Lead Qualification",
"trigger": "MANUAL",
"status": "STARTED",
"creationTime": "2021-04-27T12:01:13.000Z",
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:01:13.000Z",
"assignedTo": ["252", "29052"],
"flow": [
{
"id": "sectionId1",
"name": "Initial Information Gathering",
"steps": [
{
"id": "sada5641f3a21",
"name": "Call client and confirm address and product",
"definitionId": "step_definition_id_1",
"status": "ASSIGNED",
"assignedTo": ["11"]
},
{
"id": "sada5641f3a22",
"name": "Check product availability",
"status": "UNASSIGNED",
"definitionId": "step_definition_id_2"
}
]
},
{
"id": "firstLevelStepId1",
"definitionId": "step_definition_id_4",
"name": "Print and send catalog",
"status": "SKIPPED",
"dueDate": "2023-01-15T20:00:00"
}
]
}

updateExecutionโ€‹

Patches updates like assignees, status, closingReason for a single Workflow Execution.

PATCH /v1/workflows/executions/{executionId}

const { data } = await client.updateExecution(
{
executionId: 'example',
},
{
status: 'STARTED',
assignedTo: ['string'],
selectedClosingReasons: [
{
id: 'string',
title: 'string'
}
],
closingReasonDescription: 'string',
dueDate: 'string',
dynamicDueDate: {
numberOfUnits: 0,
timePeriod: 'minutes',
actionTypeCondition: 'WORKFLOW_STARTED',
stepId: 'string',
phaseId: 'string'
},
closedBy: 'string',
contexts: [
{
id: 'string',
title: 'string',
schema: 'string'
}
],
completedTime: 'string'
},
)

deleteExecutionโ€‹

Delete workflow execution by id. Workflow contexts will NOT be deleted.

DELETE /v1/workflows/executions/{executionId}

const { data } = await client.deleteExecution({
executionId: 'example',
})

createStepโ€‹

Create a new step in current workflow execution.

POST /v1/workflows/executions/{executionId}/steps

const { data } = await client.createStep(
{
executionId: 'example',
},
{
insertionIndex: 0,
name: 'string',
description: {
enabled: true,
value: 'string'
},
status: 'UNASSIGNED',
sectionId: 'string',
executionType: 'MANUAL',
automationConfig: {
flowId: 'string',
executionId: 'string',
executionStatus: 'string'
}
},
)
Response
{
"id": "string",
"definitionId": "string",
"entityRefId": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"type": "STEP",
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"enabled": true,
"requirements": [
{
"definitionId": "string",
"type": "STEP",
"condition": "CLOSED"
}
],
"executionType": "MANUAL",
"sectionId": "string",
"executionId": "string",
"userIds": [0],
"assignedTo": ["string"],
"assignedToInProgress": "string",
"status": "UNASSIGNED",
"created": "string",
"lastUpdated": "string",
"statusLastUpdated": "string",
"startedTime": "string",
"completedTime": "string",
"dueDate": "string",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"manuallyCreated": true,
"automationConfig": {
"flowId": "string",
"executionId": "string",
"executionStatus": "string"
},
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"taxonomies": ["string"]
}

updateStepโ€‹

Patches various changes to a workflow execution step.

PATCH /v1/workflows/executions/{executionId}/steps/{stepId}

const { data } = await client.updateStep(
{
executionId: 'example',
stepId: 'example',
},
{
stepId: 'string',
entityRefId: 'string',
userIds: [0],
assignedTo: ['string'],
assignedToInProgress: 'string',
status: 'UNASSIGNED',
dueDate: 'string',
dynamicDueDate: {
numberOfUnits: 0,
timePeriod: 'minutes',
actionTypeCondition: 'WORKFLOW_STARTED',
stepId: 'string',
phaseId: 'string'
},
name: 'string',
description: {
enabled: true,
value: 'string'
},
position: {
index: 0,
sectionId: 'string'
},
automationConfig: {
flowId: 'string',
executionId: 'string',
executionStatus: 'string'
},
startedTime: 'string',
completedTime: 'string'
},
)
Response
{
"id": "string",
"definitionId": "string",
"entityRefId": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"type": "STEP",
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"enabled": true,
"requirements": [
{
"definitionId": "string",
"type": "STEP",
"condition": "CLOSED"
}
],
"executionType": "MANUAL",
"sectionId": "string",
"executionId": "string",
"userIds": [0],
"assignedTo": ["string"],
"assignedToInProgress": "string",
"status": "UNASSIGNED",
"created": "string",
"lastUpdated": "string",
"statusLastUpdated": "string",
"startedTime": "string",
"completedTime": "string",
"dueDate": "string",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"manuallyCreated": true,
"automationConfig": {
"flowId": "string",
"executionId": "string",
"executionStatus": "string"
},
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"taxonomies": ["string"]
}

deleteStepโ€‹

Deletes a step from a workflow execution.

DELETE /v1/workflows/executions/{executionId}/steps/{stepId}

const { data } = await client.deleteStep({
executionId: 'example',
stepId: 'example',
})

getClosingReasonExecutionโ€‹

Shows all Closing Reasons defined at the moment of starting the Workflow Execution. The Closing Reasons shown in the execution are just snapshots from the state of the Definition when the instance was

GET /v1/workflows/executions/{executionId}/closing-reasons

const { data } = await client.getClosingReasonExecution({
executionId: 'example',
})
Response
{
"reasons": [
{
"id": "string",
"title": "string"
}
]
}

startFlowExecutionโ€‹

Starts a new Flow Execution based on a flow template.

POST /v2/flows/executions

const { data } = await client.startFlowExecution(
null,
{
flow_template_id: 'string',
trigger: {
type: 'MANUAL',
automation_config: {
flow_id: 'string',
execution_id: 'string',
execution_status: 'string',
error_reason: 'string'
}
},
contexts: [
{
entity_id: 'string',
entity_schema: 'string',
is_primary: false
}
],
purposes: ['string']
},
)
Response
{
"id": "string",
"flow_template_id": "string",
"org_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"due_date": "string",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"status": "STARTED",
"assigned_to": ["string"],
"analytics": {
"started_at": "string",
"completed_at": "string",
"closed_at": "string",
"started_by": "string",
"closed_by": "string"
},
"contexts": [
{
"entity_id": "string",
"entity_schema": "string",
"is_primary": false
}
],
"crt_tasks": [
{
"id": "string"
}
],
"phases": [
{
"id": "string",
"template_id": "string",
"name": "string",
"status": "OPEN",
"updated_at": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"analytics": {},
"taxonomies": ["string"],
"loop_config": {}
}
],
"tasks": [
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {},
"status": "UNASSIGNED",
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"analytics": {},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {}
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "abc123",
"none_met": true
}
],
"_execution_chain": {
"parent_execution_id": "string",
"parent_task_id": "string",
"depth": 0
},
"closing_reason": {
"selected_reasons": [
{}
],
"configured_reasons": [
{}
],
"extra_description": "string"
},
"available_in_ecp": true,
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"trigger": {
"type": "MANUAL",
"automation_config": {
"flow_id": "string",
"execution_id": "string",
"execution_status": "string",
"error_reason": "string"
}
},
"singleClosingReasonSelection": true
}

getFlowExecutionโ€‹

Get a full flow execution, included tasks, phases, edges & analytics.

GET /v2/flows/executions/{execution_id}

const { data } = await client.getFlowExecution({
execution_id: 'example',
})
Response
{
"id": "string",
"flow_template_id": "string",
"org_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"due_date": "string",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"status": "STARTED",
"assigned_to": ["string"],
"analytics": {
"started_at": "string",
"completed_at": "string",
"closed_at": "string",
"started_by": "string",
"closed_by": "string"
},
"contexts": [
{
"entity_id": "string",
"entity_schema": "string",
"is_primary": false
}
],
"crt_tasks": [
{
"id": "string"
}
],
"phases": [
{
"id": "string",
"template_id": "string",
"name": "string",
"status": "OPEN",
"updated_at": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"analytics": {},
"taxonomies": ["string"],
"loop_config": {}
}
],
"tasks": [
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {},
"status": "UNASSIGNED",
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"analytics": {},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {}
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "abc123",
"none_met": true
}
],
"_execution_chain": {
"parent_execution_id": "string",
"parent_task_id": "string",
"depth": 0
},
"closing_reason": {
"selected_reasons": [
{}
],
"configured_reasons": [
{}
],
"extra_description": "string"
},
"available_in_ecp": true,
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"trigger": {
"type": "MANUAL",
"automation_config": {
"flow_id": "string",
"execution_id": "string",
"execution_status": "string",
"error_reason": "string"
}
},
"singleClosingReasonSelection": true
}

patchFlowExecutionโ€‹

Patch flow execution with new assignees, status, analytics & other changes.

PATCH /v2/flows/executions/{execution_id}

const { data } = await client.patchFlowExecution(
{
execution_id: 'example',
},
{
status: 'STARTED',
assigned_to: ['string'],
closing_reason: {
selected_reasons: [
{
id: 'string',
title: 'string'
}
],
configured_reasons: [
{
id: 'string',
title: 'string'
}
],
extra_description: 'string'
},
due_date: 'string',
due_date_config: {
duration: 0,
unit: 'minutes',
type: 'WORKFLOW_STARTED',
task_id: 'string',
phase_id: 'string'
},
contexts: [
{
entity_id: 'string',
entity_schema: 'string',
is_primary: false
}
]
},
)
Response
{
"id": "string",
"flow_template_id": "string",
"org_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"due_date": "string",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"status": "STARTED",
"assigned_to": ["string"],
"analytics": {
"started_at": "string",
"completed_at": "string",
"closed_at": "string",
"started_by": "string",
"closed_by": "string"
},
"contexts": [
{
"entity_id": "string",
"entity_schema": "string",
"is_primary": false
}
],
"crt_tasks": [
{
"id": "string"
}
],
"phases": [
{
"id": "string",
"template_id": "string",
"name": "string",
"status": "OPEN",
"updated_at": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"analytics": {},
"taxonomies": ["string"],
"loop_config": {}
}
],
"tasks": [
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {},
"status": "UNASSIGNED",
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"analytics": {},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {}
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "abc123",
"none_met": true
}
],
"_execution_chain": {
"parent_execution_id": "string",
"parent_task_id": "string",
"depth": 0
},
"closing_reason": {
"selected_reasons": [
{}
],
"configured_reasons": [
{}
],
"extra_description": "string"
},
"available_in_ecp": true,
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"trigger": {
"type": "MANUAL",
"automation_config": {
"flow_id": "string",
"execution_id": "string",
"execution_status": "string",
"error_reason": "string"
}
},
"singleClosingReasonSelection": true
}

deleteFlowExecutionโ€‹

Deletes a specific execution of a flow, identified by id. Flow contexts will NOT be deleted.

DELETE /v2/flows/executions/{execution_id}

const { data } = await client.deleteFlowExecution({
execution_id: 'example',
soft: true,
})

searchFlowExecutionsโ€‹

Search Flow Executions for a specific Entity.

POST /v2/flows/executions:search

const { data } = await client.searchFlowExecutions(
null,
{
entity_id: 'string',
entity_schema: 'string'
},
)
Response
{
"results": [
{
"id": "string",
"flow_template_id": "string",
"org_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"due_date": "string",
"due_date_config": {},
"status": "STARTED",
"assigned_to": ["string"],
"analytics": {},
"contexts": [],
"crt_tasks": [],
"phases": [],
"tasks": [],
"edges": [],
"_execution_chain": {},
"closing_reason": {},
"available_in_ecp": true,
"entity_sync": [],
"taxonomies": ["string"],
"trigger": {},
"singleClosingReasonSelection": true
}
]
}

patchTaskโ€‹

Changes various attributes of a flow task, like assignees, status, due date, etc.

PATCH /v2/flows/executions/{execution_id}/tasks/{task_id}

const { data } = await client.patchTask(
{
execution_id: 'example',
task_id: 'example',
},
{
name: 'string',
status: 'UNASSIGNED',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: {
duration: 0,
unit: 'minutes',
type: 'WORKFLOW_STARTED',
task_id: 'string',
phase_id: 'string'
},
assigned_to: ['string'],
enabled: true,
automation_config: {
flow_id: 'string',
execution_id: 'string',
execution_status: 'string',
error_reason: 'string'
},
description: {
enabled: true,
value: 'string'
},
ecp: {
enabled: true,
label: 'string',
description: 'string',
journey: {
id: 'string',
journeyId: 'string',
name: 'string',
complete_task_automatically: true
}
},
installer: {
enabled: true,
label: 'string',
description: 'string',
journey: {
id: 'string',
journeyId: 'string',
name: 'string',
complete_task_automatically: true
}
},
next_condition_id: 'string',
revert_execution: false
},
)
Response
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"status": "UNASSIGNED",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"requirements": [
{
"task_id": "string",
"phase_id": "string",
"when": "TASK_FINISHED"
}
],
"assigned_to": ["string"],
"analytics": {
"started_at": "1970-01-01T00:00:00.000Z",
"in_progress_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"status_updated_at": "1970-01-01T00:00:00.000Z",
"in_progress_by": "string",
"completed_by": "string",
"skipped_by": "string"
},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {
"max_iterations": 3,
"crt_iterations": 0
}
}

runTaskAutomationโ€‹

Runs configured automation for a flow task

POST /v2/flows/executions/{execution_id}/tasks/{task_id}/automation:run

const { data } = await client.runTaskAutomation({
execution_id: 'example',
task_id: 'example',
})
Response
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"status": "UNASSIGNED",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"requirements": [
{
"task_id": "string",
"phase_id": "string",
"when": "TASK_FINISHED"
}
],
"assigned_to": ["string"],
"analytics": {
"started_at": "1970-01-01T00:00:00.000Z",
"in_progress_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"status_updated_at": "1970-01-01T00:00:00.000Z",
"in_progress_by": "string",
"completed_by": "string",
"skipped_by": "string"
},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {
"flow_id": "string",
"execution_id": "string",
"execution_status": "string",
"error_reason": "string"
},
"automation_execution_id": "string",
"trigger_mode": "manual",
"schedule": {
"mode": "immediate"
},
"loop_config": {
"max_iterations": 3,
"crt_iterations": 0
}
}

executeTaskโ€‹

Executes any kind of flow task immediately.

POST /v2/flows/executions/{execution_id}/tasks/{task_id}/execute

const { data } = await client.executeTask({
execution_id: 'example',
task_id: 'example',
})
Response
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"status": "UNASSIGNED",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"requirements": [
{
"task_id": "string",
"phase_id": "string",
"when": "TASK_FINISHED"
}
],
"assigned_to": ["string"],
"analytics": {
"started_at": "1970-01-01T00:00:00.000Z",
"in_progress_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"status_updated_at": "1970-01-01T00:00:00.000Z",
"in_progress_by": "string",
"completed_by": "string",
"skipped_by": "string"
},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {
"max_iterations": 3,
"crt_iterations": 0
}
}

patchPhaseโ€‹

Apply updates to a phase within flow execution

PATCH /v2/flows/executions/{execution_id}/phases/{phase_id}

const { data } = await client.patchPhase(
{
execution_id: 'example',
phase_id: 'example',
},
{
name: 'string',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: {
duration: 0,
unit: 'minutes',
type: 'WORKFLOW_STARTED',
task_id: 'string',
phase_id: 'string'
},
assigned_to: ['string']
},
)
Response
{
"id": "string",
"template_id": "string",
"name": "string",
"status": "OPEN",
"updated_at": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"assigned_to": ["string"],
"analytics": {
"started_at": "1970-01-01T00:00:00.000Z",
"in_progress_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"status_updated_at": "1970-01-01T00:00:00.000Z",
"in_progress_by": "string",
"completed_by": "string",
"skipped_by": "string"
},
"taxonomies": ["string"],
"loop_config": {
"max_iterations": 3,
"crt_iterations": 0
}
}

addTaskโ€‹

Create a new task in current workflow execution.

POST /v2/flows/executions/{execution_id}/tasks

const { data } = await client.addTask(
{
execution_id: 'example',
},
{
previous_task_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
next_task_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
task: {
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
name: 'string',
status: 'UNASSIGNED',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: {
duration: 0,
unit: 'minutes',
type: 'WORKFLOW_STARTED',
task_id: 'string',
phase_id: 'string'
},
assigned_to: ['string'],
enabled: true,
automation_config: {
flow_id: 'string',
execution_id: 'string',
execution_status: 'string',
error_reason: 'string'
},
phase_id: 'string',
task_type: 'MANUAL'
}
},
)
Response
{
"id": "string",
"template_id": "string",
"name": "string",
"description": {
"enabled": true,
"value": "string"
},
"status": "UNASSIGNED",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {
"duration": 0,
"unit": "minutes",
"type": "WORKFLOW_STARTED",
"task_id": "string",
"phase_id": "string"
},
"requirements": [
{
"task_id": "string",
"phase_id": "string",
"when": "TASK_FINISHED"
}
],
"assigned_to": ["string"],
"analytics": {
"started_at": "1970-01-01T00:00:00.000Z",
"in_progress_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"status_updated_at": "1970-01-01T00:00:00.000Z",
"in_progress_by": "string",
"completed_by": "string",
"skipped_by": "string"
},
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"manually_created": true,
"enabled": true,
"ecp": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"installer": {
"enabled": true,
"label": "string",
"description": "string",
"journey": {
"id": "string",
"journeyId": "string",
"name": "string",
"complete_task_automatically": true
}
},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"loop_config": {
"max_iterations": 3,
"crt_iterations": 0
}
}

cancelTaskScheduleโ€‹

Cancels a scheduled task, deleting the schedule and marking the task as skipped.

DELETE /v2/flows/executions/{execution_id}/tasks/{task_id}/schedule

const { data } = await client.cancelTaskSchedule({
execution_id: 'example',
task_id: 'example',
})

Schemasโ€‹

WorkflowExecutionCreateReqโ€‹

type WorkflowExecutionCreateReq = {
workflowId: string
trigger?: "MANUAL" | "AUTOMATIC"
assignedTo?: string[]
contexts?: Array<{
id: string
title: string
schema: string
}>
purposes?: string[]
}

WorkflowExecutionUpdateReqโ€‹

type WorkflowExecutionUpdateReq = {
status?: "STARTED" | "DONE" | "CLOSED"
assignedTo?: string[]
selectedClosingReasons?: Array<{
id: string
title: string
}>
closingReasonDescription?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
closedBy?: string
contexts?: Array<{
id: string
title: string
schema: string
}>
completedTime?: string
}

ClosingReasonโ€‹

type ClosingReason = {
id: string
title: string
}

WorkflowContextโ€‹

type WorkflowContext = {
id: string
title: string
schema: string
}

WorkflowExecutionBaseโ€‹

type WorkflowExecutionBase = {
id?: string
definitionId?: string
orgId?: string
name?: string
creationTime?: string
lastUpdateTime?: string
dueDate?: string
completedTime?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
status?: "STARTED" | "DONE" | "CLOSED"
trigger?: "MANUAL" | "AUTOMATIC"
assignedTo?: string[]
lastModifiedBy?: string
contexts?: Array<{
id: string
title: string
schema: string
}>
nextOpenStep?: {
id?: string
entityRefId?: string
}
configuredClosingReasonSnapshot?: Array<{
id: string
title: string
}>
selectedClosingReasons?: Array<{
id: string
title: string
}>
closingReasonDescription?: string
enableECPWorkflow?: boolean
updateEntityAttributes?: Array<{
source: "workflow_status" | "current_section" | "current_step"
target: {
entitySchema: { ... }
entityAttribute: { ... }
}
}>
version?: number
taxonomies?: string[]
singleClosingReasonSelection?: boolean
}

WorkflowExecutionSlimโ€‹

type WorkflowExecutionSlim = {
id?: string
definitionId?: string
orgId?: string
name?: string
creationTime?: string
lastUpdateTime?: string
dueDate?: string
completedTime?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
status?: "STARTED" | "DONE" | "CLOSED"
trigger?: "MANUAL" | "AUTOMATIC"
assignedTo?: string[]
lastModifiedBy?: string
contexts?: Array<{
id: string
title: string
schema: string
}>
nextOpenStep?: {
id?: string
entityRefId?: string
}
configuredClosingReasonSnapshot?: Array<{
id: string
title: string
}>
selectedClosingReasons?: Array<{
id: string
title: string
}>
closingReasonDescription?: string
enableECPWorkflow?: boolean
updateEntityAttributes?: Array<{
source: "workflow_status" | "current_section" | "current_step"
target: {
entitySchema: { ... }
entityAttribute: { ... }
}
}>
version?: number
taxonomies?: string[]
singleClosingReasonSelection?: boolean
flow: Array<{
id: string
definitionId?: string
name: string
userIds?: number[]
assignedTo?: string[]
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
startedTime?: string
completedTime?: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
type: "STEP" | "SECTION"
steps: Array<{
id: { ... }
definitionId?: { ... }
entityRefId?: { ... }
name: { ... }
description?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
enabled?: { ... }
requirements?: { ... }
executionType?: { ... }
sectionId?: { ... }
executionId?: { ... }
userIds?: { ... }
assignedTo?: { ... }
assignedToInProgress?: { ... }
status?: { ... }
created?: { ... }
lastUpdated?: { ... }
statusLastUpdated?: { ... }
startedTime?: { ... }
completedTime?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
manuallyCreated?: { ... }
automationConfig?: { ... }
journey?: { ... }
taxonomies?: { ... }
}>
taxonomies?: string[]
} | {
id: string
// ...
}

FlowSlimโ€‹

type FlowSlim = {
flow: Array<{
id: string
definitionId?: string
name: string
userIds?: number[]
assignedTo?: string[]
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
startedTime?: string
completedTime?: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
type: "STEP" | "SECTION"
steps: Array<{
id: { ... }
definitionId?: { ... }
entityRefId?: { ... }
name: { ... }
description?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
enabled?: { ... }
requirements?: { ... }
executionType?: { ... }
sectionId?: { ... }
executionId?: { ... }
userIds?: { ... }
assignedTo?: { ... }
assignedToInProgress?: { ... }
status?: { ... }
created?: { ... }
lastUpdated?: { ... }
statusLastUpdated?: { ... }
startedTime?: { ... }
completedTime?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
manuallyCreated?: { ... }
automationConfig?: { ... }
journey?: { ... }
taxonomies?: { ... }
}>
taxonomies?: string[]
} | {
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
enabled?: boolean
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
executionType?: "MANUAL" | "AUTOMATION"
sectionId?: string
executionId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
created?: string
lastUpdated?: string
statusLastUpdated?: string
startedTime?: string
completedTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
manuallyCreated?: boolean
automationConfig?: {
// ...
}

Flowโ€‹

type Flow = {
flow: Array<{
id: string
definitionId?: string
name: string
userIds?: number[]
assignedTo?: string[]
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
startedTime?: string
completedTime?: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
type: "STEP" | "SECTION"
steps: Array<{
id: { ... }
definitionId?: { ... }
entityRefId?: { ... }
name: { ... }
description?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
enabled?: { ... }
requirements?: { ... }
executionType?: { ... }
sectionId?: { ... }
executionId?: { ... }
userIds?: { ... }
assignedTo?: { ... }
assignedToInProgress?: { ... }
status?: { ... }
created?: { ... }
lastUpdated?: { ... }
statusLastUpdated?: { ... }
startedTime?: { ... }
completedTime?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
manuallyCreated?: { ... }
automationConfig?: { ... }
journey?: { ... }
taxonomies?: { ... }
}>
taxonomies?: string[]
} | {
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
enabled?: boolean
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
executionType?: "MANUAL" | "AUTOMATION"
sectionId?: string
executionId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
created?: string
lastUpdated?: string
statusLastUpdated?: string
startedTime?: string
completedTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
manuallyCreated?: boolean
automationConfig?: {
// ...
}

WorkflowExecutionโ€‹

type WorkflowExecution = {
id?: string
definitionId?: string
orgId?: string
name?: string
creationTime?: string
lastUpdateTime?: string
dueDate?: string
completedTime?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
status?: "STARTED" | "DONE" | "CLOSED"
trigger?: "MANUAL" | "AUTOMATIC"
assignedTo?: string[]
lastModifiedBy?: string
contexts?: Array<{
id: string
title: string
schema: string
}>
nextOpenStep?: {
id?: string
entityRefId?: string
}
configuredClosingReasonSnapshot?: Array<{
id: string
title: string
}>
selectedClosingReasons?: Array<{
id: string
title: string
}>
closingReasonDescription?: string
enableECPWorkflow?: boolean
updateEntityAttributes?: Array<{
source: "workflow_status" | "current_section" | "current_step"
target: {
entitySchema: { ... }
entityAttribute: { ... }
}
}>
version?: number
taxonomies?: string[]
singleClosingReasonSelection?: boolean
flow: Array<{
id: string
definitionId?: string
name: string
userIds?: number[]
assignedTo?: string[]
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
startedTime?: string
completedTime?: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
type: "STEP" | "SECTION"
steps: Array<{
id: { ... }
definitionId?: { ... }
entityRefId?: { ... }
name: { ... }
description?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
enabled?: { ... }
requirements?: { ... }
executionType?: { ... }
sectionId?: { ... }
executionId?: { ... }
userIds?: { ... }
assignedTo?: { ... }
assignedToInProgress?: { ... }
status?: { ... }
created?: { ... }
lastUpdated?: { ... }
statusLastUpdated?: { ... }
startedTime?: { ... }
completedTime?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
manuallyCreated?: { ... }
automationConfig?: { ... }
journey?: { ... }
taxonomies?: { ... }
}>
taxonomies?: string[]
} | {
id: string
// ...
}

WorkflowStatusโ€‹

type WorkflowStatus = "STARTED" | "DONE" | "CLOSED"

SectionSimplifiedโ€‹

A group of Steps that define the progress of the Workflow

type SectionSimplified = {
id: string
definitionId?: string
name: string
type: "STEP" | "SECTION"
steps: Array<{
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
enabled?: boolean
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
executionType?: "MANUAL" | "AUTOMATION"
}>
assignedTo?: string[]
}

Sectionโ€‹

A group of Steps that define the progress of the Workflow

type Section = {
id: string
definitionId?: string
name: string
userIds?: number[]
assignedTo?: string[]
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
startedTime?: string
completedTime?: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
type: "STEP" | "SECTION"
steps: Array<{
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
enabled?: boolean
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
executionType?: "MANUAL" | "AUTOMATION"
sectionId?: string
executionId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
created?: string
lastUpdated?: string
statusLastUpdated?: string
startedTime?: string
completedTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
manuallyCreated?: boolean
automationConfig?: {
flowId: { ... }
executionId?: { ... }
executionStatus?: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
taxonomies?: string[]
}>
taxonomies?: string[]
}

StepIdโ€‹

type StepId = {
id?: string
entityRefId?: string
}

StepSimplifiedโ€‹

type StepSimplified = {
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: boolean
value?: string
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
enabled?: boolean
requirements?: Array<{
definitionId: string
type: "STEP" | "SECTION"
condition: "CLOSED"
}>
executionType?: "MANUAL" | "AUTOMATION"
}

Stepโ€‹

type Step = {
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: boolean
value?: string
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
enabled?: boolean
requirements?: Array<{
definitionId: string
type: "STEP" | "SECTION"
condition: "CLOSED"
}>
executionType?: "MANUAL" | "AUTOMATION"
sectionId?: string
executionId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
created?: string
lastUpdated?: string
statusLastUpdated?: string
startedTime?: string
completedTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
manuallyCreated?: boolean
automationConfig?: {
flowId: string
executionId?: string
executionStatus?: string
}
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
taxonomies?: string[]
}

StepExtendedโ€‹

type StepExtended = {
executionId: string
executionName: string
executionStatus: "STARTED" | "DONE" | "CLOSED"
contexts?: Array<{
id: string
title: string
schema: string
}>
}

StepStatusโ€‹

Note: "UNASSIGNED" and "ASSIGNED" are deprecated and will be removed in a future version. Please use "PENDING" instead. Status values for workflow execution steps/tasks:

  • UNASSIGNED: Step has not been assigned to any user (deprecated - use PENDING instead)
  • ASSIGNED: Step has been assi
type StepStatus = "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"

SectionStatusโ€‹

type SectionStatus = "OPEN" | "IN_PROGRESS" | "COMPLETED"

StepTypeโ€‹

type StepType = "MANUAL" | "AUTOMATION"

StepJourneyโ€‹

type StepJourney = {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}

AutomationConfigโ€‹

Configuration for automation execution to run

type AutomationConfig = {
flowId: string
executionId?: string
executionStatus?: string
}

ECPDetailsโ€‹

Details regarding ECP for the workflow step

type ECPDetails = {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
}

StepDescriptionโ€‹

Longer information regarding Task

type StepDescription = {
enabled?: boolean
value?: string
}

ItemTypeโ€‹

type ItemType = "STEP" | "SECTION"

TriggerTypeโ€‹

type TriggerType = "MANUAL" | "AUTOMATIC"

CreateStepReqโ€‹

type CreateStepReq = {
insertionIndex: number
name: string
description?: {
enabled: boolean
value: string
}
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
sectionId?: string
executionType?: "MANUAL" | "AUTOMATION"
automationConfig?: {
flowId: string
executionId?: string
executionStatus?: string
}
}

UpdateStepReqโ€‹

type UpdateStepReq = {
stepId?: string
entityRefId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
name?: string
description?: {
enabled: boolean
value: string
}
position?: {
index: number
sectionId?: string
}
automationConfig?: {
flowId: string
executionId?: string
executionStatus?: string
}
startedTime?: string
completedTime?: string
}

StepPositionAtโ€‹

type StepPositionAt = {
index: number
sectionId?: string
}

UpdateStepRespโ€‹

type UpdateStepResp = {
id: string
definitionId?: string
entityRefId?: string
name: string
description?: {
enabled?: boolean
value?: string
}
type: "STEP" | "SECTION"
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
enabled?: boolean
requirements?: Array<{
definitionId: string
type: "STEP" | "SECTION"
condition: "CLOSED"
}>
executionType?: "MANUAL" | "AUTOMATION"
sectionId?: string
executionId?: string
userIds?: number[]
assignedTo?: string[]
assignedToInProgress?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
created?: string
lastUpdated?: string
statusLastUpdated?: string
startedTime?: string
completedTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
manuallyCreated?: boolean
automationConfig?: {
flowId: string
executionId?: string
executionStatus?: string
}
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
taxonomies?: string[]
}

SearchStepsRespโ€‹

type SearchStepsResp = {
hits?: number
results?: Array<{
executionId: string
executionName: string
executionStatus: "STARTED" | "DONE" | "CLOSED"
contexts?: Array<{
id: { ... }
title: { ... }
schema: { ... }
}>
}>
}

SearchExecutionsReqโ€‹

type SearchExecutionsReq = {
name?: string
status?: "STARTED" | "DONE" | "CLOSED"
includeDoneWorkflows?: boolean
assignedTo?: string
sorting?: "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"
pagination?: {
orgId?: string
creationTime?: string
}
}

SearchExecutionsRespโ€‹

type SearchExecutionsResp = {
executions: Array<{
id?: string
definitionId?: string
orgId?: string
name?: string
creationTime?: string
lastUpdateTime?: string
dueDate?: string
completedTime?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition?: { ... }
stepId?: { ... }
phaseId?: { ... }
}
status?: "STARTED" | "DONE" | "CLOSED"
trigger?: "MANUAL" | "AUTOMATIC"
assignedTo?: string[]
lastModifiedBy?: string
contexts?: Array<{
id: { ... }
title: { ... }
schema: { ... }
}>
nextOpenStep?: {
id?: { ... }
entityRefId?: { ... }
}
configuredClosingReasonSnapshot?: Array<{
id: { ... }
title: { ... }
}>
selectedClosingReasons?: Array<{
id: { ... }
title: { ... }
}>
closingReasonDescription?: string
enableECPWorkflow?: boolean
updateEntityAttributes?: Array<{
source: { ... }
target: { ... }
}>
version?: number
taxonomies?: string[]
singleClosingReasonSelection?: boolean
flow: Array<{
id: { ... }
definitionId?: { ... }
name: { ... }
userIds?: { ... }
assignedTo?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
startedTime?: { ... }
completedTime?: { ... }
status?: { ... }
type: { ... }
steps: { ... }
taxonomies?: { ... }
} | {
id: { ... }
definitionId?: { ... }
entityRefId?: { ... }
name: { ... }
description?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
enabled?: { ... }
requirements?: { ... }
executionType?: { ... }
sectionId?: { ... }
executionId?: { ... }
userIds?: { ... }
assignedTo?: { ... }
assignedToInProgress?: { ... }
status?: { ... }
created?: { ... }
lastUpdated?: { ... }
statusLastUpdated?: { ... }
startedTime?: { ... }
completedTime?: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
manuallyCreated?: { ... }
automationConfig?: { ... }
journey?: { ... }
taxonomies?: { ... }
}>
}>
lastEvaluatedKey?: {
orgId?: string
creationTime?: string
}
}

LastEvaluatedKeyโ€‹

type LastEvaluatedKey = {
orgId?: string
creationTime?: string
}

SearchStepsReqโ€‹

type SearchStepsReq = {
executionName?: string
stepName?: string
assignedTo?: number
includeDoneWorkflows?: boolean
manuallyCreated?: boolean
status?: "OPEN" | "COMPLETE" | "NEXT_OPEN_ITEM_IN_WORKFLOW"
sorting?: "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"
pagination?: {
from?: number
size?: number
}
}

SearchSortingโ€‹

type SearchSorting = "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"

SearchPaginationโ€‹

type SearchPagination = {
from?: number
size?: number
}

ExecutionPaginationDynamoโ€‹

type ExecutionPaginationDynamo = {
orgId?: string
creationTime?: string
}

ErrorRespโ€‹

type ErrorResp = {
message?: string
}

ClosingReasonRespโ€‹

type ClosingReasonResp = {
reasons?: Array<{
id: string
title: string
}>
}

PhaseInEntityโ€‹

type PhaseInEntity = {
phase_id?: string
phase_name?: string
phase_progress?: number
phase_assignees?: string[]
}

WorkflowInEntityโ€‹

type WorkflowInEntity = {
id?: string
definition_id?: string
name?: string
status?: "STARTED" | "DONE" | "CLOSED"
assignees?: string[]
duedate?: string // date-time
last_update_time?: string // date-time
progress?: number
upcoming_tasks_assignees?: string[]
task_id?: string
task_name?: string
task_assignees?: string[]
task_duedate?: string // date-time
task_execution_type?: "MANUAL" | "AUTOMATION"
task_status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
phase_id?: string
phase_name?: string
phase_assignees?: string[]
phase_progress?: number
phases_in_progress?: Array<{
phase_id?: string
phase_name?: string
phase_progress?: number
phase_assignees?: string[]
}>
selected_closing_reasons?: Array<{
id: string
title: string
}>
closing_reason_description?: string
}

UpdateEntityAttributesโ€‹

type UpdateEntityAttributes = {
source: "workflow_status" | "current_section" | "current_step"
target: {
entitySchema: string
entityAttribute: string
}
}

EntitySyncโ€‹

type EntitySync = {
trigger: {
event: "FlowStarted" | "FlowCompleted" | "FlowCancelled" | "FlowReopened" | "FlowDeleted" | "FlowAssigned" | "FlowDueDateChanged" | "FlowContextsChanged" | "TaskUpdated" | "CurrTaskChanged" | "TaskCompleted" | "TaskSkipped" | "TaskMarkedInProgress" | "TaskMarkedOnHold" | "PhaseUpdated" | "PhaseCompleted" | "PhaseSkipped" | "PhaseMarkedInProgress"
filter?: {
task_template_id?: { ... }
phase_template_id?: { ... }
}
}
value: {
source: "workflow_name" | "workflow_status" | "workflow_assigned_to" | "task_name" | "task_status" | "task_assigned_to" | "phase_name" | "phase_status" | "phase_assigned_to" | "custom_value"
value?: string
}
target: {
entitySchema: string
entityAttribute: string
}
}

DynamicDueDateโ€‹

set a Duedate for a step then a specific

type DynamicDueDate = {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}

StepRequirementโ€‹

describe the requirement for step enablement

type StepRequirement = {
definitionId: string
type: "STEP" | "SECTION"
condition: "CLOSED"
}

StartFlowReqโ€‹

type StartFlowReq = {
flow_template_id: string
trigger?: {
type?: "MANUAL" | "AUTOMATIC"
automation_config?: {
flow_id: { ... }
execution_id?: { ... }
execution_status?: { ... }
error_reason?: { ... }
}
}
contexts: Array<{
entity_id?: string
entity_schema?: string
is_primary?: boolean
}>
purposes?: string[]
}

SearchFlowsReqโ€‹

type SearchFlowsReq = {
entity_id: string
entity_schema: string
}

PatchFlowReqโ€‹

type PatchFlowReq = {
status?: "STARTED" | "DONE" | "CLOSED"
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
closing_reason?: {
selected_reasons?: Array<{
id: { ... }
title: { ... }
}>
configured_reasons?: Array<{
id: { ... }
title: { ... }
}>
extra_description?: string
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
contexts?: Array<{
entity_id?: string
entity_schema?: string
is_primary?: boolean
}>
}

FlowExecutionโ€‹

type FlowExecution = {
id: string
flow_template_id: string
org_id: string
name: string
created_at: string
updated_at: string
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
status: "STARTED" | "DONE" | "CLOSED"
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string
completed_at?: string
closed_at?: string
started_by?: string
closed_by?: string
}
contexts: Array<{
entity_id?: string
entity_schema?: string
is_primary?: boolean
}>
crt_tasks: Array<{
id?: string
}>
phases?: Array<{
id: string
template_id: string
name: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
updated_at?: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
analytics?: {
started_at?: { ... }
in_progress_at?: { ... }
completed_at?: { ... }
status_updated_at?: { ... }
in_progress_by?: { ... }
completed_by?: { ... }
skipped_by?: { ... }
}
taxonomies?: string[]
loop_config?: {
max_iterations: { ... }
crt_iterations?: { ... }
}
}>
tasks: Array<{
id: string
template_id: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
requirements?: Array<{
task_id?: { ... }
phase_id?: { ... }
when: { ... }
}>
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
// ...
}

FlowClosingReasonโ€‹

type FlowClosingReason = {
selected_reasons?: Array<{
id: string
title: string
}>
configured_reasons?: Array<{
id: string
title: string
}>
extra_description?: string
}

FlowTriggerโ€‹

type FlowTrigger = {
type?: "MANUAL" | "AUTOMATIC"
automation_config?: {
flow_id: string
execution_id?: string
execution_status?: string
error_reason?: string
}
}

FlowContextโ€‹

type FlowContext = {
entity_id?: string
entity_schema?: string
is_primary?: boolean
}

EntityRefโ€‹

type EntityRef = {
entity_id?: string
entity_schema?: string
is_primary?: boolean
}

PhaseIdโ€‹

type PhaseId = string

TaskIdโ€‹

type TaskId = string

Taskโ€‹

type Task = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
loop_config?: {
max_iterations: number
crt_iterations?: number
}
} | {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
// ...
}

TaskTypeโ€‹

type TaskType = "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"

ManualTaskโ€‹

type ManualTask = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
loop_config?: {
max_iterations: number
crt_iterations?: number
}
}

AutomationTaskโ€‹

type AutomationTask = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
automation_config: {
flow_id: string
execution_id?: string
execution_status?: string
error_reason?: string
}
automation_execution_id?: string
trigger_mode?: "manual" | "automatic"
schedule?: {
mode: "immediate"
} | {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
schedule_id?: string
} | {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: { ... }
origin: { ... }
schema?: { ... }
attribute?: { ... }
}
schedule_id?: string
}
loop_config?: {
max_iterations: number
// ...
}

LoopInfoโ€‹

Information about loop iterations, when task is part of a loop branch

type LoopInfo = {
max_iterations: number
crt_iterations?: number
}

LoopConfigโ€‹

type LoopConfig = {
loop_branch_id: string
exit_branch_id: string
max_iterations: number
crt_iterations?: number
}

TriggerModeโ€‹

type TriggerMode = "manual" | "automatic"

ActionScheduleโ€‹

type ActionSchedule = {
mode: "immediate"
} | {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
schedule_id?: string
} | {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: string
origin: "flow_started" | "task_completed" | "trigger_entity_attribute" | "all_preceding_tasks_completed"
schema?: string
attribute?: string
}
schedule_id?: string
}

ImmediateScheduleโ€‹

type ImmediateSchedule = {
mode: "immediate"
}

DelayedScheduleโ€‹

type DelayedSchedule = {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
schedule_id?: string
}

RelativeScheduleโ€‹

type RelativeSchedule = {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: string
origin: "flow_started" | "task_completed" | "trigger_entity_attribute" | "all_preceding_tasks_completed"
schema?: string
attribute?: string
}
schedule_id?: string
}

DecisionTaskโ€‹

type DecisionTask = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
trigger_mode: "manual" | "automatic"
conditions: Array<{
id: string
branch_name: string
logical_operator: "AND" | "OR"
statements: Array<{
id: { ... }
source: { ... }
operator: { ... }
values: { ... }
}>
evaluated_at?: string // date-time
is_met?: boolean
}>
schedule?: {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
schedule_id?: string
} | {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: { ... }
origin: { ... }
schema?: { ... }
attribute?: { ... }
}
// ...
}

AiAgentTaskโ€‹

type AiAgentTask = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
agent_config?: {
agent_id: string
parameters?: object
}
loop_config?: {
max_iterations: number
crt_iterations?: number
}
agent_execution?: {
execution_id?: string
execution_status?: string
error_reason?: string
}
agent_execution_id?: string
}

AgentConfigโ€‹

Configuration for AI Agent to run

type AgentConfig = {
agent_id: string
parameters?: object
}

AgentExecutionInfoโ€‹

type AgentExecutionInfo = {
execution_id?: string
execution_status?: string
error_reason?: string
}

TaskBaseโ€‹

type TaskBase = {
id: string
template_id: string
name: string
description?: {
enabled?: boolean
value?: string
}
status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
requirements?: Array<{
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}>
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
created_at?: string // date-time
updated_at?: string // date-time
manually_created?: boolean
enabled: boolean
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
taxonomies?: string[]
phase_id?: string
task_type: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
}

Phaseโ€‹

type Phase = {
id: string
template_id: string
name: string
status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"
updated_at?: string
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
analytics?: {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}
taxonomies?: string[]
loop_config?: {
max_iterations: number
crt_iterations?: number
}
}

Edgeโ€‹

type Edge = {
id: string
from_id: string
to_id: string
condition_id?: string
none_met?: boolean
}

AutomationInfoโ€‹

type AutomationInfo = {
flow_id: string
execution_id?: string
execution_status?: string
error_reason?: string
}

AnalyticsInfoโ€‹

type AnalyticsInfo = {
started_at?: string // date-time
in_progress_at?: string // date-time
completed_at?: string // date-time
status_updated_at?: string // date-time
in_progress_by?: string
completed_by?: string
skipped_by?: string
}

ConditionIdโ€‹

A locally unique identifier for the condition

type ConditionId = string

Conditionโ€‹

type Condition = {
id: string
branch_name: string
logical_operator: "AND" | "OR"
statements: Array<{
id: string
source: {
id?: { ... }
origin?: { ... }
origin_type?: { ... }
schema?: { ... }
attribute?: { ... }
attribute_type?: { ... }
attribute_repeatable?: { ... }
attribute_operation?: { ... }
attribute_sub_field?: { ... }
}
operator: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"
values: string[]
}>
evaluated_at?: string // date-time
is_met?: boolean
}

Statementโ€‹

type Statement = {
id: string
source: {
id?: string
origin?: "trigger" | "action"
origin_type?: "entity" | "workflow" | "journey_block"
schema?: string
attribute?: string
attribute_type?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label" | "message_email_address"
attribute_repeatable?: boolean
attribute_operation?: "all" | "updated" | "added" | "deleted"
attribute_sub_field?: string
}
operator: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"
values: string[]
}

EvaluationSourceโ€‹

type EvaluationSource = {
id?: string
origin?: "trigger" | "action"
origin_type?: "entity" | "workflow" | "journey_block"
schema?: string
attribute?: string
attribute_type?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label" | "message_email_address"
attribute_repeatable?: boolean
attribute_operation?: "all" | "updated" | "added" | "deleted"
attribute_sub_field?: string
}

Operatorโ€‹

type Operator = "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"

DueDateConfigโ€‹

Set due date for the task based on a dynamic condition

type DueDateConfig = {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}

TimeUnitโ€‹

type TimeUnit = "minutes" | "hours" | "days" | "weeks" | "months"

EnableRequirementโ€‹

describe the requirement for a task to be enabled

type EnableRequirement = {
task_id?: string
phase_id?: string
when: "TASK_FINISHED" | "PHASE_FINISHED"
}

FlowTemplateIdโ€‹

type FlowTemplateId = string

FlowExecutionIdโ€‹

type FlowExecutionId = string

UserIdโ€‹

The user id

type UserId = string

VariableAssignmentโ€‹

Represents a variable assignment with its expression and optional resolved value. Used for dynamic user assignments that get resolved during workflow execution.

type VariableAssignment = {
variable: string
value?: string[]
}

Assigneesโ€‹

The user ids or variable assignments

type Assignees = Array<string | {
variable: string
value?: string[]
}>

PatchTaskReqโ€‹

type PatchTaskReq = {
name?: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
enabled?: boolean
automation_config?: {
flow_id: string
execution_id?: string
execution_status?: string
error_reason?: string
}
description?: {
enabled?: boolean
value?: string
}
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
next_condition_id?: string
revert_execution?: boolean
}

PatchPhaseReqโ€‹

type PatchPhaseReq = {
name?: string
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string[]
}>
}

AddTaskReqโ€‹

type AddTaskReq = {
previous_task_id: string // uuid
next_task_id: string // uuid
task: {
id?: string // uuid
name: string
status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "ON_HOLD" | "FAILED"
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
enabled?: boolean
automation_config?: {
flow_id: { ... }
execution_id?: { ... }
execution_status?: { ... }
error_reason?: { ... }
}
phase_id?: string
task_type?: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"
}
}