| title | Create Autonomous AI Agentic Workflows |
|---|---|
| description | Build autonomous agentic workflows that use AI agent loops and LLMs to complete tasks without human interactions in Azure Logic Apps. |
| services | logic-apps |
| ms.suite | integration |
| ms.reviewers | estfan, divswa, krmitta, LogicApps |
| ms.topic | how-to |
| ms.collection | ce-skilling-ai-copilot |
| ms.date | 02/12/2026 |
| ms.update-cycle | 180-days |
[!INCLUDE logic-apps-sku-consumption-standard]
When you need AI-powered automation that runs independently, create autonomous agentic workflows in Azure Logic Apps. These workflows use agent loops and large language models (LLMs) to iteratively process, make decisions, and complete tasks without human intervention. These workflows work well for automation that might run a long time, require stronger governance, isolation, or can support automated rollback or compensation strategies.
The following example workflow uses an autonomous agent loop to get the current weather and send email notifications:
:::image type="content" source="media/create-autonomous-agent-workflows/weather-example.png" alt-text="Screenshot shows the Azure portal, workflow designer, and example autonomous agentic workflow." lightbox="media/create-autonomous-agent-workflows/weather-example.png":::
This guide shows how to create a Consumption or Standard logic app that uses the Autonomous Agents workflow type. This workflow runs without human interaction and uses tools that you build to complete tasks. For a high-level overview about agentic workflows, see AI agentic workflows in Azure Logic Apps.
Important
Consumption autonomous agentic workflows are in preview and subject to the Supplemental Terms of Use for Microsoft Azure Previews.
Based on whether you want to create a Consumption or Standard logic app, the following prerequisites apply:
-
An Azure account and subscription. Get a free Azure account.
-
A Consumption logic app resource that uses the workflow type named Autonomous Agents. See Create Consumption logic app workflows in the Azure portal.
[!NOTE]
You can use only the Azure portal to build autonomous agentic workflows, not Visual Studio Code.
Consumption autonomous agentic workflows don't require that you manually set up a separate AI model. Your workflow automatically includes an Agent action that uses an Azure OpenAI Service model hosted in Microsoft Foundry. Consumption autonomous agentic workflows support only specific models, which depend on your logic app region. For more information, see Supported models.
-
An Azure account and subscription. Get a free Azure account.
-
A Standard logic app resource or project, based on your development experience:
Experience Requirement Azure portal A Standard logic app resource. See Create Standard workflows in the Azure portal. Visual Studio Code A Standard logic app project. See Create Standard workflows in Visual Studio Code. Make sure you have the latest Azure Logic Apps extension. [!NOTE]
The steps to set up autonomous agentic workflows are mostly the same for both Azure portal and Visual Studio Code. The examples in this guide show the instructions for each experience where the process differs.
-
One of the following AI model sources:
[!NOTE]
Agentic workflows support only specific models. For more information, see Supported models.
Model source Description Azure OpenAI An Azure OpenAI Service resource with a deployed Azure OpenAI Service model.
You need the resource name when you connect from the Agent action in your workflow to the deployed AI model in Azure OpenAI Service.
For more information, see:
- Create and deploy an Azure OpenAI Service resource
- Deploy a modelFoundry Agent Service (Preview) A Foundry project connected to a deployed Azure OpenAI model in Foundry
Note: Make sure that you have a Foundry project, not a Hub based project.
For more information, see:
- Create and deploy an Azure OpenAI Service resource
- Create a project for Foundry
- Connect Foundry Tools after you create a project
- Create a new connection in Foundry portal
- Deploy a modelAPIM Gen AI Gateway (Preview) An Azure API Management account with the LLM API to use.
For more information, see:
- AI gateway in Azure API Management
- Import a Foundry API
- Import an Azure OpenAI API -
The authentication to use when you connect the Agent action to your AI model.
Foundry projects require that you use managed identity authentication.
-
Managed identity authentication
This connection supports authentication using Microsoft Entra ID with a managed identity. In production scenarios, Microsoft strongly recommends that you use a managed identity when possible. This option provides optimal and superior security at no extra cost. Azure manages this identity for you, so you don't have to provide or manage sensitive information such as credentials or secrets. This information isn't even accessible to individual users. You can use managed identities to authenticate access for any resource that supports Microsoft Entra authentication.
To use managed identity authentication, your Standard logic app resource must enable the system-assigned managed identity. By default, the system-assigned managed identity is enabled on a Standard logic app. This release currently doesn't support using the user-assigned managed identity.
[!NOTE]
If the system-assigned identity is disabled, reenable the identity.
The system-assigned identity requires one of the following roles for Microsoft Entra role-based access control (RBAC), based on the principle of least privilege:
Model source Role Azure OpenAI Service resource - Cognitive Services OpenAI User (least privileged)
- Cognitive Services OpenAI ContributorFoundry project Azure AI User For more information about managed identity setup, see:
-
URL and key-based authentication
This connection supports authentication by using the endpoint URL and API key for your AI model. However, you don't have to manually find these values before you create the connection. The values automatically appear when you select your model source.
[!IMPORTANT]
Use this authentication option only for the examples in this guide, exploratory scenarios, nonproduction scenarios, or if your organization's policy specifies that you can't use managed identity authentication.
In general, make sure that you secure and protect sensitive data and personal data, such as credentials, secrets, access keys, connection strings, certificates, thumbprints, and similar information by using the highest available or supported level of security. Don't hardcode sensitive data, share with other users, or save in plain text anywhere that others can access. Set up a plan to rotate or revoke secrets if they become compromised.
For more information, see:
-
-
To follow along with the examples, you need an email account to send email.
The examples in this guide use an Outlook.com account. For your own scenarios, you can use any supported email service or messaging app in Azure Logic Apps, such as Office 365 Outlook, Microsoft Teams, Slack, and so on. The setup for other email services or apps is similar to the examples, but has minor differences.
[!INCLUDE supported-models]
[!INCLUDE billing-agent-workflows]
The following table describes current limitations and known issues in this release, based on your logic app resource type.
| Logic app | Limitations or known issues |
|---|---|
| Both | To create tools for your agent, the following limitations apply: - You can add only actions, not triggers. - A tool must start with an action and always contains at least one action. - A tool works only inside the agent loop where that tool exists. - Control flow actions aren't supported. |
| Consumption | - You can create Consumption agentic workflows only in the Azure portal, not Visual Studio Code. - The AI model that your Agent action uses can come from any region, so data residency for a specific region isn't guaranteed for data that the model handles. - The Agent action is throttled based on the number of tokens used. |
| Standard | - Unsupported workflow types: Stateless Note: Foundry projects require that you use managed identity authentication. - For general limits in Azure OpenAI Service, Foundry, and Azure Logic Apps, see: - Azure OpenAI Service quotas and limits - Azure OpenAI in Foundry Models quotas and limits - Azure Logic Apps limits and configuration |
The following section shows how to start creating your autonomous agentic workflow.
The Autonomous Agents workflow type creates a partial workflow that starts with the Request trigger. The workflow also includes an empty Default Agent action.
To open this partial workflow, follow these steps:
-
In the Azure portal, open your Consumption logic app resource.
-
On the resource sidebar, under Development Tools, select the designer to open the partial agentic workflow.
The designer shows a partial workflow with the trigger named When an HTTP request is received. Under the trigger, an empty Agent action named Default Agent appears. For this scenario, you don't need any other trigger setup.
:::image type="content" source="media/create-autonomous-agent-workflows/agent-workflow-start-consumption.png" alt-text="Screenshot shows workflow designer with a Request trigger and an empty Default Agent action." lightbox="media/create-autonomous-agent-workflows/agent-workflow-start-consumption.png":::
-
Continue to the next section to set up your agent loop.
Based on the development experience that you use, start by creating a new workflow.
To create a workflow with an empty Agent action, follow these steps:
-
In the Azure portal, open your Standard logic app resource.
-
On the resource sidebar, under Workflows, select Workflows.
-
On the Workflows page toolbar, select Create > Create.
-
On the Create workflow pane, complete the following steps:
-
For Workflow name, enter a name for your workflow.
-
Select Autonomous Agents > Create.
:::image type="content" source="media/create-autonomous-agent-workflows/select-autonomous-agents.png" alt-text="Screenshot shows Standard logic app with open Workflows page and Create workflow pane with workflow name, selected Autonomous Agents option, and Create button." lightbox="media/create-autonomous-agent-workflows/select-autonomous-agents.png":::
The designer opens and shows a partial workflow, which includes an empty Agent action that you need to set up later.
:::image type="content" source="media/create-autonomous-agent-workflows/agent-workflow-start-standard.png" alt-text="Screenshot shows workflow designer with Add a trigger and empty Agent action." lightbox="media/create-autonomous-agent-workflows/agent-workflow-start-standard.png":::
Before you can save your workflow, you must complete the following setup tasks for the Agent action:
-
Connect the Agent action loop to your AI model. You complete this task in a later section.
-
Provide instructions that use natural language to describe the roles that the agent loop plays, the tasks that the agent loop can perform, and other information to help the agent loop better understand how to operate. You also complete this task in a later section.
-
-
Add a trigger to your workflow.
Your workflow requires a trigger to control when the workflow starts running. You can use any trigger that fits your scenario. For more information, see Triggers.
-
On the designer, select Add trigger.
-
On the Add a trigger pane, follow these general steps to add the best trigger for your scenario.
This example uses the Request trigger named When an HTTP request is received. For this article, you don't need any other trigger setup.
:::image type="content" source="media/create-autonomous-agent-workflows/request-trigger.png" alt-text="Screenshot shows workflow designer with Request trigger and Agent action." lightbox="media/create-autonomous-agent-workflows/request-trigger.png":::
-
-
Skip the next section so you can set up your agent loop with an AI model.
-
In Visual Studio Code, open the workspace for your Standard logic app project.
-
On the Activity Bar, select the files icon, which opens the Explorer window to show your project.
-
In the Explorer window, from your project folder shortcut menu, select Create workflow.
-
Select the workflow template named Autonomous agent.
-
Enter a name for your workflow, and press Enter.
A new workflow folder now appears in your project. This folder contains a workflow.json file, which contains the workflow's underlying JSON definition.
-
From the workflow.json file's shortcut menu, select Open designer.
The designer opens and shows a partial workflow that starts with the Add trigger prompt and an empty Default Agent action that you need to set up later.
:::image type="content" source="media/create-autonomous-agent-workflows/workflow-start-standard-visual-studio-code.png" alt-text="Screenshot shows workflow designer with Add trigger prompt and an empty Default Agent action." lightbox="media/create-autonomous-agent-workflows/workflow-start-standard-visual-studio-code.png":::
-
Continue to the next section to set up your agent loop.
If you have an existing Stateful workflow, you can add an Agent action to include autonomous agentic loop and LLM capabilities by following these steps:
-
In the designer, open your Stateful workflow.
-
Follow the general steps to add an action named Agent to your workflow.
Alternatively, you can select Add an agent, rather than Add an action, for example:
:::image type="content" source="media/create-autonomous-agent-workflows/add-agent.png" alt-text="Screenshot shows designer with classic stateful workflow, and option to add an agent." lightbox="media/create-autonomous-agent-workflows/add-agent.png":::
-
Continue with the next section to set up your agent loop with an AI model.
Note
If you try to save the workflow now, you get an error that workflow validation failed.
In a Standard workflow, the designer toolbar also shows a red dot on the Errors button. The designer alerts you to this error condition because the agent loop requires setup before you can save any changes. However, you don't have to set up the agent loop now. You can continue to create your workflow. Just remember to set up the agent loop before you save your workflow.
:::image type="content" source="media/create-autonomous-agent-workflows/error-missing-agent-settings.png" alt-text="Screenshot shows workflow designer toolbar and Errors button with red dot and error in the agent action information pane." lightbox="media/create-autonomous-agent-workflows/error-missing-agent-settings.png":::
To set up or view the AI model for your agent loop, follow the steps based on your logic app type:
By default, your agent loop automatically uses the Azure OpenAI model available in your logic app's region. Some regions support gpt-4o-mini, while others support gpt-5o-mini.
To view the model that your agent loop uses, follow these steps:
-
On the designer, select the title bar on the Default Agent action to open the information pane.
-
On the Parameters tab, the Model Id parameter shows the Azure OpenAI model that the workflow uses, for example:
:::image type="content" source="media/create-autonomous-agent-workflows/connected-model-consumption.png" alt-text="Screenshot shows Consumption workflow and agent loop with Azure OpenAI model." lightbox="media/create-autonomous-agent-workflows/connected-model-consumption.png":::
-
Continue to the next section to rename the agent loop.
-
On the designer, select the title bar on the Agent action to open the Create connection pane.
This pane opens only if you don't have an existing working connection.
-
In the Create a new connection section, provide the following information:
Parameter Required Value Description Connection Name Yes <connection-name> The name to use for the connection to your AI model.
This example uses fabrikam-azure-ai-connection.Agent Model Source Yes - Azure OpenAI
- Foundry Agent ServiceThe source for the AI model. Authentication Type Yes - Managed identity
- URL and key-based authenticationThe authentication type to use for validating and authorizing an identity's access to your AI model.
Note: For Foundry projects, you must use managed identity authentication.
- Managed identity requires that your Standard logic app have a managed identity enabled and set up with the required roles for role-based access. For more information, see Prerequisites.
- URL and key-based authentication requires the endpoint URL and API key for your AI model. These values automatically appear when you select your model source.
Important: For the examples and exploration only, you can use URL and key-based authentication. For production scenarios, use Managed identity.Subscription Yes <Azure-subscription> Select the Azure subscription associated with your Azure OpenAI Service resource. Azure OpenAI Resource Yes, only when Agent Model Source is Azure OpenAI <Azure-OpenAI-Service-resource-name> Select your Azure OpenAI Service resource. Foundry Project Yes, only when Agent Model Source is Foundry Agent Service <Azure-AI-Foundry-project-name> Select your project in Foundry.
Note: If you recently assigned the necessary role on your project, you might experience a delay before role permissions take effect. Meanwhile, an error message appears that you don't have correct permissions on the project.Azure API Management Service (preview) Yes, only when Agent Model Source is APIM Gen AI Gateway. <API-Management-account> Select your Azure API Management account. Azure API Management Service APIs Yes, only when Agent Model Source is APIM Gen AI Gateway. <API-Management-LLM-API> Select your LLM API in Azure API Management. API Endpoint Yes Automatically populated The endpoint URL for your AI model in Azure OpenAI Service.
This example useshttps://fabrikam-azureopenai.openai.azure.com/.API Key Yes, only when Authentication Type is URL and key-based authentication Automatically populated The API key for your AI model in Azure OpenAI Service. For example, if you select Azure OpenAI as your model source and Managed identity for authentication, your connection information looks like the following sample:
:::image type="content" source="media/create-autonomous-agent-workflows/connection-azure-openai.png" alt-text="Screenshot shows example connection details for a deployed model in Azure OpenAI Service." lightbox="media/create-autonomous-agent-workflows/connection-azure-openai.png":::
If you select Foundry Agent Service as your model source with Managed identity for authentication, your connection information looks like the following sample:
:::image type="content" source="media/create-autonomous-agent-workflows/connection-ai-foundry.png" alt-text="Screenshot shows example connection details for a deployed model in Foundry." lightbox="media/create-autonomous-agent-workflows/connection-ai-foundry.png":::
-
When you're done, select Create new.
The Agent action information pane now shows the connected AI model, for example:
:::image type="content" source="media/create-autonomous-agent-workflows/connected-model-standard.png" alt-text="Screenshot shows example connected AI model." lightbox="media/create-autonomous-agent-workflows/connected-model-standard.png":::
If you want to create a different connection, on the Parameters tab, scroll down to the bottom, and select Change connection.
[!NOTE]
If the connection to your model is incorrect, the AI Model list appears unavailable.
-
Continue to the next section to rename the agent.
Update the agent loop name to clearly identify the agent's purpose by following these steps:
-
On the designer, select the agent action title bar to open the information pane.
-
On the information pane, select the agent loop name, and enter the new name, such as
Weather agent.:::image type="content" source="media/create-autonomous-agent-workflows/rename-agent.png" alt-text="Screenshot shows workflow designer, workflow trigger, and renamed agent." lightbox="media/create-autonomous-agent-workflows/rename-agent.png":::
-
Continue to the next section to provide instructions for the agent loop.
The agent loop requires instructions that describe the roles that the agent loop can play and the tasks that the agent loop can perform. To help the agent loop learn and understand these responsibilities, you can also include the following information:
- Workflow structure
- Available actions
- Any restrictions or limitations
- Interactions for specific scenarios or special cases
For the best results, provide prescriptive instructions and be prepared to iteratively refine your instructions.
-
In the Instructions for agent box, enter the instructions that the agent loop needs to understand its role and tasks.
For this example, the weather agent example uses the following sample instructions where you later provide a subscriber list with your own email address for testing:
You're an AI agent that generates a weather report, which you send in email to each subscriber on a list. This list includes each subscriber's name, location, and email address to use. Format the weather report with bullet lists where appropriate. Make your response concise and useful, but use a conversational and friendly tone. You can include suggestions like "Carry an umbrella" or "Dress in layers".Here's an example:
:::image type="content" source="media/create-autonomous-agent-workflows/weather-agent-instructions.png" alt-text="Screenshot shows workflow designer and agent loop instructions." lightbox="media/create-autonomous-agent-workflows/weather-agent-instructions.png":::
-
Optionally, provide user instructions that the agent loop uses as prompts.
For the best results, make each user instruction focus on a specific task, for example:
-
On the agent loop information pane, under the User instructions section, in the User instructions Item - 1 box, enter the prompt for the agent loop.
-
To add another instruction, select Add new item.
-
In the User instructions item - 2 box, enter another prompt for the agent loop.
-
Repeat until you finish adding all the prompts that you want.
-
-
On the designer toolbar, select Save.
To make sure your workflow doesn't have errors at this stage, follow these steps:
-
On the designer toolbar, select Run > Run.
-
On the workflow sidebar, under Development Tools, select Run history.
-
On the Run history page, in the runs table, select the latest workflow run.
[!NOTE]
If the page doesn't show any runs, on the toolbar, select Refresh.
If the Status column shows a Running status, the agentic workflow is still working.
The monitoring view opens and shows the workflow operations with their status. The Agent log pane is open and shows the agent loop instructions that you provided earlier. The pane also shows the agent loop's response.
:::image type="content" source="media/create-autonomous-agent-workflows/agent-only-test-consumption.png" alt-text="Screenshot shows monitoring view for Consumption workflow, operation status, and agent log." lightbox="media/create-autonomous-agent-workflows/agent-only-test-consumption.png":::
The agent loop doesn't have any tools to use at this time, which means that the agent loop can't actually take any specific actions, such as send email to a subscriber list, until you create tools that the agent loop needs to complete tasks.
-
Return to the designer. On the monitoring view toolbar, select Edit.
-
On the designer toolbar, select Run > Run.
-
On the workflow sidebar, under Tools, select Run history.
-
On the Run history page, on the Run history tab, select the latest workflow run.
[!NOTE]
If the page doesn't show any runs, on the toolbar, select Refresh.
If the Status column shows a Running status, the agentic workflow is still working.
The monitoring view opens and shows the workflow operations with their status. The Agent log pane is open and shows the agent loop instructions that you provided earlier.
:::image type="content" source="media/create-autonomous-agent-workflows/agent-only-test-standard.png" alt-text="Screenshot shows monitoring view for Standard workflow, operation status, and agent log." lightbox="media/create-autonomous-agent-workflows/agent-only-test-standard.png":::
The agent loop doesn't have any tools to use at this time, which means that the agent loop can't actually take any specific actions, such as send email to a subscriber list, until you create tools that the agent loop needs to complete tasks.
-
Return to the designer. On the monitoring view toolbar, select Edit.
-
In the Explorer window for your logic app project, expand the folder that has the workflow name, and go to the workflow.json file.
-
From the file shortcut menu, select Overview. Press F5 to start a debugging session.
-
After a run completes, under Run history, select the latest workflow run.
[!NOTE]
If the page doesn't show any runs, on the toolbar, select Refresh.
If the Status column shows a Running status, the agentic workflow is still working.
The monitoring view opens and shows the workflow operations with their status. The Agent log pane is open and shows the agent loop instructions that you provided earlier. The pane also shows the agent loop's response.
However, the agent loop doesn't have any tools to use at this time, which means that the agent loop can't actually take any specific actions, such as send email, until you create tools that the agent loop needs to complete their tasks. You might even get an email that your email server rejected the message.
-
On the debugging toolbar, select Disconnect to stop the debug session.
-
Return to the designer.
For an agent loop to run prebuilt actions available in Azure Logic Apps, you must create one or more tools for the agent loop to use. A tool must contain at least one action and only actions. The agent loop calls the tool by using specific arguments.
In this example, the agent loop needs a tool that gets the weather forecast. You can build this tool by following these steps:
-
On the designer, inside the agent loop and under Add tool, select the plus sign (+) to open the pane where you can browse available actions.
-
On the Add an action pane, follow the general steps for your logic app to add an action that's best for your scenario.
This example uses the MSN Weather action named Get current weather.
After you select the action, both the Tool container and the selected action appear in the agent action on the designer. Both information panes also open at the same time.
:::image type="content" source="media/create-autonomous-agent-workflows/added-tool-get-current-weather.png" alt-text="Screenshot shows workflow designer with the renamed agent loop, which contains a tool that includes the action named Get current weather." lightbox="media/create-autonomous-agent-workflows/added-tool-get-current-weather.png":::
-
On the tool information pane, rename the tool to describe its purpose. For this example, use
Get weather. -
On the Details tab, for Description, enter the tool description. For this example, use
Get the weather for the specified location.:::image type="content" source="media/create-autonomous-agent-workflows/get-weather-tool.png" alt-text="Screenshot shows completed Get weather tool with description." lightbox="media/create-autonomous-agent-workflows/get-weather-tool.png":::
Under Description, the Agent Parameters section applies only for specific use cases. For more information, see Create agent parameters.
-
Continue to the next section to learn more about agent parameters, their use cases, and how to create them, based on these use cases.
Actions usually have parameters that require you to specify the values to use. Actions in tools are almost the same except for one difference. You can create agent parameters that the agent loop uses to specify the parameter values for actions in tools. You can specify model-generated outputs, values from nonmodel sources, or a combination. For more information, see Agent parameters.
The following table describes the use cases for creating agent parameters and where to create them, based on the use case:
| To | Where to create agent parameter |
|---|---|
| Use model-generated outputs only. Share with other actions in the same tool. |
Start from the action parameter. For detailed steps, see Use model-generated outputs only. |
| Use nonmodel values. | No agent parameters needed. This experience is the same as the usual action setup experience in Azure Logic Apps but is repeated for convenience in Use values from nonmodel sources. |
| Use model-generated outputs with nonmodel values. Share with other actions in the same tool. |
Start from the tool, in the Agent Parameters section. For detailed steps, see Use model outputs and nonmodel values. |
For an action parameter that uses only model-generated outputs, create an agent parameter by following these steps:
-
In the tool, select the action to open the information pane.
For this example, the action is Get current weather.
-
On the Parameters tab, select inside the parameter box to show the parameter options.
-
On the right edge of the Location box, select the stars button.
This button has the following tooltip: Select to generate the agent parameter.
:::image type="content" source="media/create-autonomous-agent-workflows/generate-agent-parameter.png" alt-text="Screenshot shows an action with the mouse cursor inside a parameter box, parameter options, and the selected option to generate an agent parameter." lightbox="media/create-autonomous-agent-workflows/generate-agent-parameter.png":::
The Create agent parameter window shows the Name, Type, and Description fields, which are prepopulated from the source action parameter.
The following table describes the fields that define the agent parameter:
Parameter Value Description Name <agent-parameter-name> The agent parameter name. Type <agent-parameter-data-type> The agent parameter data type. Description <agent-parameter-description> The agent parameter description that easily identifies the parameter's purpose. [!NOTE]
Microsoft recommends that you follow the action's Swagger definition. For example, for the Get current weather action, which comes from the MSN Weather "shared" connector hosted and managed by global, multitenant Azure, see the MSN Weather connector technical reference article.
-
When you're ready, select Create.
The following example shows the Get current weather action with the Location agent parameter:
:::image type="content" source="media/create-autonomous-agent-workflows/get-current-weather-action.png" alt-text="Screenshot shows the Weather agent, Get weather tool, and selected action named Get current weather. The Location action parameter includes the created agent parameter." lightbox="media/create-autonomous-agent-workflows/get-current-weather-action.png":::
-
Save your workflow.
For an action parameter value that uses only nonmodel values, choose the option that best fits your use case:
Use outputs from earlier operations in the workflow
To browse and select from these outputs, follow these steps:
-
Select inside the parameter box, and then select the lightning icon to open the dynamic content list.
-
From the list, in the trigger or action section, select the output that you want.
-
Save your workflow.
Use results from expressions
To create an expression, follow these steps:
-
Select inside the parameter box, and then select the function icon to open the expression editor.
-
Select from available functions to create the expression.
-
Save your workflow.
For more information, see Reference guide to workflow expression functions in Azure Logic Apps.
Some scenarios might need to specify an action parameter value that uses both model-generated outputs with nonmodel values. For example, you might want to create an email body that uses static text, nonmodel outputs from earlier operations in the workflow, and model-generated outputs.
For these scenarios, create the agent parameter on the tool by following these steps:
-
On the designer, select the tool where you want to create the agent parameter.
-
On the Details tab, under Agent Parameters, select Create Parameter.
-
Expand New agent parameter, and provide the following information, but match the action parameter details.
For this example, the example action is Get current weather.
[!NOTE]
Microsoft recommends that you follow the action's Swagger definition. For example, to find this information for the Get current weather action, see the MSN Weather connector technical reference article. The example action is provided by the MSN Weather managed "shared" connector, which is hosted and run in global, multitenant Azure.
Parameter Value Description Name <agent-parameter-name> The agent parameter name. Type <agent-parameter-data-type> The agent parameter data type. Description <agent-parameter-description> The agent parameter description that easily identifies the parameter's purpose. You can choose from the following options or combine them to provide a description:
- Plain literal text with details such as the parameter's purpose, permitted values, restrictions, or limits.
- Outputs from earlier operations in the workflow. To browse and choose these outputs, select inside the Description box, and then select the lightning icon to open the dynamic content list. From the list, select the output that you want.
- Results from expressions. To create an expression, select inside the Description box, and then select the function icon to open the expression editor. Select from available functions to create the expression.When you're done, under Agent Parameters, the new agent parameter appears.
-
On the designer, in the tool, select the action to open the action information pane.
-
On the Parameters tab, select inside the parameter box to show the parameter options, and then select the robot icon.
-
From the Agent parameters list, select the agent parameter that you defined earlier.
The finished Get current weather tool looks like the following example:
:::image type="content" source="media/create-autonomous-agent-workflows/get-weather-tool-complete.png" alt-text="Screenshot shows agent and finished Get weather tool." lightbox="media/create-autonomous-agent-workflows/get-weather-tool-complete.png":::
-
Save your workflow.
For many scenarios, an agent loop needs more than one tool. In this example, the agent loop needs a tool that sends the weather report in email.
To build this tool, follow these steps:
-
On the designer, in the agent action, next to the existing tool, select the plus sign (+) to add an action.
-
On the Add an action pane, follow these general steps to select another action for your new tool.
This example uses the Outlook.com action named Send an email (V2).
Like before, after you select the action, both the new Tool and action appear inside the agent action on the designer. Both information panes open at the same time.
:::image type="content" source="media/create-autonomous-agent-workflows/added-tool-send-email.png" alt-text="Screenshot shows workflow designer with Weather agent, Get weather tool, and new tool with action named Send an email (V2)." lightbox="media/create-autonomous-agent-workflows/added-tool-send-email.png":::
-
On the tool information pane, rename the tool to describe its purpose. For this example, use
Send email. -
On the Details tab, for Description, enter the tool description. For this example, use
Send current weather by email.:::image type="content" source="media/create-autonomous-agent-workflows/send-email-tool.png" alt-text="Screenshot shows completed Send email tool with description." lightbox="media/create-autonomous-agent-workflows/send-email-tool.png":::
-
Save your workflow.
Except for the different agent parameters to set up for the Send an email (V2) action, the steps in this section are nearly the same as Create agent parameters for the 'Get current weather' action.
-
Follow the earlier general steps to create agent parameters for the parameter values in the Send an email (V2) action.
The action needs three agent parameters named To, Subject, and Body. For the action's Swagger definition, see Send an email (V2).
When you're done, the example action uses the previously defined agent parameters as shown in the following image:
:::image type="content" source="media/create-autonomous-agent-workflows/send-email-action.png" alt-text="Screenshot shows the information pane for the action named Send an email V2, plus the previously defined agent parameters named To, Subject, and Body." lightbox="media/create-autonomous-agent-workflows/send-email-action.png":::
The finished Send email tool looks like the following example:
:::image type="content" source="media/create-autonomous-agent-workflows/send-email-tool-complete.png" alt-text="Screenshot shows the agent and finished Send email tool." lightbox="media/create-autonomous-agent-workflows/send-email-tool-complete.png":::
-
Save your workflow.
Finally, create a tool named Get subscribers to provide a subscriber list for the agent parameter values to use. This tool uses the Compose action to supply the subscriber name, email address, and location. Or, you might source these inputs from blob storage or a database. Azure Logic Apps offers many options that you can use as data sources.
For this example, follow these steps:
-
Rename the tool to
Get subscribers. -
In the Get subscribers tool, use the following description:
Get the list of subscribers, including their name, location, and email address. To generate the weather report, use the location for each subscriber. To send the weather report, use the email address for each subscriber. -
Rename the Compose action to
Subscriber list. In the Input box, use the following JSON array but replace the sample subscriber data with the data that you want to use for testing. For example, replace the email addresses with your own so you get the weather for different locations.[ { "Name": "Fabrikam", "Email": "[email protected]", "Location": "Boston" }, { "Name": "Contoso", "Email": "[email protected]", "Location": "Jaipur" }, { "Name": "Sophie Owen", "Email": "[email protected]", "Location": "Seattle" } ]The finished Get subscribers tool looks like the following example:
:::image type="content" source="media/create-autonomous-agent-workflows/get-subscribers-tool-complete.png" alt-text="Screenshot shows the agent action and finished Get subscribers tool." lightbox="media/create-autonomous-agent-workflows/get-subscribers-tool-complete.png":::
-
Save your workflow, then test the workflow to make sure everything works the way that you expect.
You should get an email with the weather for each location.
[!INCLUDE best-practices-agent-workflows]
[!INCLUDE troubleshoot-agent-workflows]
[!INCLUDE clean-up-resources]