Design a CRM Workflow Automation Engine
HardSystem design · Workflow Automation · SalesForce
Design a workflow automation engine for a multi-tenant CRM. Customers define workflows with triggers (a record is created or changed, a form is submitted, a schedule or delay elapses), conditions, and actions (update a record, create a task, send email, call a webhook). Focus on cascades and loop control, same-transaction versus deferred actions, idempotency and retries, durable timers, per-tenant fairness and quotas, and debuggability. Out of scope: the visual workflow builder and the CRM record store.
Requirements
- Support event and scheduled triggers with cheap condition evaluation and field-level change filters
- Track the whole cascade in one context with depth, count and time limits; detect loops
- Deliver actions at least once with per-step idempotency keys, retries with backoff and a dead-letter path
- Isolate tenants with fair queues and quotas, version definitions, and log every execution for debugging