Set up changed-based triggers

In this guide, we'll walk you through setting up triggers based on changes to selected attributes to control which records enter your workflow.

When combined with the cron trigger type and filters, this feature allows you to define precisely when the workflow will run.


Pre-requisites

Before you begin

Ensure that you have an existing workflow linked to a data model. In this example, we’ll use HubSpot contacts as the underlying data model.



First, while in the workflow editor, select the triggers tab at the top of the editor.

This screen allows you to customize all options of the workflow trigger.



We want to correlate workflow runs with business operations and have it run only from Monday to Friday, twice per day, at 9 AM and 4 PM.

In this case, we will use the following cron expression:

Cron expression to run twice a day on specific days.

0 9,16 * * 1-5

You can use a free online tool like crontab.guru to create and validate cron expressions.



Now, we want to narrow down which HubSpot records will be enrolled in the workflow.

Our workflow processes HubSpot leads, and only contacts with certain status fields are relevant. Additionally, we are only interested in enrolling leads created after a certain point in time.

In this case, we can add two filters: the first on the lead status field and the second on the createdAt field. By default, conditions are joined with the OR operator, so we click it to change it to the AND operator.



The next option allow us to specify which data model operations will trigger a workflow run. As mentioned above we want to run this workflow in relation to Lead Status changes.

In this case we will select updated and in the rracking columns field we will add Lead Status.


Outcome

Finish line

You have successfully used low-level options of a workflow trigger to configure a precise logic on what data is processed by the workflow. This allows to tailor the workflow operations to specific business needs.