Building an Agentic Service Bus Plugin With Logic App agent loop.
In this article, we'll explore how to supercharge your Service Bus plugins by combining them with a Logic App and an agent loop.
Take a look at this video before reading on to understand what we are building.
Creating a Service Bus
Let's create a service bus in basic SKU as shown below. We've created a queue inside the service bus.
Register a service bus plugin
Now, register a service bus endpoint as shown in the below steps.
Add your connection string here.
Now register the step as shown below.
Creating a consumption logic app
Create a consumption logic app, we can also choose a workflow logic app but for this demo we'll stay with a consumption logic app
The key bits to select are the type of the workflow
Create the orchestration in the logic app
The most beautiful part begins now 😀😀.
base64ToString(triggerBody()?['ContentData'])
Recommended by LinkedIn
Configure the agent loop
See the configuration below, we already know the JSON structure dispatched to the service bus's endpoint by our plugin.
We give the agent clear instructions about how to read the values we are interested in.
This makes the orchestration extremely easier, because, regardless of the complexity of the JSON, now you've the capability to read the desired values and generate further text on it in one single instructions, that's the real power of AI
Add the tool(s)
This is the next beauty. Notice how we extract information from agent's output in new parameters that we can further use in the orchestration.
How many tools could be added?
Add as many as you want, the agent will automatically invoke the right tool based on how well you describe them, besides, every tool can have one or more parameters extracted from the agent's output.
Extract the desired values.
Now that you've defined your parameters you can use them just like any other logic app action step.
Finally, we update Dataverse using a WebApi call.
Awesome Shashank! I implemented something similar using copilot studio triggers for an “invisible agent” to assess some some geographical data and then reach out to the web to find the lat and long of the place (port in this case) and then update the row using MCP. Good stuff here!