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
| Trigger | When it fires |
|---|
| deal_stage_change | A deal moves to any stage (configurable: from/to stage) |
| lead_converted | A lead is converted to a contact and deal |
Actions
| Action type | What it does |
|---|
| send_email | Sends an email to a configured recipient via the transactional email provider |
| update_field | Updates a field value on the triggering entity (deal or lead) |
| create_task | Creates 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.
| Field | Meaning |
|---|
| trigger_type | deal_stage_change or lead_converted |
| trigger_entity_id | UUID of the deal or lead that triggered the run |
| status | started, completed, partial, or failed |
| metadata | e.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
| File | Purpose |
|---|
| actions/workflows.ts | Trigger CRUD |
| actions/workflow-actions.ts | Action CRUD |
| actions/workflow-runs.ts | Run history (cursor-paginated) |
| lib/automation/workflow-execution.ts | runDealStageChangeWorkflows, runLeadConvertedWorkflows |
| lib/automation/workflow-run-logging.ts | tryStartWorkflowRun, logWorkflowActionResult, completeWorkflowRun |