Jido.Composer.Workflow.Strategy (Jido Composer v0.4.0)

Copy Markdown View Source

Jido.Agent.Strategy implementation for deterministic FSM-based workflows.

Drives a Jido.Composer.Workflow.Machine through its states by emitting directives. Keeps cmd/3 pure — no side effects.

Error Propagation

The strategy preserves original error reasons via the error_reason field in strategy state. When a node fails, the actual error (action error struct, child agent error, or transition error) is stored and threaded through to observability spans and the DSL's check_terminal function. Callers receive the original error rather than a generic :workflow_failed atom.

Every path that sets status: :failure also closes the agent observability span, ensuring telemetry is emitted on all failure scenarios.

Summary

Functions

Strategy-specific closure stripping for checkpoint serialization.

Functions

strip_for_checkpoint(state)

@spec strip_for_checkpoint(map()) :: map()

Strategy-specific closure stripping for checkpoint serialization.

Called by Checkpoint.prepare_for_checkpoint/1 via delegation. Workflows have no nested closures, so this just strips top-level functions.