Declarative workflows allow you to define multi-agent orchestration patterns in YAML, including:
- Variable manipulation and state management
- Control flow (loops, conditionals, branching)
- Agent invocations
- Human-in-the-loop patterns
See the main workflows README for the list of available samples.
pip install agent-framework-declarativeEach sample directory contains:
workflow.yaml- The declarative workflow definitionmain.py- Python code to load and execute the workflowREADME.md- Sample-specific documentation
To run a sample:
cd <sample_directory>
python main.pyA basic workflow YAML file looks like:
name: my-workflow
description: A simple workflow example
actions:
- kind: SetValue
path: turn.greeting
value: Hello, World!
- kind: SendActivity
activity:
text: =turn.greetingSetValue- Set a variable in stateSetVariable- Set a variable (.NET style naming)AppendValue- Append to a listResetVariable- Clear a variable
If- Conditional branchingSwitch- Multi-way branchingForeach- Iterate over collectionsRepeatUntil- Loop until conditionGotoAction- Jump to labeled action
SendActivity- Send text/attachments to userEmitEvent- Emit custom events
InvokeAzureAgent- Call an Azure AI agentInvokePromptAgent- Call a local prompt agent
InvokeFunctionTool- Call a registered Python function
Question- Request user inputWaitForInput- Pause for external input