Skip to main content

rig_compose/
workflow.rs

1//! [`Workflow`] — composes one or more [`super::Agent`]s into a higher-level
2//! orchestration unit (e.g. the Overseer's block-stream pump, or the
3//! Phase-5 coordinator/specialist routing).
4//!
5//! Workflows are intentionally generic: their `Input` and `Output` types
6//! are associated, so each concrete workflow defines its own contract.
7
8use async_trait::async_trait;
9
10use crate::registry::KernelError;
11
12#[async_trait]
13pub trait Workflow: Send + Sync {
14    type Input: Send;
15    type Output: Send;
16
17    fn name(&self) -> &str;
18
19    async fn run(&self, input: Self::Input) -> Result<Self::Output, KernelError>;
20}