Skip to content

cayu.workflows.models

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.workflows import GateOutcome

Verdict of a gated_loop gate for one item.

Decorators: @dataclass(frozen=True, slots=True).

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
passed bool required
detail Any None

Release source · Runtime guarantees · Capability guides

from cayu.workflows import normalize_gate_outcome

Accept either a GateOutcome or a bare bool from a gate callable.

normalize_gate_outcome(value: GateOutcome | bool) -> GateOutcome

Release source · Runtime guarantees · Capability guides

from cayu.workflows import ParallelResult

Outcomes of a parallel fan-out, in submission order.

Decorators: @dataclass(frozen=True, slots=True).

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
results tuple[StepResult | StepFailure, ...] ()
ParallelResult.successes() -> tuple[StepResult, ...]
ParallelResult.failures() -> tuple[StepFailure, ...]
ParallelResult.ok() -> bool
ParallelResult.raise_for_failures() -> None

Raise ParallelStepError if any branch failed; else no-op.

ParallelResult.outputs() -> tuple[Any, ...]

Validated outputs in order; raises if any branch failed.

Release source · Runtime guarantees · Capability guides

from cayu.workflows import ParallelStepError

Raised by the fail-closed ParallelResult accessors when branches failed.

Bases: Exception.

ParallelStepError.__init__(failures: Iterable[StepFailure]) -> None

Release source · Runtime guarantees · Capability guides

from cayu.workflows import StepError

A step failed and carries ids for correlation.

Bases: Exception.

StepError.__init__(message: str, *, step_id: str | None=None, session_id: str | None=None, evidence: FailureEvidence | None=None, workflow_attempt_id: str | None=None) -> None
StepError.evidence() -> FailureEvidence

Structured snapshot, including a direct exception cause when present.

Release source · Runtime guarantees · Capability guides

from cayu.workflows import StepFailure

A failed parallel branch.

Decorators: @dataclass(frozen=True, slots=True).

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
error str required
error_type str required
step_id str | None None
session_id str | None None
evidence FailureEvidence field(default_factory=FailureEvidence)
workflow_attempt_id str | None None

Release source · Runtime guarantees · Capability guides

from cayu.workflows import StepResult

Outcome of one successful step.

Decorators: @dataclass(frozen=True, slots=True).

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
step_id str required
session_id str required
text str ''
output Any None
StepResult.has_output() -> bool

Release source · Runtime guarantees · Capability guides