Workflow Engine Practice in Marketing Automation Platform
The article explains how marketing automation platforms adopt industrial‑grade workflow engines to streamline complex user‑journey processes, outlines sequential, state‑machine and rule‑driven engine types, describes a self‑developed engine’s core modules and service interfaces, and highlights performance, versioning, plugin and monitoring considerations.
This article is the fourth installment in the "vivo Marketing Automation Technology Decoded" series, analyzing the background of introducing workflow technology in marketing automation business and providing an introduction to workflow engines. It also covers several popular open-source workflow engines and the design thinking during the project's self-developed development process.
Business Background: The marketing automation platform supports activity journey strategy configurations for different user life cycles, enabling differentiated marketing delivery based on user-triggered activity behaviors. However, complex and diverse business processes, frequent requirement changes, and various pain points exist: long project delivery cycles, repetitive development and testing, and high maintenance costs.
Workflow Introduction: Workflow is an industrial-grade solution defined by the Workflow Management Coalition (WfMC). Its core idea is to instantiate real activities through pre-defined workflow templates. Key features include process visualization, business orchestration and reuse, and separation of business and control logic.
Workflow Engine Types:
Sequential Workflow: Similar to a flowchart where tasks proceed in sequence, irreversible.
State Machine Workflow: Focuses on task states, driven by external events, reversible between nodes.
Rule-Driven Workflow: Focuses on node operation rules based on business rules.
Self-Developed Engine Core Design:
The core modules include: 1) Process Template Creation - creating process templates based on business rules; 2) Process Instance Publishing - creating process instances from templates; 3) Task Execution - executing instances independently.
Core Service Interfaces:
public interface FlowEngine {
FlowInstance startInstance(String processDefKey, Map<String, Object> args);
void execInstance(Long instanceId, Map<String, Object> args) throws FlowAuthorityException;
ProcessService process();
InstanceService instance();
TaskService task();
}
public interface ProcessService {
void create(String definition);
void deploy(String fileName);
FlowProcess getProcessByDefKey(String processDefKey);
}
public interface InstanceService {
FlowInstance createInstance(FlowProcess process, Map<String, Object> args);
void exec(Long instanceId);
FlowInstance getById(Long instanceId);
}
public interface TaskService {
FlowTask createTask(TaskModel taskModel, Execution execution);
FlowTask complete(Long taskId, Map<String, Object> args);
FlowTask getActiveTask(Long instanceId);
FlowHistTask getLastDoneTask(Long instanceId);
}Key Considerations:
Process definition parsing performance optimization (multi-threaded parsing, lazy loading)
Process definition version compatibility
Process node pluginization and orchestration capabilities
Process execution monitoring capabilities
vivo Internet Technology
Sharing practical vivo Internet technology insights and salon events, plus the latest industry news and hot conferences.
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.