Skip to main content

Workflows Definitions

Usageโ€‹

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.workflowDefinition.getMaxAllowedLimit(...)

Tree-shakeable importโ€‹

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

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

Operationsโ€‹

Workflows

Flows V2

Closing Reason

Schemas

getMaxAllowedLimitโ€‹

Get limits and number of created executions for an Organization.

GET /v1/workflows/limits/max-allowed

const { data } = await client.getMaxAllowedLimit()
Response
{
"currentNoOfWorkflows": 0,
"maxAllowed": 0
}

getDefinitionsโ€‹

Retrieve all Workflow Definitions from an Organization

GET /v1/workflows/definitions

const { data } = await client.getDefinitions()
Response
[
{
"id": "string",
"name": "string",
"description": "string",
"creationTime": "2021-04-27T12:01:13.000Z",
"enabled": true,
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"userIds": [0],
"assignedTo": ["string"],
"enableECPWorkflow": true,
"flow": [
{},
{}
],
"closingReasons": [
{}
],
"updateEntityAttributes": [
{}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}
]

createDefinitionโ€‹

Create a Workflow Definition.

POST /v1/workflows/definitions

const { data } = await client.createDefinition(
null,
{
id: 'string',
name: 'string',
description: 'string',
creationTime: '2021-04-27T12:01:13.000Z',
enabled: true,
lastUpdateTime: '2021-04-27T12:01:13.000Z',
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: {
numberOfUnits: 0,
timePeriod: 'minutes',
actionTypeCondition: 'WORKFLOW_STARTED',
stepId: 'string',
phaseId: 'string'
},
userIds: [0],
assignedTo: ['string'],
enableECPWorkflow: true,
flow: [
{
id: 'string',
name: 'string',
order: 0,
type: 'STEP',
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: { /* ... */ },
assignedTo: ['string'],
steps: [ /* ... */ ],
taxonomies: ['string']
},
{
id: 'string',
name: 'string',
description: { /* ... */ },
executionType: 'MANUAL',
automationConfig: { /* ... */ },
journey: { /* ... */ },
order: 0,
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: { /* ... */ },
userIds: [0],
requirements: [ /* ... */ ],
assignedTo: ['string'],
type: 'STEP',
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string']
}
],
closingReasons: [
{
id: 'x739cew'
}
],
updateEntityAttributes: [
{
source: 'workflow_status',
target: { /* ... */ }
}
],
taxonomies: ['string'],
singleClosingReasonSelection: true
},
)
Response
{
"id": "string",
"name": "string",
"description": "string",
"creationTime": "2021-04-27T12:01:13.000Z",
"enabled": true,
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"userIds": [0],
"assignedTo": ["string"],
"enableECPWorkflow": true,
"flow": [
{
"id": "string",
"name": "string",
"order": 0,
"type": "STEP",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"assignedTo": ["string"],
"steps": [],
"taxonomies": ["string"]
},
{
"id": "string",
"name": "string",
"description": {},
"executionType": "MANUAL",
"automationConfig": {},
"journey": {},
"order": 0,
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"userIds": [0],
"requirements": [],
"assignedTo": ["string"],
"type": "STEP",
"ecp": {},
"installer": {},
"taxonomies": ["string"]
}
],
"closingReasons": [
{
"id": "x739cew"
}
],
"updateEntityAttributes": [
{
"source": "workflow_status",
"target": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

listFlowTemplatesโ€‹

List all Flow Templates for a customer. Optionally, you can filter flow templates by trigger values.

GET /v2/flows/templates

const { data } = await client.listFlowTemplates({
trigger_type: 'example',
trigger_source_id: 'example',
trigger_schema: 'example',
})
Response
{
"results": [
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"available_in_ecp": true,
"additional_triggers": [],
"phases": [],
"tasks": [],
"edges": [],
"closing_reasons": [],
"entity_sync": [],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}
]
}

createFlowTemplateโ€‹

Create a new Flow Template.

POST /v2/flows/templates

const { data } = await client.createFlowTemplate(
null,
{
id: 'string',
org_id: 'string',
name: 'string',
description: 'string',
trigger: {
type: 'automation',
automation_id: 'g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg'
},
enabled: true,
version: 2,
created_at: '2021-04-27T12:01:13.000Z',
updated_at: '2021-04-27T12:01:13.000Z',
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'],
available_in_ecp: true,
additional_triggers: [
{
id: 'string',
type: 'manual',
entity_schema: 'string'
},
{
id: 'string',
type: 'automation',
automation_id: 'string',
trigger_config: [ /* ... */ ]
},
/* ... 2 more */
],
phases: [
{
id: 'string',
name: 'string',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
assigned_to: ['string'],
taxonomies: ['string']
}
],
tasks: [
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL'
},
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL',
automation_config: { /* ... */ },
trigger_mode: 'manual',
schedule: { /* ... */ },
created_automatically: false
},
/* ... 2 more */
],
edges: [
{
id: 'string',
from_id: 'string',
to_id: 'string',
condition_id: 'string',
none_met: true
}
],
closing_reasons: [
{
id: 'string',
title: 'string',
status: 'ACTIVE',
lastUpdateTime: 'string',
creationTime: 'string'
}
],
entity_sync: [
{
trigger: { /* ... */ },
target: { /* ... */ },
value: { /* ... */ }
}
],
taxonomies: ['string'],
singleClosingReasonSelection: true
},
)
Response
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{
"id": "string",
"type": "manual",
"entity_schema": "string"
},
{
"id": "string",
"type": "automation",
"automation_id": "string",
"trigger_config": []
}
],
"phases": [
{
"id": "string",
"name": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"taxonomies": ["string"]
}
],
"tasks": [
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL"
},
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {},
"trigger_mode": "manual",
"schedule": {},
"created_automatically": false
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "string",
"none_met": true
}
],
"closing_reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
],
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

