Design a Marketing Workflow Automation Engine for Millions of Records
Last updated: November 29, 2026
Quick Overview
Design the backend for a no-code automation product where customers define workflows (an enrollment trigger, then actions such as send email, wait 3 days, branch on a property, update a field) that run against millions of CRM records across many accounts.
HubSpot
November 29, 20260
0
0 solved
Design the backend for a no-code automation product where customers define workflows (an enrollment trigger, then actions such as send email, wait 3 days, branch on a property, update a field) that run against millions of CRM records across many accounts.
Workflows are one of HubSpot's most used features across Marketing, Sales and Service Hubs, and they combine event triggers, long delays and per-tenant fairness. The interviewer looks for a durable, tenant-aware execution model rather than a cron job that scans everything.
What the Interviewer Expects
- Separates workflow definitions, enrollment and step execution
- Handles long delays durably without holding threads or memory
- Makes actions idempotent so retries never double-send an email
- Isolates tenants so one huge enrollment does not delay everyone else
- Explains how definition edits affect records already mid-workflow
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A customer enrolls 3 million contacts at once. What happens to other portals?
- How do you guarantee a contact is not enrolled twice by concurrent triggers?
- How would you show a per-contact history of which steps ran and why?
- How do you safely roll out a new action type?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: create and version workflows; enroll records by trigger (property change, form submission, list membership) or manually; execute steps (actions, delays, if/then branches); show enrollment ...
High-Level Design
- Definition service: stores workflow graphs as immutable versions in MySQL.
- Trigger evaluator: consumes CRM change events from Kafka, matches them against compiled trigger filters indexed b...