When to use this module

  • Build automated marketing sequences that run without manual intervention
  • Trigger actions when contacts are taggedContactTagAdded event node
  • Send WhatsApp messages as automationWhatsappTemplateSend action node
  • Add wait periods between stepsDelay node with days/hours/minutes
  • Monitor execution historyPOST /workflow/{id}/executions

Workflow CRUD Endpoints

MethodRouteAuthDescription
POST/api/v1/Workflow/getall🔑 API KeyPaginated workflow list
GET/api/v1/Workflow/{id}🔑 API KeyGet workflow with nodes + edges
POST/api/v1/Workflow/create🔑 API KeyCreate a new workflow
PUT/api/v1/Workflow/{id}/update🔑 API KeyUpdate workflow details
DELETE/api/v1/Workflow/{id}🔑 API KeyDelete workflow
POST/api/v1/Workflow/import/{id}🔑 API KeyImport a shared workflow by ID
POST/api/v1/Workflow/explore🔑 API KeyBrowse shared/public workflows
POST

/api/v1/Workflow/create

Creates a new workflow for the current firm. The workflow starts with no nodes; use the Flow Designer endpoints to add nodes and connections.

Request Body

JSON
{
  "name": "Welcome Sequence",
  "description": "Auto-send welcome template to new contacts",
  "industry": "General",
  "isActive": true
}

Flow Designer Endpoints

These endpoints manage the visual graph of a workflow. PUT /{id}/flow is used for bulk saves; individual node/edge operations use the other endpoints.
MethodRouteAuthDescription
PUT/api/v1/Workflow/{id}/flow🔑 API KeyBulk update all nodes + status
POST/api/v1/Workflow/{id}/node🔑 API KeyUpsert single node (create or update)
DELETE/api/v1/Workflow/{id}/node/{nodeId}🔑 API KeyDelete a node from the workflow
POST/api/v1/Workflow/{id}/connection🔑 API KeyAdd an edge between two nodes
DELETE/api/v1/Workflow/{id}/connection/{connectionId}🔑 API KeyRemove an edge

Execution History Endpoints

MethodRouteAuthDescription
POST/api/v1/Workflow/{id}/executions🔑 API KeyPaginated execution list for a workflow
GET/api/v1/Workflow/execution/{executionId}/detail🔑 API KeyExecution detail with per-node results

Node Types

Event Nodes

Event nodes are the entry points of a workflow. Each workflow must begin with exactly one event node that defines the trigger condition.

SubTypeTrigger
ContactCreatedNew contact added to the firm
ContactUpdatedContact record edited
ContactDeletedContact removed from the firm
ContactTagAddedA tag was added to a contact
ContactTagRemovedA tag was removed from a contact
WhatsappTemplateDeliveredA WhatsApp template message was delivered

Action Nodes

Action nodes perform operations such as sending messages, waiting, or terminating the workflow.

SubTypeWhat It Does
WhatsappTemplateSendSend a WhatsApp template message to the contact
WhatsappMessageSendSend a custom WhatsApp message
DelayPause execution for N days / hours / minutes
EndTerminate the workflow execution

Condition Nodes

Condition nodes evaluate expressions and route execution down True or False branches.

SubTypeHow It Works
FilterEvaluate contact field or tag → follow True or False edge

Node Configuration Examples

Each node stores its config as JSONB in the Configuration property.

JSON — Delay node: wait 1 day
{ "days": 1, "hours": 0, "minutes": 0 }
JSON — Filter node: check VIP tag
{ "field": "tag", "operator": "equals", "value": "VIP" }
JSON — WhatsApp Template Send
{ "templateId": "guid-of-template" }

Edge SourceHandle Values

SourceHandleMeaning
"Next"Default sequential flow from any node
"True"Condition branch when filter evaluates to true
"False"Condition branch when filter evaluates to false
"{button-guid}"WhatsApp button reply branch — ID of the button tapped

Execution Engine Flow

Workflows execute asynchronously via RabbitMQ. Each node execution is tracked individually with full I/O data.

Trigger event fires (e.g., ContactCreated) │ ▼ System finds active workflows for this event type │ ▼ Creates WorkflowExecution record + snapshot of workflow JSON │ ▼ Publishes message to RabbitMQ 'workflow' queue │ ▼ WorkflowQueueHandler (Worker) processes nodes sequentially: Event Node → Action Node → [Delay?] → Condition Node → Action → End Node │ ├─ Each node → creates WorkflowNodeExecution (status + I/O data) │ ├─ Delay node → creates ScheduledAction → ScheduledActionWorker resumes later │ ├─ WhatsappTemplateSend (buttons) → waits for user reply via SourceHandle edge │ └─ End node → marks WorkflowExecution as Complete Node Execution Status progression: Pending → Running → Success / Failed / Skipped / WaitingForCallback / WaitingForUserReply