Logic Apps: Recursive Logic Apps

Posted: May 3, 2021  |  Categories: Azure Integration Logic Apps

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

This was a challenge, because as you may know…

Title

 (these are probably my favorite programming comics)

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  a 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.

But I’m stubborn and I don’t give up easily. So, what would be the best way to call a 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!

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 *

turbo360

Back to Top