A Microsoft Flow HTTP trigger allows users to trigger flows from third-party applications. In this tutorial, we’ll talk about how that trigger works to let the end-user initiate a flow. Microsoft Flow will serve as a bridge between your application and a large number of other services.
For example, we want to trigger our flow using an application that’s not available in Power Automate. If we’ve made our own web application and we want to trigger a flow from there, how do we do that?
This is a sample flow with some input fields that the user has to fill in.
What if we want a user to fill in these input fields from third-party applications? To do that, we need a URL endpoint that will be generated for us in this new flow. We’ll also need a JSON file also known as a schema that contains all the variables that will represent all the inputs we’re passing in.
Creating A Microsoft Flow With An HTTP Trigger
Let’s now create a simple flow using a Microsoft flow HTTP trigger. In this flow, the user will enter their first name and last name using a third-party application, and it will be posted as a Slack message.
1. Creating An Instant Flow
First, let’s go to the Create page.
Then, click Instant flow.
Instead of using the PowerApps or Manually trigger a flow option, we’ll use When an HTTP request is received as the trigger. So, let’s select that and click the Create button.
Flows created with the “When an HTTP request is received” trigger can be executed by anyone that knows the URL.
HTTP requests are outside the scope of this tutorial. However, we can easily use this as a trigger for our flow because Microsoft will just create a link for us. Then, if our third-party application accesses the link, it will trigger our Power Automate flow by itself.
The key thing here is that we’re just creating an endpoint where any third-party applications can connect to. If you want to trigger something from an email, Slack, or Trello, we don’t need to use this trigger because those connectors are available in Power Automate. You only use this technique if you want to trigger your flow from a connector that’s not available in Power Automate.
2. Setting Up The Microsoft Flow HTTP Trigger
First, we need to identify the payload that will pass through the HTTP request with/without Power Automate. Click “Use sample payload to generate schema” and Microsoft will do it all for us.
Let’s create a JSON payload that contains the firstname and lastname variables. As you can see, we also added a sample or temporary values “Joe” and “Axe” for the variables that we’ve created.
Then click the Done button.
Microsoft will then take that and create a request body JSON schema. This means when this endpoint is triggered, it expects two properties which are the lastname and firstname with their type as a string.
Next is to add a new step by clicking the New step button.
Then, search and click the Slack connector.
For the action, let’s use the Post message.
We’ll use the tutorial channel for the Channel Name.
For the Message Text, we can see on the Dynamic content that we now have the firstname and lastname variables.
This is because our endpoint expects two variables which are the firstname and lastname that we’ve created using the JSON text we added earlier.
Click the concat expression to concatenate the firstname and lastname variables.
Then, let’s concatenate the word “Hello:” with the firstname.
Let’s also concatenate it with the lastname. Make sure to add a comma after the word “Hello” and the variable fistname.
Then click the OK button.
Let’s now save our flow by clicking the Save button.
A URL will be generated which will serve as our endpoint. We can access it through our third-party application.
Testing Our Microsoft Flow
Let’s now test our flow. I’ve installed an application called Postman. If you’re not familiar with this, it’s a way to access endpoints and pass values through to make sure that they work.
Since we won’t talk about HTML, JSON, POST, and different web APIs in this tutorial, we can just use Postman to mimic those things for us. If you’re confused about POST or POST versus GET, I recommend watching a beginner or basic web development course so you’ll be familiar with those terms. I also suggest that you study what HTTP requests are because they really expand the possibilities for this application.
To test our flow, copy this URL.
Then, paste that URL on the POST field in Postman.
Inside the Body, let’s change the default values with the variables that we’ve set to our JSON payload. So, let’s add the firstname and lastname variables with the values “Tom” and “Jerry”. We should be inside the Body and make sure to select raw. The type should be JSON.
Again, this Postman serves as our third-party application. This is just to make sure that the linkages are working correctly.
On our flow, let’s now click Test.
Select the “I’ll perform the trigger action”, and click the Test button.
It will then start waiting for the action to occur.
So, we’ll now post it to our endpoint and see if it works by clicking the Send button.
Once our flow runs successfully, we can check our Slack to see if the message has been posted.
On our Slack, we should see the message Hello: TomJerry.
For this tutorial, we were able to form a trigger from a third-party application that has nothing to do with Power Automate. Microsoft has created the endpoint, variables, and everything we need. All we have to do is just access the link/URL ourselves. That’s how easy this was.
If you want to become a Power Automate administrator, then you need to learn how these things work. Once you integrate Power Automate with your company or your organization, there’s a chance that you’ll encounter third-party applications that don’t have connectors in Power Automate. This is the best way to handle these instances.
This is quite a complicated concept, but once you get a hold of it, you can make flows that are triggered from anywhere as long as you have an internet connection.