Skip to content

cayu.workflows.base

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 Workflow

Deterministic or agent-assisted multi-step orchestration.

Bases: ABC.

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
spec WorkflowSpec required
Workflow.run(session_id: str) -> AsyncIterator[Event]

Run the workflow and return a stream of structured events.

Declared non-async on purpose: implementations are expected to be async generators (async def run(...): yield ...), which are plain callables returning an AsyncIterator. Keeping the abstract method non-async gives every implementation the same calling convention — async for event in workflow.run(session_id) — instead of some callers needing await workflow.run(...) first.

Release source · Runtime guarantees · Capability guides

from cayu.workflows import WORKFLOW_ATTEMPT_EVENT_TYPE
WORKFLOW_ATTEMPT_EVENT_TYPE = 'custom.cayu.workflow.attempt'

Release source · Runtime guarantees · Capability guides

from cayu.workflows import WorkflowSpec

Bases: BaseModel.

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
name str required
metadata dict[str, Any] Field(default_factory=dict)
WorkflowSpec.copy_metadata(value: dict[str, Any]) -> dict[str, Any]
WorkflowSpec.validate_nonblank_name(value: str, info) -> str

Release source · Runtime guarantees · Capability guides