Defining workflows
Define deterministic agent workflows with Runiq's workflow DSL.
Define workflows as code and register them with AddRuniqWorkflows.
A workflow should describe a process your application owns. The travel sample uses weather, place research, and planning because those stages are easy to understand, but the same DSL is meant for product and enterprise flows where order, fallback, and auditability matter.
The travel planner sample keeps workflow definitions in a Workflows folder:
Example workflow
This workflow says:
- Start with
WeatherAgent. - If weather succeeds, run
PlacesAgent. - If weather fails, continue to
PlacesAgentanyway. - If places succeeds or fails, continue to
PlannerAgent. - Stop if the planner fails.
The important design choice is that these transitions live in C#, not in a prompt. Developers can review them, test them, version them, and align them with existing business rules. Agents still produce reasoning-heavy outputs, but the application controls which step runs next.
Register agents and workflow
The workflow references agent types, so those agents must also be registered with Runiq.
The workflow runtime resolves each step by the registered agent instance's CLR type.
Workflow validation
Runiq validates workflow definitions before registration and execution.
Validation checks include:
- workflow has at least one step,
- duplicate step ids are not allowed,
- success targets must point to known step ids,
- failure targets must point to known step ids.
Keep step ids stable and readable: