Workflows Definitions
- Base URL:
https://workflows-definition.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/workflow-definition
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
getMaxAllowedLimitgetDefinitionscreateDefinitiongetDefinitionupdateDefinitiondeleteDefinitiongetWorkflowClosingReasonssetWorkflowClosingReasons
Flows V2
listFlowTemplatescreateFlowTemplatesearchFlowTemplatesgetFlowTemplateupdateFlowTemplatedeleteFlowTemplateduplicateFlowTemplateexportFlowTemplateimportFlowTemplate
Closing Reason
getAllClosingReasonscreateClosingReasongetClosingReasonupdateClosingReasondeleteClosingReasonchangeReasonStatus
Schemas
FlowTemplateBaseFlowTemplateVersionTriggerManualTriggerAutomationTriggerJourneyAutomationTriggerJourneySubmissionTriggerCreateFlowTemplateSearchFlowTemplatesFlowTemplatesListFlowTemplateIdTaskManualTaskAutomationTaskAutomationConfigAiAgentTaskAgentConfigTriggerModeActionScheduleImmediateScheduleDelayedScheduleRelativeScheduleDecisionTaskTaskBasePhaseVariableAssignmentTaskTypeEdgeConditionStatementEvaluationSourceOperatorDueDateConfigTimeUnitEnableRequirementWorkflowDefinitionStepSectionTriggerTypeItemTypeStepTypeStepJourneyECPDetailsStepDescriptionMaxAllowedLimitDefinitionNotFoundRespClosingReasonNotFoundRespChangeReasonStatusReqClosingReasonsClosingReasonClosingReasonsStatusClosingReasonsIdsClosingReasonIdErrorRespUpdateEntityAttributesEntitySyncDynamicDueDateStepRequirementFlowTemplateExportFlowTemplateImportResult
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: { ... }
// ...
}