The following six types of triggers are supported in Logic Apps as of now:
You can use the "HTTP Request" trigger as a manual trigger.
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.
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:
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.
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.
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:
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.