How to test triggers and actions
Built.io Flow lets you to test individual triggers and actions while creating the workflow. This helps you check if your triggers/actions are configured properly before you start using the workflow for automating important tasks.
In this guide, we will understand how to test triggers and action with the help of examples.
Let’s first understand how to test triggers.
Testing Triggers
A workflow can be triggered in two ways:
1. Via Web service triggers
2. Via Webhook
1. Testing Web Service Triggers
Built.io Flow allows you to test your configured settings for a web service trigger. We will understand the steps to do so, with the help of an example. Let’s say you have configured ‘Evernote - New Note’ trigger.
Step 1: Navigate to the trigger configuration window.
Step 2: Click on ‘Save’ button.
Click on ‘Save’ to save your trigger. This will create the specified trigger on Built.io Flow. After this, you will be redirected to the ‘Test Trigger’ window, where you can check if you have configured the trigger settings properly.
To test your trigger, you need to perform the trigger action in the web service account for which you are setting up a trigger (these instructions can be seen in the ‘Test Trigger’ window as well). In this example, you will need to create a new note in your Evernote account.
Once this is done, go back to your trigger in Built.io Flow and click on the ‘Test’ button given at the bottom of the ‘Test Trigger’ form. Built.io Flow will then fetch the data of the note that you just created in your Evernote account.
If you have configured the trigger correctly, you will see the output data for the trigger. This will give you an idea of how your trigger will work when used in a workflow and which keys are returned in the output of the trigger. This output data will then be used to configure the rest of the workflow.
If you ‘Skip’ testing the trigger, Built.io Flow will use mock data for that trigger to configure the rest of the workflow.
You can also set custom filters to specify the conditions which must be met in order to execute the workflow. To do this, click on the ‘filters’ link given at the bottom of the trigger output.
A new window will appear where you can set up custom triggers using the sample output data returned.
Once this is done, click on 'Done'. This will test your configured web service trigger.
2. Testing Webhook trigger
A webhook is a user-defined HTTP callback. Built.io Flow supports incoming webhooks which allows external sources to notify Built.io Flow about a specific event. We will understand the steps to test a webhook with the help of an example.
Step 1: Navigate to the webhook configuration window.
You will see the Webhook URL for your workflow along with other options. The ‘Webhook Payload’ option lets you add payload for the Webhook. The structure of the payload you add here should be similar to the one that the webhook is expected to receive in future. Built.io Flow uses this data to display the output of the webhook in the subsequent actions of your workflow.
Step 2: Enable the ‘Webhook Payload’ option using the toggle button, to test your webhook.
You will see three text fields: ‘Headers’, ‘Body’, and ‘Query’. These are the keys that are returned in the output of the webhook. Enter the payload data (in JSON format) in the relevant fields.
Step 3: Once you have added relevant payload, click on ‘Next’.
You will see the webhook payload data provided by you, which will be used to configure the rest of the workflow.
Testing Actions
You can test the configured settings for your actions to eliminate run-time errors for your workflow. We will understand the steps to do so with the help of an example. Let’s say, you have configured ‘Gmail - Send an Email’ action for your workflow which is connected to the ‘Evernote - New Note’ trigger.
Step 1: Navigate to the action configuration window
Step 2: Click on the ‘Next’ button. You will be redirected to the ‘Test Action’ window where you can see the input data provided by you to configure the ‘Gmail - Send an Email’ action along with a ‘Test’ button.
When you click on the ‘Test’ button, Built.io Flow will actually perform the action. It will automatically send a notification mail via Gmail containing the content of the note to the specified recipient and will show the output of this action in the window that appears. This output can then be used to configure the rest of the workflow.
This test ensures that you have configured the action properly. In case you want Built.io Flow to send another email to the specified Gmail account, click on the ‘Retest’ button.
Note: You can optionally skip testing the action by clicking on the ‘Done’ button given at the bottom of the window. If you do so, however, you will not be able to see/use the output of this action, in the subsequent actions.
Once you have tested the action, click on ‘Done’ to return to canvas.