Triggers
Automate your integration workflows with triggers
Trigger
A trigger is a powerful tool that automatically launches a workflow when a defined event happens. This enables you to automate complex business process without having to manually run the workflow every time.
Earlier, we learned that creating a workflow is like defining the conditions of your requirement:
When an event occurs in ‘Service A’, do something in ‘Service B’, and (optionally) pass on the data to ‘Service C’, ‘Service D’, and ‘Service E.
Here, the first part, i.e., ‘When an event occurs in Service A’ is a trigger. By defining this, you are informing Built.io Flow to run the workflow automatically whenever a particular event happens in Service A.
Example
Let’s look at an example to understand how triggers work, and how to set them up. Let’s say your workflow is ‘When a new to-do item is created in Wunderlist, translate the title text to Spanish, and send the translated text to my email address.’ In this workflow, ‘When a new to-do item is created in Wunderlist’ is the trigger. Built.io Flow will keep checking your Wunderlist account for any update. As soon as a new to-do item is created, it will extract the title text, convert it to Spanish, and send the translated text to the specified email id. Let’s look at the steps involved in setting up this trigger.
Types of triggers
A trigger fires off a workflow when an event happens in an external app or service. However, not all triggers keep constantly checking for updates/changes in these external services. Some check for changes periodically, at regular intervals (e.g., every 5 minutes). This type of trigger is known as polling trigger.Polling triggers may not send data to Built.io Flow in real time. All the polling triggers are marked with 'Clock' sign in the triggers list.
The other type of trigger, on the other hand, keeps checking for updates continuously. It sends data to Built.io Flow in real-time, which enables your workflow to run as soon as the specified event occurs in an external app or service. This kind of triggers is called a webhook trigger.
Here is a list of (webhook) triggers that fire off the workflow as soon as the specified event occurs.
Bit Bucket
Built.io Backend
Campaign Monitor
Built.io Contentstack
Drip
Eventbrite
Formstack
Github
Hipchat
Intercom
Jira
Jotform
Mailchimp
Pagerduty
Cisco Webex Teams
Trello
Wufoo
Wunderlist
Adding a new trigger
Let’s say you wish to create a workflow such that When a new to-do item is created in Wunderlist, translate the title text to Spanish, and send the translated text to my email address. For this workflow, you will need to set up the trigger ‘Wunderlist - Item added’. Let’s look at the steps involved in setting up this trigger.
Step 1. Create a new workflow
To define a new trigger, you need to create a new workflow. To do so, navigate to ‘Projects > Blank Workflow’ and give a suitable name to your workflow. Then, add relevant actions(‘Google Translate - Translate Text’ and ‘Send an Email’) and connect them. If you are new to Built.io Flow, get more help on creating your first workflow.
Your workflow should look something like this:
Step 2. Configure 'Start' icon
Trigger is the starting point of a workflow. Therefore, the ‘Start’ icon houses all the settings related to triggers. Hover on the start icon, and click the ‘settings’ icon to add and configure a trigger.
Step 3. Add Wunderlist
A new window will appear where you can see the list of all services for which Built.io Flow supports trigger events. Locate the ‘Wunderlist’ service from the list of services, and click on it.
Step 4. Configure Wunderlist trigger
Certain fields are common for every trigger.
Trigger Label: Provide a suitable name for the trigger.
Authorize Wunderlist: Select the relevant authorization, if you have already created one. Else, select ‘Add new’.
Select trigger: Each service has multiple trigger actions to choose from. Select the trigger action of your choice, from the drop down list.
Apart from these fields, you may see a few other fields, depending on the trigger you choose. You need to enter relevant data in these fields in order to successfully set the trigger. View our documentation on various service-specific triggers to get in-depth info on how to configure each trigger.
Once you enter data in all the fields, click ‘Save’ to save your trigger. This will create the specified trigger on Built.io Flow.
Step 5: Test Wunderlist trigger
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, ‘Wunderlist - New Item’ trigger, you will need to create a new item in the specified list of your Wunderlist 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 item your just created in your Wunderlist 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.
Editing a trigger
There are two ways to edit triggers.
1. From Canvas
2. From ‘Projects’ page
1. Editing trigger from canvas
To edit an existing trigger from canvas, first open the workflow of which the trigger you want to edit and double-click on the ‘Start’ icon (which now has the icon of the service used as a trigger). You will see the list of all triggers of your account that are associated with the service.
You will see the ‘Edit’ icon given against the trigger that is being used in the workflow. When you click on it, it will open up the trigger configuration window where you can make your changes. Once you have made the changes, click on 'Save'.
2. Editing a trigger from 'PROJECTS' page
To edit an existing trigger, go to your project and then navigate to ‘CONFIGURATION > TRIGGERS’. You will see all the existing triggers associated with your project workflows.
Locate the trigger you want to edit and hover over the trigger name. You can see ‘Edit’ and ‘Delete’ icon appear beside the trigger name. Click on the ‘Edit’ icon.
A trigger configuration window will appear on screen. Make your changes in the window that appears and click on ‘TEST’ to test the updated trigger settings. Once the trigger has been tested successfully, click on ‘DONE’ to save the trigger settings.
Deleting a trigger
There are two ways to delete a trigger:
- From the workflow
- From your Built.io Flow account
Deleting a trigger from a workflow
To delete a trigger from any particular workflow follow the steps given below:
Step 1: Go to 'Workflows' and click on the workflow of which the trigger you want to delete.
Step 2: Hover over the 'Start' button and click on the 'Settings' button or double-click on the 'Start' button.
Step 3: You will see a 'Delete' button beside the trigger name in the window that appears. Click on this button. You will be prompted to confirm the delete action. When you click on 'YES', it will delete the trigger from that particular workflow.
Note: In case the trigger you want to delete is not being used in any other workflow, it will be permanently deleted from your Built.io Flow account.
Deleting a trigger from your account
To delete an existing trigger permanently from your account, follow the steps given below:
Step 1: Go to your project and navigate to 'CONFIGURATION > TRIGGERS'. You will see all the existing triggers associated with your project workflows. Locate the trigger you want to delete and hover over the trigger name.
Step 2: You will see the ‘Edit’ and ‘Delete’ icon appear on window beside the trigger name. Click on the ‘Delete’ icon.
In case the trigger you want to delete is associated with any workflows, a new dialogue box will open where you will be prompted to delete the trigger from those workflows first. You can navigate to the workflows by clicking the workflow name given in the dialogue box.
Once you have deleted the trigger from those workflows, the trigger will be automatically deleted from your account.
Executing a trigger
Executing webhook triggers
Webhook triggers check web services for new data continuously. As soon as a trigger event occurs in a web service account, the webhook trigger fetches that data in real-time and fires off the workflows connected to it, instantly.
Executing polling triggers
Unlike webhook triggers, polling triggers check with the web services for new data at certain intervals (approximately five minutes) and fire off the workflows connected to them if new data is found.
In case you want to fire off a workflow as soon as the trigger event occurs, you can use the ‘Execute’ button located at the bottom left hand side of the trigger icon in your workflow. This pulls the new data from your trigger service account in real-time and executes the workflow.
To execute a polling trigger instantly, perform the trigger action in your trigger service account, go back to canvas, and click on the ‘Execute’ button that you see on your workflow trigger icon (start icon). This will execute your workflow instantly, just like any other webhook trigger.