Workflows are a UI-based tool in Foundry used to create predefined, declarative sequences of actions, including agents. This lets you build intelligent automation systems that visually blend AI agents with business processes.
Prerequisites
- An Azure account with an active subscription
- A project in Microsoft Foundry
Create a Sequential Workflow
Sequential workflows are used for step-by-step processes by passing the result from one agent to the next in a defined order.
- Sign in to Microsoft Foundry. Ensure the "New Foundry" toggle is activated.
- Select "Build" in the upper-right navigation.
- Select "Create new workflow" and choose the "Sequential" option.
- Assign an agent to the agent nodes. Select each node and choose an existing agent or create a new one.
- IMPORTANT: Select "Save" in the visualizer when you make changes - workflows are NOT saved automatically!
- Select "Run Workflow" to test.
- Interact with the workflow using the chat window.
Workflow Patterns
Sequential
Passes the result from one agent to the next in a defined order.
Use Case: Step-by-step workflows, pipelines, multi-stage processingGroup Chat
Dynamically passes control between agents based on context or rules.
Use Case: Dynamic workflows, escalation, fallback, or expert handoff scenariosHuman in the Loop
Asks the user a question and awaits user input to proceed.
Use Case: Approval requests during workflow execution, obtaining information from the userNode Types
Configuring Structured Output
You can configure an Invoke agent node to output in a structured format like JSON Schema.
- Create an Invoke agent node
- In the configuration window, select "Details"
- Select the parameter icon and choose "JSON Schema" as the Text Format
- Paste your desired JSON Schema
- Save, then go to "Action settings" to save the output to a variable
{
"name": "math_response",
"schema": {
"type": "object",
"properties": {
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"explanation": {"type": "string"},
"output": {"type": "string"}
}
}
},
"final_answer": {"type": "string"}
}
},
"strict": true
}
Creating Complex Logic with Power Fx
Power Fx is a low-code language that uses Excel-like formulas to create complex logic.
Variable Prefixes
| Scope | Prefix | Examples |
|---|---|---|
| System variables | System. | System.Conversation.Id, System.LastMessage.Text, System.User.Language |
| Local variables | Local. | Local.CustomerName, Local.Amount, Local.ApprovalStatus |
Example: Output Customer Name in Capital Letters
- Create a workflow and add an "Ask a question" node
- Enter message: "What is your name?"
- Save response to variable Var01
- Add a "Send message" action
- Enter Power Fx expression: {Upper(Local.Var01)}
- Preview and test the workflow