searchFlowTemplatesโ€‹

Search for flow templates by name, trigger type, enabled status, and more.

POST /v2/flows/templates:search

const { data } = await client.searchFlowTemplates(
null,
{
name: 'string',
definition_id: 'string',
trigger_type: 'journey_submission',
enabled: true,
from: 0,
size: 0,
sort_by: 'updated_at',
sort_order: 'desc'
},
)
Response
{
"hits": 0,
"results": [
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"available_in_ecp": true,
"additional_triggers": [],
"phases": [],
"tasks": [],
"edges": [],
"closing_reasons": [],
"entity_sync": [],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}
]
}

getFlowTemplateโ€‹

Get specific FLow template for a customer

GET /v2/flows/templates/{flowId}

const { data } = await client.getFlowTemplate({
flowId: 'example',
})
Response
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{
"id": "string",
"type": "manual",
"entity_schema": "string"
},
{
"id": "string",
"type": "automation",
"automation_id": "string",
"trigger_config": []
}
],
"phases": [
{
"id": "string",
"name": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"taxonomies": ["string"]
}
],
"tasks": [
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL"
},
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {},
"trigger_mode": "manual",
"schedule": {},
"created_automatically": false
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "string",
"none_met": true
}
],
"closing_reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
],
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

updateFlowTemplateโ€‹

Update Flow Template.

PUT /v2/flows/templates/{flowId}

const { data } = await client.updateFlowTemplate(
{
flowId: 'example',
},
{
id: 'string',
org_id: 'string',
name: 'string',
description: 'string',
trigger: {
type: 'automation',
automation_id: 'g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg'
},
enabled: true,
version: 2,
created_at: '2021-04-27T12:01:13.000Z',
updated_at: '2021-04-27T12:01:13.000Z',
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'],
available_in_ecp: true,
additional_triggers: [
{
id: 'string',
type: 'manual',
entity_schema: 'string'
},
{
id: 'string',
type: 'automation',
automation_id: 'string',
trigger_config: [ /* ... */ ]
},
/* ... 2 more */
],
phases: [
{
id: 'string',
name: 'string',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
assigned_to: ['string'],
taxonomies: ['string']
}
],
tasks: [
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL'
},
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL',
automation_config: { /* ... */ },
trigger_mode: 'manual',
schedule: { /* ... */ },
created_automatically: false
},
/* ... 2 more */
],
edges: [
{
id: 'string',
from_id: 'string',
to_id: 'string',
condition_id: 'string',
none_met: true
}
],
closing_reasons: [
{
id: 'string',
title: 'string',
status: 'ACTIVE',
lastUpdateTime: 'string',
creationTime: 'string'
}
],
entity_sync: [
{
trigger: { /* ... */ },
target: { /* ... */ },
value: { /* ... */ }
}
],
taxonomies: ['string'],
singleClosingReasonSelection: true
},
)
Response
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{
"id": "string",
"type": "manual",
"entity_schema": "string"
},
{
"id": "string",
"type": "automation",
"automation_id": "string",
"trigger_config": []
}
],
"phases": [
{
"id": "string",
"name": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"taxonomies": ["string"]
}
],
"tasks": [
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL"
},
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {},
"trigger_mode": "manual",
"schedule": {},
"created_automatically": false
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "string",
"none_met": true
}
],
"closing_reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
],
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

