How to trigger a Logic App from another Logic app.

Or in other words, how to create a nested workflow.

Sneha Raina
3 min readMar 15, 2021

Hello on this balmy March afternoon.😁

Continuing with the tech edition, in this article I explore how we can create a nested workflow for logic apps. Nested workflows are used when we want to connect smaller workflows from other places into a single consolidated workflow.

Background:

A few days ago I was trying to expand my knowledge of Logic Apps. I came across an article in the official docs titled “Call, trigger, or nest logic apps by using HTTPS endpoints in Azure Logic Apps” which felt like a fun new thing to learn. Basically, I was trying to create this:

Courtesy:https://docs.microsoft.com/en-us/azure/logic-apps/media/logic-apps-http-endpoint/choose-logic-apps-workflow.png

I haven't worked a lot with the JSON payload part, so that became the first roadblock. I tried creating two separate logic apps and tried adding the manual trigger for one, from another, but instead encountered this error “Nested Workflow Does Not Contain Response Action”. Bummer!😢

Then I landed upon this awesome article detailing what I exactly wanted to know. Isn’t it wonderful to find the specific answer you were looking for. With the suggestions incorporated from that piece, I was successful in my task.👌

How to do it:

You must clearly understand the distinction between the parent Logic App and the Child Logic App. The Parent Logic app is the one that you would trigger either manually or from some other trigger. The parent LA will do whatever function it wants to do and will inturn trigger Child LA

Parent Logic App

The Child Logic app needs to be manually trigerred (i.e. the Http request trigger) and needs to return a response.I used 200 OK response so everything worked well for testing. Child LA can do anything but between the Request-Response steps which are essential for this to work in nested flow.

Child Logic App

It should also be noted that if you want to pass something in the body field in parent LA when you are using the LA connector, you need to provide a JSON payload to handle it. Otherwise LA will throw errors.

Empty Body field

In my case I used the twitter connector with action to send tweet.

Parent app was triggered with Recurrance connector and , it sent out a tweet on successful run after which the Child LA was triggered which sent out another tweet. We can check the run history from going to Overview->Run Histories.

We want the green ticks at each step.

Since tweets are public, they can be easily tracked from the website and we can test in real-time, whether the LA run was successful or not.

After developing all components, I hit run on the parent LA(LA-2) and voila!! I could see both the tweets appear in my profile.

Tweets sent using Logic App

Important things to note :

  1. Http Request( manual trigger) and Response are crucial in Child LA for this to run
  2. You can only send one tweet once, so add a varying parameter to the body for recurrence to work.
  3. Delete all resources after you are done with them as everything on azure is being charged to your subscription even if you don’t use it.

If you have an active azure subscription, why not give this a shot. 🤷‍♀️

Get! Set!! Azure!!!🐱‍💻

--

--

Sneha Raina
Sneha Raina

Written by Sneha Raina

Limitless articles in article less sentence.

No responses yet