Workflow Automation
Overview
A workflow is a multi-step automation graph in the style of a journey builder, wiring events, conditions, and actions together. The whole graph is stored as a single JSONB blob, and a versioning system keeps a snapshot of the graph every time it is edited.
An important point: a workflow does not run on its own. It is fired by a trigger rule
that references a specific workflow_id and workflow_node_path. Actions that must wait
before executing are written to scheduled_action for the worker to pick up at the
appointed time.
Core Data Structure
workflow (model Workflow)
name,description, andstatus(string, defaultdraft)definitionJSONB — the complete graph: nodes, edges, and conditionscompiled_refsJSONB — the result of compilation, such as the list of triggers and assets the graph references, used to check dependencies before deleting referenced objectsline_oa_idandorganization_id, with soft delete viadeleted_date- indexes on
(line_oa_id, organization_id)and(deleted_date) 1 : Nrelations totrigger_ruleandworkflow_version
workflow_version (model WorkflowVersion)
workflow_id→workflow.idandversion(int)definitionJSONB — the snapshot of the graph at that versioneventVARCHAR(20) — what caused the new version, such as a publish or a save- an index on
(workflow_id, version DESC)for fetching the latest version
The number of simultaneously active workflows is capped by the
plan_limits.maxActiveWorkflows quota tied to the organisation's plan.
Related Files
prisma/schema.prisma:1455— modelWorkflowprisma/schema.prisma:1478— modelWorkflowVersionmanual-sql/7.plan_limits.sql— themaxActiveWorkflowsquotaschema-dumps/2026-07-24/schema.sql:3166,:3207
Connections to Other Services
- cms-api-go — the graph designer, and publishing, which creates a
workflow_versionand compiles the associated trigger rules - worker-go — the actual runtime: walks the
definitionstarting from the node named inworkflow_node_path
Related domains: Trigger Rules (entry points and scheduled actions), Organisation Plans (quotas), Audience, Message Library, Attribute Master