deleteFlowTemplateโ€‹

Delete Flow Template.

DELETE /v2/flows/templates/{flowId}

const { data } = await client.deleteFlowTemplate({
flowId: 'example',
})

duplicateFlowTemplateโ€‹

Duplicate a Flow Template from an existing workflow.

POST /v2/flows/templates/{flowId}/duplicate

const { data } = await client.duplicateFlowTemplate({
flowId: 'example',
})
Response
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{
"id": "string",
"type": "manual",
"entity_schema": "string"
},
{
"id": "string",
"type": "automation",
"automation_id": "string",
"trigger_config": []
}
],
"phases": [
{
"id": "string",
"name": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"taxonomies": ["string"]
}
],
"tasks": [
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL"
},
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {},
"trigger_mode": "manual",
"schedule": {},
"created_automatically": false
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "string",
"none_met": true
}
],
"closing_reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
],
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

exportFlowTemplateโ€‹

Export a Flow Template with all referenced automations resolved and bundled alongside.

GET /v2/flows/templates/{flowId}/export

const { data } = await client.exportFlowTemplate({
flowId: 'example',
})
Response
{
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{
"id": "string",
"type": "manual",
"entity_schema": "string"
},
{
"id": "string",
"type": "automation",
"automation_id": "string",
"trigger_config": []
}
],
"phases": [
{
"id": "string",
"name": "string",
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"assigned_to": ["string"],
"taxonomies": ["string"]
}
],
"tasks": [
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL"
},
{
"id": "string",
"name": "string",
"description": {},
"journey": {},
"due_date": "2021-04-27T12:00:00.000Z",
"due_date_config": {},
"requirements": [],
"assigned_to": ["string"],
"ecp": {},
"installer": {},
"taxonomies": ["string"],
"phase_id": "string",
"task_type": "MANUAL",
"automation_config": {},
"trigger_mode": "manual",
"schedule": {},
"created_automatically": false
}
],
"edges": [
{
"id": "string",
"from_id": "string",
"to_id": "string",
"condition_id": "string",
"none_met": true
}
],
"closing_reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
],
"entity_sync": [
{
"trigger": {},
"target": {},
"value": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true,
"_resolved_automations": {}
}

importFlowTemplateโ€‹

Import a Flow Template from an export payload. Creates all automations and the flow in the caller's organization.

POST /v2/flows/templates/import

const { data } = await client.importFlowTemplate(
null,
{
id: 'string',
org_id: 'string',
name: 'string',
description: 'string',
trigger: {
type: 'automation',
automation_id: 'g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg'
},
enabled: true,
version: 2,
created_at: '2021-04-27T12:01:13.000Z',
updated_at: '2021-04-27T12:01:13.000Z',
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'],
available_in_ecp: true,
additional_triggers: [
{
id: 'string',
type: 'manual',
entity_schema: 'string'
},
{
id: 'string',
type: 'automation',
automation_id: 'string',
trigger_config: [ /* ... */ ]
},
/* ... 2 more */
],
phases: [
{
id: 'string',
name: 'string',
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
assigned_to: ['string'],
taxonomies: ['string']
}
],
tasks: [
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL'
},
{
id: 'string',
name: 'string',
description: { /* ... */ },
journey: { /* ... */ },
due_date: '2021-04-27T12:00:00.000Z',
due_date_config: { /* ... */ },
requirements: [ /* ... */ ],
assigned_to: ['string'],
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string'],
phase_id: 'string',
task_type: 'MANUAL',
automation_config: { /* ... */ },
trigger_mode: 'manual',
schedule: { /* ... */ },
created_automatically: false
},
/* ... 2 more */
],
edges: [
{
id: 'string',
from_id: 'string',
to_id: 'string',
condition_id: 'string',
none_met: true
}
],
closing_reasons: [
{
id: 'string',
title: 'string',
status: 'ACTIVE',
lastUpdateTime: 'string',
creationTime: 'string'
}
],
entity_sync: [
{
trigger: { /* ... */ },
target: { /* ... */ },
value: { /* ... */ }
}
],
taxonomies: ['string'],
singleClosingReasonSelection: true,
_resolved_automations: {}
},
)
Response
{
"flow": {
"id": "string",
"org_id": "string",
"name": "string",
"description": "string",
"trigger": {
"type": "automation",
"automation_id": "g92j2-sg9ug92hjt1gh-9s9gajgs-a979gg"
},
"enabled": true,
"version": 2,
"created_at": "2021-04-27T12:01:13.000Z",
"updated_at": "2021-04-27T12:01:13.000Z",
"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"],
"available_in_ecp": true,
"additional_triggers": [
{},
{}
],
"phases": [
{}
],
"tasks": [
{},
{}
],
"edges": [
{}
],
"closing_reasons": [
{}
],
"entity_sync": [
{}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
},
"_id_mappings": {
"flow_id": {
"old": "string",
"new": "string"
},
"task_ids": {},
"automation_ids": {}
}
}

