ThingWorx Flow > Triggers
A Trigger is a specialized action that can be configured on the start step of a workflow to define when the workflow is executed. You can automate complex business processes without manually running the workflow every time.
Types of Triggers
There are two types of triggers:
Polling triggers—Checks the external system periodically for specific changes. If changes adhere to the trigger configuration criteria, then the workflow is initiated. By default, polling triggers run every 30 minutes. All the polling triggers are marked with in the triggers list. A list of polling triggers is as follows:
Dynamics 365 CRM
Excel Online
Google Drive
Google Forms
Google Sheets
Google Tasks
Office 365
RSS Feeds
Webhook triggers—Registers a call-back with the external systems so that whenever the specified event occurs on that system, that system calls into ThingWorx to start the workflow. Note that the Webhook trigger is a generic trigger that can be used in other external systems which are manually customized to call ThingWorx.
For Webhook triggers, make sure that ThingWorx Flow is accessible from the third-party services.
A list of webhook triggers is as follows:
Adding a new trigger
Follow these steps to add a new trigger.
1. Create a new workflow by providing a name for the workflow.
2. Click , and then click or double-click . A list of triggers appears.
3. Select a trigger and configure it. Different triggers require different settings, but in general they require the following configuration:
a. Trigger Label—Enter a name for the trigger.
b. Connection Type—Some connections allow different types of connections such as Basic or OAuth authorizations. Select a type of connection to use.
c. Connection—Select an existing authorization or connection or create a new one.
d. Trigger Event—Select an external system event for which the workflow is executed.
Authorize <connector>—Select the connection if you have created one, or select Add new <connector> login.
e. Additional Trigger Configuration—Enter additional trigger configuration, if required.
f. Custom Filters—Click ADD to define additional conditions for controlling when the workflow is executed. Use the event data that appears in the input panel on the right side, to specify the input field to evaluate.
These conditions are evaluated in ThingWorx after the external system makes a call to ThingWorx to initiate the workflow.
An example trigger configuration is shown in the figure that follows:
Editing a Trigger
Edit triggers from the Global Settings page or from the start action of a workflow.
To edit a trigger from a workflow, do the following:
1. Open the workflow you want to edit.
2. Double-click . A list of all triggers associated with the connector appears. The trigger associated with the workflow is denoted by a check box as shown in the figure that follows:
3. Click . A configuration window opens. Alternatively, select other triggers to associate with the workflow.
4. Click SAVE.
To Edit a Trigger from the Settings Page
1. From the home page, go to the Workflow Settings menu, and then select TRIGGERS. A list of all triggers from your ThingWorx Flow account appears.
2. Click next to the trigger that you want to edit, and then click Edit. A trigger configuration window opens.
3. Edit the trigger configuration form, and then click SAVE.
Deleting a Trigger
Delete triggers from the Global Flow Settings page or from the start action of a workflow.
To Delete a Trigger from a Workflow
1. Open the workflow of the trigger that you want to delete.
2. Double-click which now has the icon of the connector used as a trigger. A list of all triggers in the system associated with the connector appears. The trigger associated with the workflow is denoted by a check box as shown in the figure that follows:
3. Click . A confirmation message appears.
4. Click YES to confirm your action. If the trigger is only used by in the single workflow, the trigger is deleted from the system. However, if the trigger is used by another workflow, the trigger is only removed from the workflow and the trigger remains in the system.
Deleting a trigger does not delete the associated authorization or connection.
To Delete a trigger from the Settings page
See the Global Flow Settings for details on deleting a trigger from the Workflow Settings page.
Adding Custom Filters
Use the custom filters to set up a specific group of conditions.
For example, if you need to apply filters based on the Name and Middle Name for New Contact event in Office 365. You can apply the custom filters as follows:
Filter 1—Name (Input) equals (Condition) John (Expected)
Filter 2—Middle Name (Input) equals (Condition) Clinton (Expected)
The trigger is triggered only if the defined filters match.
To add custom filters, do the following:
1. Click and then add a new trigger. For information on adding a trigger, refer to the section Adding a new trigger.
2. In the Custom Filters section, click ADD. The fields appear as shown in the figure that follows:
3. Enter the Input, Condition, and the Expected output.
4. Click Save.