Types of triggers

The following six types of triggers are supported in Logic Apps as of now:

  • Recurrence trigger:This fires based on a defined recurring schedule—"every X second/minutes/hour/day".

    Types of triggers

  • HTTP trigger: This polls an HTTP web endpoint for a response. Here, the connector as a trigger will either return 200 or 202 response.
    • A 200 response means "Run"—workflow will be executed
    • A 202 response means "Wait"—do not start the workflow as the connector does not have any response data to pass over to workflow
  • ApiConnection trigger: These are polls such as the HTTP trigger. However, it takes advantage of the Microsoft managed APIs (For more information refer to: https://azure.microsoft.com/documentation/articles/apis-list/). The basic functionality of API connection trigger is similar to the HTTP trigger.Here is an example of the Dropbox connector that polls a defined folder for a new file.

    Types of triggers

    Types of triggers

  • Manual trigger: This trigger serves as an endpoint that you call manually to invoke your Logic App. This is one of the three types of Push triggers that can receive request. The other two are HTTPWebhook and ApiConnectionWebhook, which are discussed next.

    You can use the "HTTP Request" trigger as a manual trigger.

    Types of triggers

    Once you add the trigger in your designer, you need to define a request body JSON schema and the designer will generate tokens to help you parse and pass data from the manual trigger through the workflow. You can use a tool such as jsonschema.net to generate a JSON schema from a sample body payload.

    Types of triggers

    After you save your Logic App definition, a callback URL will be generated similar to: https://prod-13.australiaeast.logic.azure.com:443/workflows/3g4f50a60a3560938581f70d8c47hf45/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=RRvN4GwgKta-cqH940wxqO2o6BuAUxonuy3sgsgmSg.

    You can also get this endpoint in the Azure portal:

    Types of triggers

    Once you have created the endpoint for your trigger, you can save it in your callback store in your system and call it via a POST to the full URL.

  • HTTPWebhook trigger: This opens an endpoint, similar to the manual trigger. However, it also calls out to a specified URL to register and unregister.

    Logic Apps now allow you to subscribe to external events via Webhooks. Webhooks can be used as a trigger that will instantiate a workflow. The Logic App engine will call the subscribe endpoint whenever a Webhook trigger is added and saved. Your API can register the webhook URL and call it via HTTP POST whenever data is available. The content payload and headers will be passed into the Logic App run.

    If a Webhook trigger is ever deleted (either the Logic App entirely, or just the webhook trigger), the engine will make a call to the unsubscribe URL where your API can unregister the callback URL and stop any processes as needed.

    Types of triggers

    Subscribe is the outgoing call that makes Logic App to start listening to events. The function @listCallbackUrl() returns a unique URL for this specific trigger in this workflow.

    Unsubscribe is called when the user performs an operation that renders this trigger invalid including the following:

    • Deleting/disabling the trigger
    • Deleting/disabling the workflow
    • Deleting/disabling the subscription

    The Logic app automatically calls the unsubscribe action. The parameters to this function are the same as the HTTP trigger. The outputs of the HTTPWebhook trigger are the contents of the incoming request.

  • ApiConnectionWebhook: This operates like the HTTPWebhook trigger by taking advantage of the Microsoft-managed APIs.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset