Expand description
Workflow runtime for executing durable workflows.
This crate provides the execution engine that drives sayiir_core workflows
to completion. It re-exports the core crate, persistence layer, and proc-macros
so most users only need a single dependency:
[dependencies]
sayiir-runtime = "0.1"§Execution Strategies
| Scenario | Use |
|---|---|
| Single server, crash recovery needed | CheckpointingRunner |
| Multiple workers, horizontal scaling | PooledWorker |
| Simple in-memory execution | InProcessRunner |
§Quick Example
use sayiir_runtime::{CheckpointingRunner, WorkflowRunner, workflow, task};
use sayiir_runtime::persistence::InMemoryBackend;
let backend = InMemoryBackend::new();
let runner = CheckpointingRunner::new(backend);
// Run a workflow with automatic checkpointing
// let status = runner.run(&workflow, "instance-123", input).await?;§Re-exports
This crate re-exports key items for convenience:
sayiir_core— viasayiir_runtime::persistence(throughsayiir_persistence)sayiir_persistence— aspersistencetaskandworkflow!— fromsayiir-macrossayiir_ctx!— context macro fromsayiir-core
For the full README with architecture diagrams and detailed configuration, see the crate README.
Re-exports§
pub use error::RuntimeError;pub use execution::ResumeOutcome;pub use execution::execute_continuation_async;pub use execution::execute_continuation_sync;pub use execution::execute_continuation_with_checkpointing;pub use execution::finalize_execution;pub use execution::prepare_resume;pub use execution::prepare_run;pub use execution::serialize_branch_results;pub use worker::PooledWorker;pub use worker::WorkerHandle;pub use worker::WorkflowRegistry;pub use sayiir_persistence as persistence;
Modules§
- error
- Typed error for the sayiir runtime layer.
- execution
- Shared workflow execution logic.
- prelude
- Convenience re-exports for common usage.
- serialization
- worker
- Pooled worker for distributed, multi-worker workflow execution.
Macros§
- sayiir_
ctx - Macro to access the workflow context from within a task.
- workflow
- Builds a workflow pipeline with a concise DSL.
Structs§
- Checkpointing
Runner - A single-process workflow runner with checkpointing for crash recovery.
- InProcess
Runner - A workflow runner that executes workflows in-process.
Traits§
- Workflow
Runner - A trait for executing workflows.
Attribute Macros§
- task
- Transforms an async function into a
CoreTaskimplementation.