Triggers

Start setting up triggers to fire-off workflows on specific events. Know the types of triggers, how they work, and how to configure them, and learn how to add and delete triggers from workflows or webMethods.io Integration.

Trigger is a powerful tool that automatically launches a workflow when a defined event happens. This enables you to automate a complex business process without having to manually run the workflow every time.

Example

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, that is, When an event occurs in Service A is a trigger. By defining this, you are informing webMethods.io Integration to run the workflow automatically whenever a particular event happens in Service A.

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. webMethods.io Integration 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

Polling Triggers

All triggers do not keep constantly checking for updates or changes in these external services. Some check for changes periodically, at regular intervals (for example, every 15 minutes). This type of trigger is called as a Polling Trigger.
Polling triggers may not send data to webMethods.io Integration in real time. All the polling triggers are marked with Clock sign in the triggers list.

While configuring a polling trigger, you can select the interval after which the trigger should check the application for new data using the Polling interval field. The default polling interval is 15 minutes.

Webhook Triggers

Some triggers keep checking for updates continuously. They send data to webMethods.io Integration in real-time, which enables your workflow to run as soon as the specified event occurs in an external application or service. This type of trigger is called as a Webhook Trigger.

Note: Apart from this, webMethods.io Integration provides Listeners feature which automatically runs the specified Flow service whenever a subscribed event occurs in a supported external application or service. Learn more about Listeners.

Adding a new trigger

Let’s say you want 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 - Task Created. Let’s look at the steps involved in setting up this trigger.

  1. Create a new workflow

    To define a new trigger, you need to create a new workflow. To do so, navigate to the project and create a blank workflow. Add Google Translator connector and Send an Email action on canvas and connect them. If you are new to webMethods.io Integration, get more help on creating first workflow.

  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.

  3. Add Wunderlist

    A new window will appear where you can see the list of all web services for which webMethods.io Integration supports trigger events. Locate the Wunderlist service from the list of services, and click on it.

  4. Configure Wunderlist trigger

    Certain fields are common for every trigger:

    • Trigger Label: Provide a suitable name for the trigger.

    • Select trigger: Each service has multiple trigger actions to choose from. Select the trigger action of your choice, from the drop-down list. For the purpose of this example, we will select the Task Created trigger.

    • Authorize Wunderlist: Select the account for which you want to set up the trigger, from the drop‐down list. If you have not created an account yet, hover on the + button. You will see two options:

      • Default Authorization: Select this option to allow webMethods.io Integration to automatically generate all keys required to execute all Wunderlist triggers and actions.

      • Or: Select this option to provide the relevant keys required to execute all Wunderlist triggers and actions.

    After you have entered these details, click Next. This will redirect you to the trigger configuration window.

    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 webMethods.io Integration.

  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 - Task Created trigger, you will need to create a new task in the specified list of your Wunderlist account.

    Once this is done, go back to your trigger in webMethods.io Integration and click on the Test button given at the bottom of the Test trigger form webMethods.io Integration 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.

    You can alternatively Skip testing the trigger.

    If you Skip testing the trigger, webMethods.io Integration 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 from the Canvas or the Projects page.

Editing a trigger from the 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.

Editing a trigger from the Configurations page

To edit an existing trigger, go to your project and then navigate to Configurations > 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 or your webMethods.io Integration account.

Deleting a trigger from a workflow

To delete a trigger from any particular workflow follow these steps:

  1. Go to Workflows and click on the workflow of which the trigger you want to delete.

  2. Hover over the Start button and click on the Settings button or double-click on the Start button.

  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 webMethods.io Integration account.

Deleting a trigger from your account

To delete an existing trigger permanently from your account, follow these steps:

  1. Go to your project and navigate to Configurations > 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.

  2. You will see the Edit and Delete icons 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 dialog 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 dialog box.

    Once you have deleted the trigger from those workflows, you can delete it permanently from the project.