BUILD WITH WORKFLOWS
Workflows
Coordinate agent steps in C# with explicit success and failure transitions.
Use a workflow when the application needs a defined sequence of agent executions. Each step selects an agent type and declares where execution goes next.
Workflows are optional. An agent can use tools or RAG without belonging to a workflow.
Define the path in code
The definition type is Flow. Register it with AddRuniqWorkflows(...) and execute it through IFlowRunner.
Understand execution
| Part | Responsibility |
|---|---|
Flow | Name the process and hold its steps. |
Step<TAgent> | Select a registered agent by CLR type. |
| Success transition | Select the next step after success. |
| Failure transition | Stop or select a continuation or fallback. |
RunResult | Report overall and individual step outcomes. |
Steps run sequentially. Successful output becomes the next input. Explicit routing does not make model responses deterministic.
Follow the guides
| Guide | Outcome |
|---|---|
| Defining workflows | Create and register a two-step flow. |
| Host application | Place registration and application responsibilities. |
| Running workflows | Execute a flow and interpret results. |
| Failure handling | Choose recovery behavior. |
| Studio testing | Inspect definition and execution. |
| Patterns | Design explicit handoffs. |