mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
f25e81701d
* Add Python parity for HttpRequestAction in declarative workflow * Ran pyupgrade and pright to fix CI issues * Fix conversation ID dot parsing for http executor * Removed unnecessary export command * Initial implementation of invoke mcp tool in python * Update sample to support require approval to be toggled by environment variable. * Fix cache and PR comments * Update python/samples/03-workflows/declarative/invoke_mcp_tool/main.py Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com> --------- Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
f25e81701d
ยท
2026-05-05 20:16:03 +00:00
History
Declarative Workflows
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.
Prerequisites
pip install agent-framework-declarative
Running Samples
Each 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.py
Workflow Structure
A 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.greeting
Action Types
Variable Actions
SetValue- Set a variable in stateSetVariable- Set a variable (.NET style naming)AppendValue- Append to a listResetVariable- Clear a variable
Control Flow
If- Conditional branchingSwitch- Multi-way branchingForeach- Iterate over collectionsRepeatUntil- Loop until conditionGotoAction- Jump to labeled action
Output
SendActivity- Send text/attachments to userEmitEvent- Emit custom events
Agent Invocation
InvokeAzureAgent- Call an Azure AI agentInvokePromptAgent- Call a local prompt agent
Tool Invocation
InvokeFunctionTool- Call a registered Python function
Human-in-Loop
Question- Request user inputWaitForInput- Pause for external input