Use Cases: Building Platforms with Refluxo
While the Refluxo engine is a powerful tool for orchestrating workflows directly in your code, one of its primary design goals is to serve as a foundational layer for building higher-level platforms, such as:
- Low-code/No-code platforms similar to N8N or Zapier.
- Internal Business Process Management (BPM) tools.
- CI/CD pipeline orchestrators.
- IoT (Internet of Things) automation systems.
The core architectural model of Refluxo provides several key advantages that make it exceptionally well-suited for these use cases.
The Flexibility Advantage
1. Decoupled State (The Snapshot)
The engine is stateless. The entire state of a workflow is encapsulated in a single, serializable JSON object: the Snapshot.
- Benefit for Platforms: This is a game-changer. A backend service can execute a single step of a workflow, save the resulting snapshot to any database (like PostgreSQL, MongoDB, or Redis), and shut down. A separate frontend application can then read that same snapshot to render a real-time visualization of the workflow's progress, inspect the output of each node, and display execution history. There is no need for complex state synchronization between the backend executor and the frontend UI.
2. Frontend-Friendly Definitions
A WorkflowDefinition is a declarative JSON object.
- Benefit for Platforms: This structure can be easily generated and manipulated by a visual interface. You can build a drag-and-drop editor using libraries like React Flow or Svelte Flow that outputs a
WorkflowDefinitionJSON. This JSON is then sent to the backend to be executed by the Refluxo engine. The engine becomes the invisible power behind your visual automation platform.
3. Pluggable and Dynamic Nodes
Node behaviors are not hardcoded into the engine. They are provided as NodeDefinition objects.
- Benefit for Platforms: This allows you to build a plug-in architecture. Your platform could dynamically load new node definitions from different files or even from a database. Users or developers could contribute new nodes (e.g., "Send a Tweet", "Add a row to Google Sheets") by simply providing a new
NodeDefinition, making your platform highly extensible.
4. Embeddable and Portable
Refluxo is a library, not a standalone service.
- Benefit for Platforms: This gives you ultimate flexibility. You can embed the engine within a multi-tenant SaaS application, a desktop app built with Electron, an internal command-line tool, or a network of distributed edge workers. The core logic remains the same, allowing you to build a consistent automation experience across different products and environments.
By leveraging these principles, you can focus on building your unique user experience and business logic, while relying on Refluxo to provide the robust, scalable, and flexible orchestration core.