Workflows
Workflows are sequential pipelines where each step's output feeds into the next step's input. Unlike sagas, workflows don't have compensation — they're designed for data processing pipelines.
Creating a Workflow
# Create the workflow
naos workflow create data-pipeline
# Add steps in order
naos workflow add-step data-pipeline fetcher
naos workflow add-step data-pipeline transformer
naos workflow add-step data-pipeline loader
Running a Workflow
naos workflow run data-pipeline
Output:
[workflow] data-pipeline starting
[step 1/3] fetcher ✓ completed (2.1s) → 1.2MB
[step 2/3] transformer ✓ completed (4.3s) → 0.8MB
[step 3/3] loader ✓ completed (1.5s) → done
[workflow] data-pipeline completed (7.9s)
Workflow vs Saga
| Feature | Workflow | Saga |
|---|---|---|
| Purpose | Data pipelines | Transactions |
| Data flow | Output → Input chaining | Independent steps |
| On failure | Stops at failed step | Compensates all previous |
| Use case | ETL, processing | Orders, bookings |
Viewing Workflow Status
naos workflow status data-pipeline
WORKFLOW: data-pipeline
Steps: 3 | Last Run: completed | Duration: 7.9s
PIPELINE:
[1] fetcher → [2] transformer → [3] loader
Workflow History
naos workflow history data-pipeline