Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an Azure Logic App have multiple start triggers?

Can an Azure Logic App have multiple start triggers?

I've read the triggers docs at MSDN but can't see anything on having multiple triggers

like image 906
SteveC Avatar asked Apr 10 '17 09:04

SteveC


People also ask

Can logic app have multiple triggers?

Yes, multiple triggers can be defined in a Logic App. Multiple triggers can be accommodated in a Logic App workflow. As mentioned by Microsoft Azure, a single Logic App can have up to 10 triggers in it.

How do I create multiple triggers in logic app?

Adding the second trigger Or maybe you just want multiple recurrence triggers. On the latter, let's add a recurrence trigger as the second trigger. As you can see the property 'triggers' is already plural and should support multiple triggers. By adding the recurrence trigger you can have multiple triggers.

Can logic app have multiple workflows?

Performance. Using the Logic App (Standard) resource type, you can create and run multiple workflows in the same single logic app and tenant. With this 1-to-many mapping, these workflows share resources, such as compute, processing, storage, and network, providing better performance due to their proximity.

What are the types Azure logic apps triggers?

Triggers are generally of two types: Polling Trigger – It checks a service's endpoint at regular intervals. Push Trigger – It creates a subscription to an endpoint and provides a call-back URL so the endpoint can notify the trigger when the specified event happens, or data is available.


2 Answers

In general yes, you can have multiple triggers in a Logic App workflow. Actually, according to the official documentation, you can have up to 10 triggers in a single Logic App. As example, in the following logic app, I used two triggers: the first one is a SFTP connector trigger and, after a sequence of actions I have a second trigger on a Service Bus queue (with the send message action I send a message for a webjob that performs a long running task and it notify the Logic app with a message on another queue that let it to continue its execution).

enter image description here Probably, what you mean instead is if it's possible to have multiple "starting" triggers to implement some kind of "or logic" between triggers. In this case I think the answer is no, and in order to achieve this I will go as well with what @Steven Van Eycken suggests: split Logic Apps in two of them, triggered by the two triggers you need and for example then send a message on a queue that triggers the third logic app with the common workflow.

like image 160
Davis Molinari Avatar answered Oct 21 '22 06:10

Davis Molinari


I guess I'm a bit late to the party, but I have been able to create multiple triggers for a logic app.

In mine, I'm using the SFTP connector to trigger when a file is created or changed. The SFTP connector only allows one folder to be monitored but I didn't want to duplicate the logic app for each folder I want to monitor, so I've added three SFTP triggers to my app, each monitoring a different folder on the same SFTP site.

AFAIK you can only do this in the code view, and once you have multiple triggers you cannot get back to the designer view, but essentially I set up my logic app as I wanted it, then went into the code view, duplicated the trigger definition and changed the bits I needed to change (the name, the folder name and the folder ID).

Trigger history in the Overview screen then allows you to choose which of the triggers you want to see, but whichever trigger has fired, the rest of the logic app runs. You also lose the ability to see the workflow view of the historical runs, but with a few extra clicks you can see what's going on at each stage in the app.

It's a pain that it can only be done in the code view, but it is possible, certainly with the same type of trigger. I'm not sure about mixed trigger types, but I guess as long as you weren't relying on an output from one that doesn't exist in the others then it should be ok. I also tested it with multiple email triggers. Just bear in mind that if the connectors require different connections, you'll need to include each of the connections in your code. To start with it might be worth building each in a separate app then pasting the relevant bits of code in.

like image 31
Steve Avatar answered Oct 21 '22 05:10

Steve