Siglo provides built-in fault tolerance without requiring external cron daemons.
1. Retry Policies and Exponential Backoff
Declare retry logic per-step via.onFail(RetryConfig):
2. Timeouts
Step-Level Timeouts
Enforce execution deadlines on individual steps:[!NOTE] Step timeouts encompass the entire step lifecycle—includingStep.specvalidation, transformers, translators,onBeforeplugins, the step action, andonAfterhooks. If any phase hangs or exceeds the deadline, the step aborts and rejects withStepTimeoutExceptiontagged with its active execution phase.
Workflow-Level Timeouts
Enforce end-to-end deadlines across the entire workflow sequence:3. Cooperative Cancellation with AbortSignal
Pass an standard AbortController.signal into workflow.run():
param.signal (native AbortSignal) or param.$signal() (callable compatibility accessor):
4. Sagas and Compensating Transactions
When a multi-step transaction fails midway,Siglo automatically executes registered compensation handlers in reverse (LIFO) order:
Minimal Example
Failure Example: Exceeded Retries & Compensation Diagnostics
Testing Example
Operational Caveats
- Compensations Must Be Idempotent: Compensation handlers may be retried if network interruptions occur during rollback. Ensure cleanup functions (e.g., refunding payments) can be called multiple times safely.
- Backoff Jitter: Always enable
jitter: trueon retries targeting shared downstream dependencies to prevent synchronized waves of retry requests. - Cancellation Propagation: In steps that invoke long-running I/O or child processes, always pass
param.signaldownstream to ensure execution halts promptly upon workflow cancellation.
