Skip to main content

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, and status (string, default draft)
  • definition JSONB — the complete graph: nodes, edges, and conditions
  • compiled_refs JSONB — the result of compilation, such as the list of triggers and assets the graph references, used to check dependencies before deleting referenced objects
  • line_oa_id and organization_id, with soft delete via deleted_date
  • indexes on (line_oa_id, organization_id) and (deleted_date)
  • 1 : N relations to trigger_rule and workflow_version

workflow_version (model WorkflowVersion)

  • workflow_idworkflow.id and version (int)
  • definition JSONB — the snapshot of the graph at that version
  • event VARCHAR(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.

  • prisma/schema.prisma:1455 — model Workflow
  • prisma/schema.prisma:1478 — model WorkflowVersion
  • manual-sql/7.plan_limits.sql — the maxActiveWorkflows quota
  • schema-dumps/2026-07-24/schema.sql:3166, :3207

Connections to Other Services

  • cms-api-go — the graph designer, and publishing, which creates a workflow_version and compiles the associated trigger rules
  • worker-go — the actual runtime: walks the definition starting from the node named in workflow_node_path

Related domains: Trigger Rules (entry points and scheduled actions), Organisation Plans (quotas), Audience, Message Library, Attribute Master