Skip to main content
Enterprise systems encounter network hiccups, slow external services, and user cancellations. 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—including Step.spec validation, transformers, translators, onBefore plugins, the step action, and onAfter hooks. If any phase hangs or exceeds the deadline, the step aborts and rejects with StepTimeoutException tagged 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():
Steps can access the active abort signal via 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

  1. 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.
  2. Backoff Jitter: Always enable jitter: true on retries targeting shared downstream dependencies to prevent synchronized waves of retry requests.
  3. Cancellation Propagation: In steps that invoke long-running I/O or child processes, always pass param.signal downstream to ensure execution halts promptly upon workflow cancellation.