SigloError. Every exception attaches execution metadata—including lifecycle phase, step name, execution stack UUID, tenant namespace, retryability flag, and original cause.
1. Exception Hierarchy
Error properties (name, message, stack) while attaching point-of-failure execution context.
2. Common Metadata Fields (ExecutionErrorMetadata)
Every SigloError includes the following metadata fields:
3. Specialized Exception Types
Timeout & Cancellation
StepTimeoutException
Thrown when an individual step execution exceeds its specified step.timeout(ms).
- Properties:
stepName: string,timeoutMs: number,elapsedMs?: number - Default
phase:'action', Defaultretryable:true
FlowTimeoutException
Thrown when the entire flow execution exceeds its configured flow.timeout(ms) or options.timeout.
- Properties:
stackId: string,timeoutMs: number,completedSteps: number - Default
phase:'action', Defaultretryable:false
CancellationException
Thrown when an execution is aborted via an AbortSignal.
- Properties:
reason?: any - Default
phase:'action', Defaultretryable:false
Validation & Graph Specification
ValidationException
Thrown when a step’s input specification or schema validator rejects (Step.spec or validator callback).
- Properties:
field?: string,schemaErrors?: any - Default
phase:'validation', Defaultretryable:false
GraphValidationException
Thrown when static graph validation fails during assertValidGraph().
- Properties:
errors: string[] - Default
phase:'validation', Defaultretryable:false
Storage & Optimistic Concurrency
StorageAdapterException
Thrown when a configured StorageAdapter throws an error and storage error mode is 'strict'.
- Properties:
operation: string,adapterName?: string,originalError?: unknown - Default
phase:'checkpoint', Defaultretryable:false
CheckpointConflictException
Thrown when optimistic revision check fails in storage (options.expectedRevision !== currentRevision).
- Properties:
stackId: string,currentRevision: number,attemptedRevision?: number,expectedRevision?: number - Default
phase:'checkpoint', Defaultretryable:true
OptimisticLockException
Thrown when concurrent workers experience a CAS version conflict when claiming wait records or updating stack state.
- Properties:
stackId: string,currentVersion?: number,expectedVersion?: number - Default
phase:'checkpoint', Defaultretryable:true
NamespaceMismatchException
Thrown when restoring a checkpoint created for a different namespace than the caller’s expected namespace.
- Properties:
expectedNamespace: string,actualNamespace: string - Default
phase:'checkpoint', Defaultretryable:false
CheckpointVersionException
Thrown when restoring a checkpoint produced by an incompatible future schema version (version > 2).
- Properties:
version: number - Default
phase:'checkpoint', Defaultretryable:false
Idempotency & State Concurrency
IdempotencyConflictException
Thrown when another worker or request is concurrently executing with the same claimed idempotency key.
- Properties:
key: string,inProgressStackId?: string - Default
phase:'action', Defaultretryable:false
FieldCollisionException
Thrown when step execution attempts to overwrite reserved engine metadata fields (e.g. $steps, $history).
- Properties:
key: string - Default
phase:'action', Defaultretryable:false
Durable Waits & Resumption
WorkflowSuspendedException
Thrown when a workflow without { durable: true } encounters a durable wait combinator (waitForEvent or wait).
- Properties:
waitingRecord: WaitingWorkflowRecord - Default
phase:'action', Defaultretryable:false
WorkflowAlreadyResumedException
Thrown when an external trigger attempts to resume a wait record that has already been claimed or completed in storage.
- Properties:
correlationKey: string - Default
phase:'action', Defaultretryable:false
DuplicateEventException
Thrown when an event is dispatched to an in-memory wait record that is not in 'waiting' status.
- Properties:
correlationKey: string,eventName?: string - Default
phase:'action', Defaultretryable:false
ExpiredWaitException
Thrown when an event or action token arrives after the wait timeout deadline has elapsed.
- Properties:
correlationKey: string,expiredAt: number,eventName?: string - Default
phase:'action', Defaultretryable:false
WorkflowVersionMismatchException
Thrown when resuming a suspended workflow with mismatched version code and no migration function is supplied.
- Properties:
expectedVersion: any,actualVersion: any - Default
phase:'checkpoint', Defaultretryable:false
Sagas & Compensations
CompensationException
Thrown when one or more compensation rollback handlers fail during forward execution failure recovery.
- Properties:
originalError: Error,compensationErrors: any[],completedCompensations: string[] - Default
phase:'action', Defaultretryable:false
UnresolvableCompensationException
Thrown when a step references a named compensation handler that was not registered via registerCompensationHandler().
- Properties:
handlerName: string,stepName: string - Default
phase:'action', Defaultretryable:false
Network Guardrails
NetworkPolicyViolationException
Thrown when an outbound HTTP, HTTPS, fetch, or raw TCP socket connection is blocked by the active ASL network egress perimeter.
- Properties:
requestedUrl: string,requestedHost: string,allowedHosts: (string | RegExp)[] - Default
phase:'action', Defaultretryable:false
4. Normalization & Cause Preservation
Any non-SigloError (e.g. built-in TypeError, third-party network error, or string literal rejection) is normalized via normalizeError(err, metadata):
- If
erris already aSigloError, the point-of-failure metadata is enriched without overwriting existing fields. - If
erris a standardError, it is wrapped into aSigloError, settingerr.cause = originalError. - If
erris a string or primitive, the string is used as the message. - For backward compatibility with v1.x,
err.stackIdanderr.errorreference the error cause.
5. JSON Serialization (toJSON())
Every SigloError instance implements toJSON() for structured logging, telemetry emission, and network transmission:
