Features

Automation — Workflow Engine

The Automation module lets agencies define trigger-based rules that execute automatically when business events occur. It replaces the manual follow-up checklist that every agency relies on but rarely maintains.

  • Free: Automation hidden entirely
  • Pro: Up to 10 active workflows, 500 runs/month, run history log
  • Enterprise: Unlimited workflows and runs

Triggers

TriggerWhen it fires
deal_stage_changeA deal moves to any stage (configurable: from/to stage)
lead_convertedA lead is converted to a contact and deal

Actions

Action typeWhat it does
send_emailSends an email to a configured recipient via the transactional email provider
update_fieldUpdates a field value on the triggering entity (deal or lead)
create_taskCreates a task linked to the triggering deal or project

User-facing behavior

  • Workflow list (/crm/automation): Active and inactive workflows with name, trigger type, action count, last run, status toggle.
  • Create workflow: Select trigger, configure conditions (from/to stage for deal triggers), add actions in order.
  • Activate/deactivate: Toggle without deleting.
  • Run History (Pro): Accordion list of recent executions below the workflow list. Shows time, trigger type, entity link, run status. Expanding shows per-action results.

Run history schema

Each workflow execution creates a row in workflow_runs and per-action rows in workflow_run_actions.

FieldMeaning
trigger_typedeal_stage_change or lead_converted
trigger_entity_idUUID of the deal or lead that triggered the run
statusstarted, completed, partial, or failed
metadatae.g. { fromStage, toStage, dealTitle }
Important: Workflow logging is non-blocking. If logging fails, the actual workflow action still completes. Pro orgs over 500 runs/month still have workflows fire — only the log entry is suppressed.

Technical reference

FilePurpose
actions/workflows.tsTrigger CRUD
actions/workflow-actions.tsAction CRUD
actions/workflow-runs.tsRun history (cursor-paginated)
lib/automation/workflow-execution.tsrunDealStageChangeWorkflows, runLeadConvertedWorkflows
lib/automation/workflow-run-logging.tstryStartWorkflowRun, logWorkflowActionResult, completeWorkflowRun