getDefinitionโ€‹

Get specific Definition by id from the Organization.

GET /v1/workflows/definitions/{definitionId}

const { data } = await client.getDefinition({
definitionId: 'example',
})
Response
{
"id": "string",
"name": "string",
"description": "string",
"creationTime": "2021-04-27T12:01:13.000Z",
"enabled": true,
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"userIds": [0],
"assignedTo": ["string"],
"enableECPWorkflow": true,
"flow": [
{
"id": "string",
"name": "string",
"order": 0,
"type": "STEP",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"assignedTo": ["string"],
"steps": [],
"taxonomies": ["string"]
},
{
"id": "string",
"name": "string",
"description": {},
"executionType": "MANUAL",
"automationConfig": {},
"journey": {},
"order": 0,
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"userIds": [0],
"requirements": [],
"assignedTo": ["string"],
"type": "STEP",
"ecp": {},
"installer": {},
"taxonomies": ["string"]
}
],
"closingReasons": [
{
"id": "x739cew"
}
],
"updateEntityAttributes": [
{
"source": "workflow_status",
"target": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

updateDefinitionโ€‹

Update Workflow Definition.

PUT /v1/workflows/definitions/{definitionId}

const { data } = await client.updateDefinition(
{
definitionId: 'example',
},
{
id: 'string',
name: 'string',
description: 'string',
creationTime: '2021-04-27T12:01:13.000Z',
enabled: true,
lastUpdateTime: '2021-04-27T12:01:13.000Z',
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: {
numberOfUnits: 0,
timePeriod: 'minutes',
actionTypeCondition: 'WORKFLOW_STARTED',
stepId: 'string',
phaseId: 'string'
},
userIds: [0],
assignedTo: ['string'],
enableECPWorkflow: true,
flow: [
{
id: 'string',
name: 'string',
order: 0,
type: 'STEP',
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: { /* ... */ },
assignedTo: ['string'],
steps: [ /* ... */ ],
taxonomies: ['string']
},
{
id: 'string',
name: 'string',
description: { /* ... */ },
executionType: 'MANUAL',
automationConfig: { /* ... */ },
journey: { /* ... */ },
order: 0,
dueDate: '2021-04-27T12:00:00.000Z',
dynamicDueDate: { /* ... */ },
userIds: [0],
requirements: [ /* ... */ ],
assignedTo: ['string'],
type: 'STEP',
ecp: { /* ... */ },
installer: { /* ... */ },
taxonomies: ['string']
}
],
closingReasons: [
{
id: 'x739cew'
}
],
updateEntityAttributes: [
{
source: 'workflow_status',
target: { /* ... */ }
}
],
taxonomies: ['string'],
singleClosingReasonSelection: true
},
)
Response
{
"id": "string",
"name": "string",
"description": "string",
"creationTime": "2021-04-27T12:01:13.000Z",
"enabled": true,
"lastUpdateTime": "2021-04-27T12:01:13.000Z",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {
"numberOfUnits": 0,
"timePeriod": "minutes",
"actionTypeCondition": "WORKFLOW_STARTED",
"stepId": "string",
"phaseId": "string"
},
"userIds": [0],
"assignedTo": ["string"],
"enableECPWorkflow": true,
"flow": [
{
"id": "string",
"name": "string",
"order": 0,
"type": "STEP",
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"assignedTo": ["string"],
"steps": [],
"taxonomies": ["string"]
},
{
"id": "string",
"name": "string",
"description": {},
"executionType": "MANUAL",
"automationConfig": {},
"journey": {},
"order": 0,
"dueDate": "2021-04-27T12:00:00.000Z",
"dynamicDueDate": {},
"userIds": [0],
"requirements": [],
"assignedTo": ["string"],
"type": "STEP",
"ecp": {},
"installer": {},
"taxonomies": ["string"]
}
],
"closingReasons": [
{
"id": "x739cew"
}
],
"updateEntityAttributes": [
{
"source": "workflow_status",
"target": {}
}
],
"taxonomies": ["string"],
"singleClosingReasonSelection": true
}

deleteDefinitionโ€‹

Delete Workflow Definition.

DELETE /v1/workflows/definitions/{definitionId}

const { data } = await client.deleteDefinition({
definitionId: 'example',
})

getAllClosingReasonsโ€‹

Get all Closing Reasons defined in the organization by default all Active.

GET /v1/workflows/closing-reasons

const { data } = await client.getAllClosingReasons({
includeInactive: true,
})
Response
{
"reasons": [
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}
]
}

createClosingReasonโ€‹

A created Closing Reason is stored for the organization and will be displayed in the library of reasons.

POST /v1/workflows/closing-reasons

const { data } = await client.createClosingReason(
null,
{
id: 'string',
title: 'string',
status: 'ACTIVE',
lastUpdateTime: 'string',
creationTime: 'string'
},
)
Response
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}

getClosingReasonโ€‹

Get specific closing reason by id from the organisation.

GET /v2/workflows/closing-reasons/{reasonId}

const { data } = await client.getClosingReason({
reasonId: 'example',
})
Response
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}

