Triggers

Triggers snap your workflow into action

Unless you are using a bulk workflow execution node to initiate your workflows, you will need to setup a trigger. There are two types of triggers: activity-based triggers and scheduled triggers. Triggers are created and managed on your account's main page.

Activity-based triggers

When you want your workflow to run every time a new or updated record is synced, you will want to use an activity-based workflow trigger. When you create this trigger you will need to select which data resource will trigger the workflow. You should select the data resource that corresponds to the workflow you're creating the trigger for. Next, you will select the workflow you want to trigger. You are able to determine if the trigger will only call the workflow when a new record is found, only when a record is update, or when the record is either created or updated.

Within activity-based triggers you are also able to determine discard criteria and requeue criteria. This criteria is built the same way you build logic in workflows.

Discards

Discarding a record in the trigger, rather than filtering in a decision node, is helpful because it's more efficient and faster than relying on a decision node. When a workflow execution is discarded, Middle does not keep a record of why it was discarded. Therefore, you should only discard records on criteria that is foundation to a workflow. Discards are particularly useful for when you are handling a large data resource and only anticipate a sliver of those records making it through the workflow.

Requeues

Oftentimes, workflows have related records that are crucial to a workflow's completion. For example, say you're running a workflow on sales data, but you also need the client's data. It's possible that Middle has not yet synced the client's data. If that's the case, when the workflow runs it will fail because it doesn't have a synced client record to key into. To keep this from happening, you must construct some logic to check if all needed records are synced before the workflow runs. You are also able to determine a time limit for how long a record will be requeued, while Middle is syncing the missing data, before the record is discarded.

Scheduled workflows

To run a workflow at a specified time, you will setup a scheduled workflow. You have the option to schedule workflows to run hourly or daily. When you create a new scheduled workflow trigger you will just need to select the time and timezone you want the workflow to run everyday. Then, select the workflow you want to run. Scheduled workflow don't have data inputs since there is no record being passed in by the trigger. For scheduled workflows you will want to delete any input in your begin node. Scheduled workflows pair nicely with bulk workflow executions. Once you're done setting up your trigger just click save!

Say you don't want a workflow to run everyday, you can create a decision node on your workflow to look at Now and determine if you want the workflow to run on that given day.

Last updated