Agent Flow • Rust AI Agent SDK
AgentFlow: AgentFlow – Workflow definition with patterns Defines complex workflow patterns like Route, Parallel, Loop.
AgentFlow
Defined in the workflows module.
Rust AI Agent SDK
AgentFlow – Workflow definition with patterns Defines complex workflow patterns like Route, Parallel, Loop.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: AgentFlow"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffFields
| Name | Type | Description |
|---|---|---|
steps | Vec<FlowStep> | – |
Methods
new
fn new() -> SelfCreate a new workflow
step
fn step(mut self, step: FlowStep) -> SelfAdd a step
Parameters:
| Name | Type |
|---|---|
step | FlowStep |
agent
fn agent(self, agent: Agent) -> SelfAdd an agent step
Parameters:
| Name | Type |
|---|---|
agent | Agent |
run
async fn run(&self, input: &str) -> Result<String>Execute the workflow
Parameters:
| Name | Type |
|---|---|
input | &str |
Source
View on GitHubpraisonai/src/workflows/mod.rs at line 313