updateClosingReasonโ€‹

Update an existing closing reason

PATCH /v2/workflows/closing-reasons/{reasonId}

const { data } = await client.updateClosingReason(
{
reasonId: 'example',
},
{
id: 'string',
title: 'string',
status: 'ACTIVE',
lastUpdateTime: 'string',
creationTime: 'string'
},
)
Response
{
"id": "string",
"title": "string",
"status": "ACTIVE",
"lastUpdateTime": "string",
"creationTime": "string"
}

deleteClosingReasonโ€‹

Permanently delete a closing reason (Using INACTIVE status is recommended instead)

DELETE /v2/workflows/closing-reasons/{reasonId}

const { data } = await client.deleteClosingReason({
reasonId: 'example',
})

changeReasonStatusโ€‹

Change the status of a Closing Reason (eg. ACTIVE to INACTIVE).

PATCH /v1/workflows/closing-reasons/{reasonId}

const { data } = await client.changeReasonStatus(
{
reasonId: 'example',
},
{
status: 'ACTIVE'
},
)

getWorkflowClosingReasonsโ€‹

Returns all closing reasons defined for the workflow.

GET /v1/workflows/definitions/{definitionId}/closing-reasons

const { data } = await client.getWorkflowClosingReasons({
definitionId: 'example',
})
Response
{
"reasons": [
{
"id": "x739cew"
}
]
}

setWorkflowClosingReasonsโ€‹

Sets which closing reasons are defined for this workflow, based on the entire closing reasons catalog.

PATCH /v1/workflows/definitions/{definitionId}/closing-reasons

const { data } = await client.setWorkflowClosingReasons(
{
definitionId: 'example',
},
{
reasons: [
{
id: 'x739cew'
}
]
},
)

Schemasโ€‹

FlowTemplateBaseโ€‹

