Skip to main content

Workflow Module

The Workflow Module (apps/backend/modules/workflow) is the heart of automation in Jet Admin. It allows users to define business logic using a visual node-based editor and execute it asynchronously.

Architecture​

The module is built around an event-driven Check-Decide-Act loop pattern, handled by the Orchestrator.

Key Components​

ComponentFile PathResponsibility
Controllerworkflow.controller.jsHandles HTTP requests from the frontend.
Serviceworkflow.service.jsManages CRUD for workflows and initiates execution.
Orchestratororchestrator/orchestrator.jsManages the execution lifecycle and state transitions.
DAG Schedulerorchestrator/dagScheduler.jsCalculates downstream nodes (Next Steps) based on graph topology.
State Managerorchestrator/stateManager.jsHandles database updates for instances and context data.

Data Models​

Workflow Instance (tblWorkflowInstances)​

Represents a single run of a workflow.

FieldTypeDescription
instanceIDUUIDUnique ID for the run.
statusStringPENDING, COMPLETED, FAILED.
contextDataJSONA shared memory space passed between nodes.
isTestBooleanIf true, the run is ephemeral and not saved permanently.

Node Execution Log (tblNodeExecutionLogs)​

Records the result of each step.

FieldTypeDescription
nodeIDUUIDThe node that executed.
inputDataJSONData received by the node.
outputDataJSONData returned by the node.
statusStringsuccess or failure.