In this blog post, we are going to learn about triggering flows using a web URL. Many at times we wonder if we can trigger flows from a web URL so that we can integrate that URL in a custom website.
Today we are going to learn how to achieve this and implement a flow that we can trigger from web URL.
There are two ways to achieve this, the first method is by using the flow button trigger and the second way is by using the HTTP request method. In this blog post, we are going to look at implementing the first method. We will also see an implementation using the second method on a later date.
In the next steps, I am going to create a flow to illustrate a simple example for adding two numbers.
Step 1: Open the flow home page and click on the option "CREATE", this will populate data on the side pane here select "INSTANT FLOW" and "Flow Button" as a trigger, once done click on create
Step 2: Once you click on "CREATE" it will take you to the flow editor here we can add steps to configure our flow
Step 3: We will add the required input elements on the trigger, in this will I will need two numerical inputs for storing the data that I need for computing my expression.
On the trigger we will see an option called "Add Input" click on that to add input to trigger, you can select from different types of inputs that you can add be it of type text or number or file upload. For this, I am going with numerical input.
Step 4: I will add an action in the flow to create notification wherein I will share the computation result of the input data provided.
For adding the values provided in the input elements I am going to make use of add() function.
Step 5: Now we have all the steps setup, we will click on the "SAVE" button to save the flow. For triggering the flow using URL we have to do one more step. Click on the back arrow near the flow name to navigate to the flow dashboard.
Step 6: On the browser address bar you will be able to see a URL copy the URL and append /run in the end. Whenever we try to open this URL in a web browser it will directly take us to a web page wherein we can pass inputs to the flow.
Voila, and it's done you can now integrate the URL into your custom web page wherein you can navigate the users to flow page and request then to enter inputs directly instead of the user trying to run flow every time they want to process things.
This process will come handy when you can run your flow with a button trigger, this will ease the user experience as well.
Comentários