type FlowTemplateBase = {
id?: string
org_id?: string
name: string
description?: string
trigger?: {
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}
enabled?: boolean
version?: "v1" | "v2" | "v3"
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"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string
}>
available_in_ecp?: boolean
additional_triggers?: Array<{
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}>
phases?: Array<{
id: string
name: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
taxonomies?: string[]
}>
tasks: Array<{
id: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
due_date?: string
due_date_config?: {
// ...
}

FlowTemplateโ€‹

type FlowTemplate = {
id?: string
org_id?: string
name: string
description?: string
trigger?: {
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}
enabled?: boolean
version?: "v1" | "v2" | "v3"
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"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string
}>
available_in_ecp?: boolean
additional_triggers?: Array<{
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}>
phases?: Array<{
id: string
name: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
taxonomies?: string[]
}>
tasks: Array<{
id: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
due_date?: string
due_date_config?: {
// ...
}

Versionโ€‹

Version of the workflow schema.

  • v1 โ€“ Deprecated. The initial version of workflows with limited structure and automation capabilities.
  • v2 โ€“ Linear workflows. Supports sequential task execution with basic automation triggers.
  • v3 โ€“ Advanced workflows. Adds support for branching logic
type Version = "v1" | "v2" | "v3"

Triggerโ€‹

type Trigger = {
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: string
configuration?: Record<string, unknown>
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}

ManualTriggerโ€‹

type ManualTrigger = {
id?: string
type: "manual"
entity_schema?: string
}

AutomationTriggerโ€‹

type AutomationTrigger = {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: string
configuration?: Record<string, unknown>
}>
}

JourneyAutomationTriggerโ€‹

type JourneyAutomationTrigger = {
id?: string
type: "journey_automation"
entity_schema?: string
}

JourneySubmissionTriggerโ€‹

type JourneySubmissionTrigger = {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
}

CreateFlowTemplateโ€‹

type CreateFlowTemplate = {
id?: string
org_id?: string
name: string
description?: string
trigger?: {
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}
enabled?: boolean
version?: "v1" | "v2" | "v3"
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"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string
}>
available_in_ecp?: boolean
additional_triggers?: Array<{
id?: string
type: "manual"
entity_schema?: string
} | {
id?: string
type: "automation"
automation_id?: string
trigger_config?: Array<{
type: { ... }
configuration?: { ... }
}>
} | {
id?: string
type: "journey_submission"
journey_id: string
journey_name?: string
automation_id?: string
} | {
id?: string
type: "journey_automation"
entity_schema?: string
}>
phases?: Array<{
id: string
name: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
taxonomies?: string[]
}>
tasks: Array<{
id: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
due_date?: string
due_date_config?: {
// ...
}

SearchFlowTemplatesโ€‹

type SearchFlowTemplates = {
name?: string
definition_id?: string
trigger_type?: "journey_submission" | "manual" | "automation"
enabled?: boolean
from?: number
size?: number
sort_by?: "created_at" | "updated_at"
sort_order?: "asc" | "desc"
}

FlowTemplatesListโ€‹

type FlowTemplatesList = {
results: Array<{
id?: string
org_id?: string
name: string
description?: string
trigger?: {
id?: { ... }
type: { ... }
entity_schema?: { ... }
} | {
id?: { ... }
type: { ... }
automation_id?: { ... }
trigger_config?: { ... }
} | {
id?: { ... }
type: { ... }
journey_id: { ... }
journey_name?: { ... }
automation_id?: { ... }
} | {
id?: { ... }
type: { ... }
entity_schema?: { ... }
}
enabled?: boolean
version?: "v1" | "v2" | "v3"
created_at?: string
updated_at?: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
available_in_ecp?: boolean
additional_triggers?: Array<{
id?: { ... }
type: { ... }
entity_schema?: { ... }
} | {
id?: { ... }
type: { ... }
automation_id?: { ... }
trigger_config?: { ... }
} | {
id?: { ... }
type: { ... }
journey_id: { ... }
journey_name?: { ... }
automation_id?: { ... }
} | {
id?: { ... }
type: { ... }
entity_schema?: { ... }
}>
phases?: Array<{
id: { ... }
name: { ... }
due_date?: { ... }
due_date_config?: { ... }
assigned_to?: { ... }
taxonomies?: { ... }
}>
tasks: Array<{
id: { ... }
name: { ... }
description?: { ... }
journey?: { ... }
due_date?: { ... }
due_date_config?: { ... }
requirements?: { ... }
assigned_to?: { ... }
ecp?: { ... }
installer?: { ... }
taxonomies?: { ... }
phase_id?: { ... }
task_type: { ... }
} | {
id: { ... }
name: { ... }
description?: { ... }
journey?: { ... }
due_date?: { ... }
due_date_config?: { ... }
requirements?: { ... }
assigned_to?: { ... }
ecp?: { ... }
installer?: { ... }
taxonomies?: { ... }
phase_id?: { ... }
task_type: { ... }
automation_config: { ... }
// ...
}

FlowTemplateIdโ€‹

Short unique id (length 8) to identify the Flow Template.

type FlowTemplateId = string

Taskโ€‹

type Task = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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"
} | {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
ecp?: {
enabled?: boolean
label?: string
description?: string
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
}
installer?: {
enabled?: boolean
label?: string
description?: string
// ...
}

ManualTaskโ€‹

type ManualTask = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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"
}

AutomationTaskโ€‹

type AutomationTask = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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
action_config?: {
type: { ... }
config?: { ... }
}
}
trigger_mode?: "manual" | "automatic"
schedule?: {
mode?: "immediate"
} | {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
} | {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: { ... }
origin: { ... }
schema?: { ... }
attribute?: { ... }
}
}
created_automatically?: boolean
}

