Microsoft Integration Product team announced this month on their monthly webcast (that you can see it here) some of the new features that are now available in Logic Apps like:
In my last articles I talked about the new “Azure Functions Integration” (here and here). One of the features that Product group announced was the ability to “Call nested workflow in Designer”, and the good news is that it is currently available for us “to play”.
Call nested workflows, or Logic Apps, from another Logic App is actually not a new feature. We could previous achieve this as you can see in this post: Using Nested Azure Logic Apps … or Invoking Flows from another Logic App. However, it was not a “first class” experience and we were forced to implement some workarounds to be able to achieve this goal…. Not anymore! Now it way more simple and with a good user experience in the designer!
The first thing that you need to know is that, if you want to create a Logic App that you can call through another Logic App:
To wait on nested workflow ‘{Child Logic App Name}’, it must contain a response action.
Let’s create a simple scenario to demonstrate how we can call nested Logic Apps directly from Logic Apps Designer. In this sample we want to create a child Logic App that:
{
"Request"
: {
"text"
:
"text that we want to put in file content"
}
To accomplish that we need:
We have to wait a few seconds for the deployment process to finish, once it’s finished we will be notified in the notification area. You can check for more Logic Apps create process details here.
module.exports =
function
(context, data) {
var
Tweet = data.Tweet;
d =
new
Date().getTime();
uuid =
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.replace(/[xy]/g,
(c) {
r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return
(c==
'x'
? r : (r&0x3|0x8)).toString(16);
});
// Response of the function to be used later.
context.res = {
body: {
FileName:
'NewTweet_'
+ uuid +
".txt"
};
{}
@{body(
'CreateFileName'
)[
'FileName'
]}
"Save" your Logic App and we are now ready to use/call this workflow from other Logic Apps.
If we now create another Logic App – the parent – let’s call it “CallNestedLogicAppDemo” by:
How cool is that! Yeh!
Once again, “Save” your logic app and wait to a tweet to appear, we will see that a new file was added in your Dropbox:
You can also check the runs of the Logic App to see if it runs successfully or if an error occurred and what, how long it took to run, inputs and outputs, among others
Unfortunately, here we don’t have a similar functionality that we have on BizTalk Orchestration Debugger, the ability to “View Called orchestration”. It would be great to have here a similar one “View Called workflow runs”. I add this request on User voice and if you like it you can go there and vote.
The good thing is that we now can reuse this “AddFileToDropbox” in several Logic Apps that we have or will create in the future.
With the following error:
"statusCode"
: 502,
"headers"
: {},
"body"
"error"
"code"
"NoResponse"
,
"message"
"The server did not received a response from an upstream server. Request tracking id '08587405217965861441'."
If we check the child execution, we will see that the Logic App is failing in the “Dropbox – File Create” action and the “Response” action will be aborted
This article was originally published at The ability to call nested Logic Apps directly from Logic Apps Designer. But please feel free to improve this article by adding new, missing or important content, fixing spelling and so on.
Another important place to find a huge amount of Logic Apps related articles is the TechNet Wiki itself. The best entry point is Microsoft Azure App Service Resources on the TechNet Wiki.