Logic Apps: Recursive Logic Apps

  • Pedro Almeida
  • May 3, 2021
  • 2 min read

My thoughts

While dwelling in my thoughts, a memory came to my mind. In my college time, I was presented with a challenge to make a recursive Fibonacci algorithm in LISP without using Loops.

This was a challenge, because as you may know…

You have LISP

 (These are probably my favorite programming comics).

📝 One-Minute Brief

Azure Logic Apps don’t support recursive calls by default, but you can still implement recursion with a simple workaround. This article shows how to build recursive Logic Apps by calling the workflow through an HTTP action, enabling loop‑like behavior for advanced integration scenarios.

The Idea

But this gave me the idea of testing this concept in Logic Apps.

I’ve built a fairly simple LA just to test, and with minimal inputs.

Before I could add the recursive connection to the Logic App, I had to deploy it first, because you can only call an LA or a Function if it’s already provisioned.

So, I’ve added the action after deployment, saved, and tried to deploy again, and this came up:

This means that Logic Apps, by default, do not support recursive calls.

The workaround implementation

But I’m stubborn, and I don’t give up easily. So, what would be the best way to call an LA, knowing that I’d have to treat it like an external API?…

The answer is super simple. HTTP action!

We already have the URL, because we deployed it before, so there’s nothing stopping us from doing this.

No objections this time, so let’s test!

TA-DAAA! How easy was that? In my case, I’ve used a simple counter to add and loop, but you can use any other condition to recursively loop through your logic, for example, until a SQL record is updated.

You can add delays to ensure that you won’t be making calls every second, or delay until a specific time. The possibilities are endless.

Happy coding!

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Pedro Almeida

Pedro Almeida is a Senior Integration Developer at Devscope, working with Logic Apps, BizTalk, and other related products. Although he started his career as a Dynamics CRM Consultant, Integrations quickly caught his eyes and has made it his primary area of interest and work. Since then, Pedro has worked with customers from very different areas, from Retail to Banking to Governmental Services and others. You can contact Pedro at pedro.miguel_almeida@outlook.com(Twitter: @ItsNotRcktScnce)

5 thoughts on “Logic Apps: Recursive Logic Apps”

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top