AutomationConfigโ€‹

Configuration for automation execution to run

type AutomationConfig = {
flow_id?: string
action_config?: {
type: string
config?: Record<string, unknown>
}
}

AiAgentTaskโ€‹

type AiAgentTask = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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
}
}

AgentConfigโ€‹

Configuration for AI Agent to run

type AgentConfig = {
agent_id: string
}

TriggerModeโ€‹

type TriggerMode = "manual" | "automatic"

ActionScheduleโ€‹

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

ImmediateScheduleโ€‹

type ImmediateSchedule = {
mode?: "immediate"
}

DelayedScheduleโ€‹

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

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"
schema?: string
attribute?: string
}
}

DecisionTaskโ€‹

type DecisionTask = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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: { ... }
}>
}>
schedule?: {
mode: "delayed"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
} | {
mode: "relative"
direction: "before" | "after"
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
reference: {
id: { ... }
origin: { ... }
schema?: { ... }
attribute?: { ... }
}
}
loop_config?: {
loop_branch_id: string
exit_branch_id: string
max_iterations: number
}
}

TaskBaseโ€‹

type TaskBase = {
id: string
name: string
description?: {
enabled?: boolean
value?: string
}
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"
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
}>
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
name: string
due_date?: string
due_date_config?: {
duration: number
unit: "minutes" | "hours" | "days" | "weeks" | "months"
type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED"
task_id?: string
phase_id?: string
}
assigned_to?: Array<string | {
variable: string
value?: string
}>
taxonomies?: 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
}

TaskTypeโ€‹

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

Edgeโ€‹

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

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[]
}>
}

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"
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"
}

WorkflowDefinitionโ€‹

type WorkflowDefinition = {
id?: string
name: string
description?: string
creationTime?: string
enabled?: boolean
lastUpdateTime?: string
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
userIds?: number[]
assignedTo?: string[]
enableECPWorkflow?: boolean
flow: Array<{
id?: string
name: string
order: number
type: "STEP" | "SECTION"
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition: { ... }
stepId?: { ... }
phaseId?: { ... }
}
assignedTo?: string[]
steps: Array<{
id?: { ... }
name: { ... }
description?: { ... }
executionType?: { ... }
automationConfig?: { ... }
journey?: { ... }
order: { ... }
dueDate?: { ... }
dynamicDueDate?: { ... }
userIds?: { ... }
requirements?: { ... }
assignedTo?: { ... }
type: { ... }
ecp?: { ... }
installer?: { ... }
taxonomies?: { ... }
}>
taxonomies?: string[]
} | {
id?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
executionType?: "MANUAL" | "AUTOMATION"
automationConfig?: {
flowId: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
order: number
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition: { ... }
stepId?: { ... }
phaseId?: { ... }
}
userIds?: number[]
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
assignedTo?: string[]
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
taxonomies?: string[]
}>
closingReasons?: Array<{
// ...
}

Stepโ€‹

Action that needs to be done in a Workflow

type Step = {
id?: string
name: string
description?: {
enabled?: boolean
value?: string
}
executionType?: "MANUAL" | "AUTOMATION"
automationConfig?: {
flowId: string
}
journey?: {
id?: string
journeyId?: string
name?: string
complete_task_automatically?: boolean
}
order: number
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
userIds?: number[]
requirements?: Array<{
definitionId: string
type: "STEP" | "SECTION"
condition: "CLOSED"
}>
assignedTo?: 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?: { ... }
}
}
taxonomies?: string[]
}

Sectionโ€‹

A group of Steps that define the progress of the Workflow

type Section = {
id?: string
name: string
order: number
type: "STEP" | "SECTION"
dueDate?: string
dynamicDueDate?: {
numberOfUnits: number
timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"
actionTypeCondition: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"
stepId?: string
phaseId?: string
}
assignedTo?: string[]
steps: Array<{
id?: string
name: string
description?: {
enabled?: { ... }
value?: { ... }
}
executionType?: "MANUAL" | "AUTOMATION"
automationConfig?: {
flowId: { ... }
}
journey?: {
id?: { ... }
journeyId?: { ... }
name?: { ... }
complete_task_automatically?: { ... }
}
order: number
dueDate?: string
dynamicDueDate?: {
numberOfUnits: { ... }
timePeriod: { ... }
actionTypeCondition: { ... }
stepId?: { ... }
phaseId?: { ... }
}
userIds?: number[]
requirements?: Array<{
definitionId: { ... }
type: { ... }
condition: { ... }
}>
assignedTo?: string[]
type: "STEP" | "SECTION"
ecp?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
installer?: {
enabled?: { ... }
label?: { ... }
description?: { ... }
journey?: { ... }
}
taxonomies?: string[]
}>
taxonomies?: string[]
}

