Design and Implementation of the Comet Workflow Engine
This article presents a comprehensive overview of the Comet workflow engine, detailing its background, architecture, key design concepts, graph‑based legality checks, plugin mechanisms, and practical use cases such as SRE automation, permission requests, and dynamic linear processes, illustrating how a flexible, low‑code platform can streamline enterprise business flows.
The rapid evolution of enterprise software demands a flexible, generic business process engine that can adapt to current IT architectures and future changes; the Comet workflow engine, initiated in 2019, fulfills this need by providing a highly configurable, easy‑to‑use solution supporting numerous Bilibili business scenarios.
Comet is built on centralized, standardized, and integrated workflow principles, offering a platform‑agnostic process template that can be configured to integrate or refactor existing approval flows, reducing system complexity and maintenance costs while enabling unified management and monitoring of diverse business processes.
Key features include support for mobile H5 and web access, various approval modes (add‑sign, transfer‑sign, parallel‑sign, or‑sign), open‑form and plugin extensibility, and graph‑based validation to prevent configuration errors, thereby enhancing integration efficiency.
Practical scenarios demonstrated are SRE automation for cache resource changes, data platform table permission requests with conditional node activation, and push task approvals using dynamic linear processes, each showcasing how Comet reduces manual effort and improves approval speed.
The engine’s architecture consists of three layers: a management layer handling templates, plugins, and graph legality checks; an engine layer executing core actions such as initiation, transition, rejection, closure, and signing; and an asynchronous execution layer processing event‑driven actions.
Process templates model business flows as visual graphs, allowing node logic attributes (AND/OR) and edge transition conditions expressed as JSON‑compatible MongoDB queries; DAG detection algorithms (Kahn’s algorithm and DFS) ensure the workflow graph remains acyclic and valid.
Plugins, implemented as Python scripts or binaries, enable pre‑ and post‑node actions, facilitating integration with external systems; callbacks allow business logic to report success or failure back to the engine, completing the event‑driven execution model.
Overall, Comet’s low‑code, plugin‑driven design provides a versatile solution for enterprise workflow automation, improving efficiency, reducing development costs, and ensuring reliable, scalable process execution across multiple internal platforms.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
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.