Calling Stateless Logic App from Stateful Logic App
The ability to call one logic app from another has been around for quite some time. However, with the introduction of Azure Logic Apps (Standard), the behavior is a little different. Let’s explore a scenario where a stateful logic app will call a stateless logic app.
A scenario where we may want to use this approach with is having a logic app that is used for logging purposes. This is a great opportunity to use stateless execution mode as we are not concerned with verbose logging or durability, but we do want to have our execution completed quickly so that we can focus on processing our core business request.
The implementation of our stateless workflow doesn’t really matter for the purpose of this post other than we should expose it using an HTTP Trigger. We can also construct a JSON schema so that we can send in a typed object from our stateful logic app.
Now this is when things start to get interesting. When we add the Invoke a workflow in this workflow app action to our stateful logic app, we can only select logic apps (both stateless and stateful that are in our Azure Logic App (Standard) instance. I am unable to select any consumption-based logic apps.
Since we declared some request body parameters in our stateless workflow’s HTTP trigger, we can now populate them from our stateful logic app.
If we go ahead and run our stateful logic app, we will see the entire execution within our Run History. When it comes to calling our stateless workflow, we can see that it ran quite quickly (.5 seconds). This is in part due to it being stateless.
If we head over to our stateless logic app, we will discover that there are no new Run History records created. This is due to our debug mode being disabled. If we wanted to temporarily debug a logic app, we can Enable debug mode. But, during this time we will see a performance impact since we will now have log points enabled.
In this post we explored how to call another logic app from an Azure Logic App (Standard) instance. As we learned, you can only call logic apps from within the same Azure Logic App (Standard) instance. Other consumption-based logic apps will not appear in the Workflow name dropdown.