TriggerTypeโ€‹

type TriggerType = "MANUAL" | "AUTOMATIC"

ItemTypeโ€‹

type ItemType = "STEP" | "SECTION"

StepTypeโ€‹

type StepType = "MANUAL" | "AUTOMATION"

StepJourneyโ€‹

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

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
}

MaxAllowedLimitโ€‹

type MaxAllowedLimit = {
currentNoOfWorkflows?: number
maxAllowed?: number
}

DefinitionNotFoundRespโ€‹

Definition could be not found

type DefinitionNotFoundResp = {
message?: string
}

ClosingReasonNotFoundRespโ€‹

Closing reason could be not found

type ClosingReasonNotFoundResp = {
message?: string
}

ChangeReasonStatusReqโ€‹

type ChangeReasonStatusReq = {
status: "ACTIVE" | "INACTIVE"
}

ClosingReasonsโ€‹

type ClosingReasons = {
reasons: Array<{
id?: string
title: string
status: "ACTIVE" | "INACTIVE"
lastUpdateTime?: string
creationTime?: string
}>
}

ClosingReasonโ€‹

One Closing reason for a workflow

type ClosingReason = {
id?: string
title: string
status: "ACTIVE" | "INACTIVE"
lastUpdateTime?: string
creationTime?: string
}

ClosingReasonsStatusโ€‹

type ClosingReasonsStatus = "ACTIVE" | "INACTIVE"

ClosingReasonsIdsโ€‹

type ClosingReasonsIds = {
reasons: Array<{
id: string
}>
}

ClosingReasonIdโ€‹

type ClosingReasonId = {
id: string
}

ErrorRespโ€‹

type ErrorResp = {
message?: 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"
}

FlowTemplateExportโ€‹

type FlowTemplateExport = {
_resolved_automations?: Record<string, object>
}

FlowTemplateImportResultโ€‹

type FlowTemplateImportResult = {
flow?: {
id?: string
org_id?: string
name: string
description?: string
trigger?: {
id?: { ... }
type: { ... }
entity_schema?: { ... }
} | {
id?: { ... }
type: { ... }
automation_id?: { ... }
trigger_config?: { ... }
} | {
id?: { ... }
type: { ... }
journey_id: { ... }
journey_name?: { ... }
automation_id?: { ... }
} | {
id?: { ... }
type: { ... }
entity_schema?: { ... }
}
enabled?: boolean
version?: "v1" | "v2" | "v3"
created_at?: string
updated_at?: string
due_date?: string
due_date_config?: {
duration: { ... }
unit: { ... }
type: { ... }
task_id?: { ... }
phase_id?: { ... }
}
assigned_to?: Array<string | {
variable: { ... }
value?: { ... }
}>
available_in_ecp?: boolean
additional_triggers?: Array<{
id?: { ... }
type: { ... }
entity_schema?: { ... }
} | {
id?: { ... }
type: { ... }
automation_id?: { ... }
trigger_config?: { ... }
} | {
id?: { ... }
type: { ... }
journey_id: { ... }
journey_name?: { ... }
automation_id?: { ... }
} | {
id?: { ... }
type: { ... }
entity_schema?: { ... }
}>
phases?: Array<{
id: { ... }
name: { ... }
due_date?: { ... }
due_date_config?: { ... }
assigned_to?: { ... }
taxonomies?: { ... }
}>
tasks: Array<{
id: { ... }
name: { ... }
description?: { ... }
journey?: { ... }
due_date?: { ... }
due_date_config?: { ... }
requirements?: { ... }
assigned_to?: { ... }
ecp?: { ... }
installer?: { ... }
taxonomies?: { ... }
phase_id?: { ... }
task_type: { ... }
} | {
id: { ... }
name: { ... }
description?: { ... }
journey?: { ... }
due_date?: { ... }
due_date_config?: { ... }
requirements?: { ... }
assigned_to?: { ... }
ecp?: { ... }
installer?: { ... }
taxonomies?: { ... }
phase_id?: { ... }
task_type: { ... }
automation_config: { ... }
// ...
}