Design of a Marketing Automation System: Requirements, Architecture, and Engine Implementation
This article explains the need for marketing automation, analyzes requirements, proposes system capabilities, presents a four‑layer architecture inspired by IDE/JVM concepts, and details the FSM‑based engine model with trigger, action, and execution strategies for complex multi‑step marketing scenarios.
As business grows, product and operations demand increasingly sophisticated marketing tools; simple coupon or messaging utilities become inefficient for complex, multi‑step campaigns, prompting the development of a marketing automation system that visualizes plans on a canvas, monitors execution, and provides funnel and interval analysis.
Requirement Analysis identifies marketing as a merchant’s effort to increase revenue through rule‑based user interaction, outlines a common three‑step pattern (rule definition, user participation, reward delivery), and describes how operators currently repeat offline data filtering when faced with low engagement or unused coupons.
The ideal approach lets operators pre‑define campaigns on a canvas, handing them to an automated system for execution.
System Capabilities include: user‑customizable marketing plans, automatic execution of complex multi‑branch workflows, proactive user triggers, behavior monitoring, and risk‑control features such as participation frequency limits.
Architecture Design follows a four‑layer model analogous to IDE/JVM:
Marketing Automation Application – a visual IDE for drawing marketing ideas.
Marketing Automation API – a set of integration specifications.
Marketing Automation Translator – compiles API definitions into a bytecode‑like format understood by the engine.
Marketing Automation Engine – executes the compiled campaigns.
The engine is built on a Finite State Machine (FSM) model driven by triggers. A graph represents a campaign, defining audience, schedule, frequency, and path; edges are trigger conditions (including logical AND/OR, system‑monitor events, and user actions); points are marketing actions such as push notifications, coupons, discounts, or rewards.
Action execution supports three ordering strategies: parallel (simultaneous), serial (sequential with dependencies), and priority (first successful action stops subsequent ones).
Engine Modules :
State Control – core FSM‑based state management.
Time Control – minute‑level scheduling via Redis and arbitrary timing via crontab, plus step‑based delay handling.
Event Rule Control – monitors user events, validates them against configurable rules (including multi‑parameter AND/OR logic), and forwards qualified events to the state controller.
Action Execution Control – carries out marketing actions (e.g., SMS, coupons) after state transitions.
Monitoring Center – provides alerts for each engine component.
Exception Handling – custom retry mechanisms with automatic recovery and manual intervention when needed.
Data Warehouse – stores trigger data, action data, and user campaign state flows for funnel and interval analysis and for downstream business correlation.
Rule expressions can be written using a two‑dimensional array syntax, for example:
(productId == 1 || productId == 1) && (cityId == 2) && (price >= 20) -> [[productid eq 1,productId eq 1],[cityId eq 2],[price lte 20]];Another example combines multiple events:
(累计消耗20元 或 下单满5单) 并且 (发帖数达到10条) -> [[累计消耗20, 下单满5单],[发帖数达到10条]]Summary & Outlook – The marketing automation system aims to automate complex campaigns, improve operational efficiency, and leverage a data warehouse for post‑campaign effect analysis. Future articles will dive deeper into technical details such as Redis‑based rule evaluation, QPS handling, and fault‑tolerance mechanisms.
58 Tech
Official tech channel of 58, a platform for tech innovation, sharing, and communication.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.