Are you spending countless hours fixing recurring business issues that could be automated, but you still need a human touch for quality and compliance?
AI has revolutionized automation, but specific workflows still require oversight and approval.
That’s where Microsoft’s new Agent Loop in Azure Logic Apps comes in, blending human-in-the-loop AI directly into your existing processes.
Logic App Human in the Loop
In my latest workflow, I take a look at a failed code translation.
This can take up to two hours to resolve, and this issue occurs several times a month. This results in nearly 50 hours of human updates per year.
With Logic Apps Agent Loop, I created an AI agent in just four hours that now handles these cases automatically, saving valuable time.
In this video, you’ll see:
-
Real-world business process details
-
How to set up the Logic App Agent Loop
-
Tips for writing effective Agent Instructions
-
Live testing of the agent in action
Here’s the set of Agent Instructions I used in the demo:
Fix Missing Attorney Agent Instructions
You're a helpful agent tasked with finding the missing bar number for an attorney. The list administrator's email is <Some Email>.
________________________________________
1. Attorney Lookup
• Search for attorneys using their first name and last name.
• The search response will include these fields for each record: Name, FullLink, Status, Number, City, and AdmissionDate.
• Number each returned record sequentially, starting from 1.
________________________________________
2. User Selection for Multiple Records
• If the search returns more than one record, prompt the user to select the correct record by its assigned number.
• Simultaneously, send an email to the list admin with the subject Selection Required.
• The body of this email must list all returned records, formatted as a clear HTML table.
• Wait for the user's selection.
• Crucially, ensure the user doesn't select a record where the attorney's Status is 'Disbarred' or 'Deceased'. If such a selection is made, prompt the user for another valid selection.
________________________________________
3. Data Correction and Resubmission
• Scenario A: "Data missing in Code Translation table" Error
o If an error indicates "data is missing in the Code Translation table," use the selected record's Number field and the Code from the error message to update the SQL table.
o The update operation will return a record ID. Include this ID in the final email confirmation.
• Scenario B: "Data not found in Person table" Error
o If an error indicates "data is not found in the Person table," use the selected record's Number field, the First Name, and Last Name to create a new Person record.
o This creation operation will return a GUID.
• Resubmit Message: Once the data issue (either Scenario A or B) has been resolved, resubmit the original message using its Document ID. The tool should return a response message upon successful resubmission.
________________________________________
4. Final Confirmation and Completion
• Send a final email confirmation to the list admin with the subject Selection Complete.
• The body of this email must:
o List the selected attorney record.
o Detail the specific actions taken (e.g., "Updated Code Translation table with ID: [ID]", "Created Person record with GUID: [GUID]").
o Crucially, include the response message received from resubmitting the original message.
• Once this final email is sent, stop all agent processing and terminate the agent loop by using 'End Workflow'
Take a look at the YouTube video outlining this Human-in-the-Loop AI Agent using Azure Logic Apps Agent Loop.

Watch for exciting content related to the Azure Integration Services, Azure Logic Apps, and Azure AI being created soon.
If you have any questions, feel free to reach out!
Hi Stephen, I’m a professional in Integration space, and I am trying to understand the usage of Logic Apps as MCP server, which was announced recently. If you have any idea/resources on the same, it would be great. Either ways, I’m open to connect.
Thanks for reaching out! The best use case I see for Logic Apps as an MCP Server is to be able to reuse those Logic Apps / business logic in AI Agents. The demo I saw was a Logic App that processed info from GitHub. This was able to seemly be added to Visual Studio, and the AI Copilot just knew how to use it.
That’s the huge value in MCP – it just works with little effort.
I think it would also be helpful in other Agent Authoring tools like CoPilot Studio or AI Foundry to be able to have that re-use of Logic Apps. Or even build out new processes using the 1400+ connectors we have a Logic Apps.
Hi Stephen – I am an integration solution architect and actually have a client with a near-identical scenario to the one in your demo. You mentioned that in a production set up you could use Teams or another tool to provide the human input in the process – do you have any further guidance about how to set this up?
Thanks for reaching out! Right, you can use Teams… but not right now.
The Logic Apps Agent Loop is still in preview, and new features are being worked on. I think we’ll soon see full support for chat protocols like Teams.
As soon as it’s available, I’ll be working on a demo to show how to use it.
Thanks Stephen – I’ll watch this space 🙂