How to turn a Zap OFF and ON with a schedule

  • 22 September 2021
  • 0 replies
  • 57 views
How to turn a Zap OFF and ON with a schedule
Userlevel 4

Hey Zapier Community,

Jared here from Zapier Support.

There can often be business processes or workflow needs that require us to turn a Zap OFF and/or ON on a scheduled basis.

Below I cover 2 scenarios where this might be useful.

Scenario 1: Deduplication

With Polling and Hybrid Triggers - Zapier uses a process called Deduplication to isolate new records that will trigger the Zap.

Here’s a Quick Summary of how Deduplication works.

  1. When we turn the Zap ON - Zapier identifies the existing records and keeps track of them on a Deduplication Table. We don’t trigger the Zap for these existing records - only records that are added after the Zap is turned on.

  2. Typically the Deduplication ID that’s used to identify existing records is the Record ID from the App record.

  3. Once we’ve seen that ID - we add it to the deduplication table - and won’t trigger on it again.

  4. Every time we turn the Zap OFF and then ON again - the deduplication table is rebuilt with the existing records at that time.

A Real World Example from Pipedrive

I have a Custom Field on my Pipedrive Deals for “Needs Review” where the values can be Null, Yes or No.

 

When the value is Set to Yes - the Deal is added to a Filter View in Pipedrive.

 

And I have a Zap which triggers on New Deal Match Filter (which is a Polling Trigger).

 

If I were to turn that Zap ON in the state of things above - Deal ID 89 would be found when the Zap is turned ON and the Zap would NOT trigger - since that deal already exists in the filter at the time we are turning the Zap On.

After I review the Deal - I set the Flag back to Null or No - which removes it from the Filter View.

I always do this by the end of the day - so the Filter View is empty by the end of the day.

But my business process is such that this Needs Review field can be set to YES again tomorrow - and the Deal would be added to the View again.

However the Zap won’t trigger again since Deal ID 89 is already in the Deduplication table.

Zap 1: Turn Zap OFF/ON Nightly

The solution here is to create a Zap to turn my Zap above OFF and then ON again every night.

This will rebuild the deduplication table for the Zap - enabling Deal ID 89 to trigger the Zap again tomorrow.

To do this - we’d use the following Zap.

Step 1 Trigger - Schedule by Zapier

For the trigger - we’ll use Schedule by Zapier and set it to trigger every day at Midnight.

Note that the Timezone settings in the Zap may not apply to the trigger time and instead may use the Timezone Settings on the profile or default to UTC. So it’s important to test this Zap to make sure it is triggering at the expected time.

 

And we could set this to happen on a more frequent basis if needed (such as hourly) - but the potential for missed records might increase as every hour the Zap would be off for a short period of time.

Step 2 Action - Zapier Manager Turn Zap Off

Step 2 will be a Zapier Manager Turn Zap Off action. 

Here we want to make sure to select the Account from the dropdown menu (in addition to the Desired Zap State and Zap).

 

Step 3 Action - Delay for 1 Minute

While this step might not technically be necessary - I like to add a 1 minute Delay For action just to give things a minute to turn off before turning the Zap back on.

 

Step 4 Action - Zapier Manager Turn Zap On

Step 4 will be a Zapier Manager Turn Zap On action. 

Here again - we want to make sure to select the Account from the dropdown menu (in addition to the Desired Zap State and Zap).

 

Scenario 1 Deduplication Summary

In this scenario - we have a business process that requires us to trigger a Zap multiple times for the same record.

Records are added and removed from the Filter View daily.

So we’ve created a Zap that triggers every night to turn the Main Zap OFF and then ON again.

This resets the deduplication table for the Zap enabling the next day’s records to trigger the Zap.

Now all that’s left is to turn the Zap On and let it do its work every night.

Scenario 2: Mass Record Updates

Another common scenario for turning a Zap OFF/ON with a schedule is mass updates to a source system.

This scenario usually plays out like this.

  1. I have a Zap that triggers on New or Updated Records

  2. On a periodic basis (weekly or monthly) - an automated process adds or updates records

  3. I don’t want the Zap to trigger for records added or updated during this routine update process

A Real World Example from ActiveCampaign

I have a Zap that triggers when there is a New or Updated Contact in ActiveCampaign.

 

This is an Instant trigger - meaning as soon as the contact is added or updated - ActiveCampaign sends Zapier a webhook with the details for that contact and the Zap triggers.

On the 1st of every month - my billing system generates a list of email addresses that made a purchase last month and sends me an email with a CSV attachment with the customer email addresses.

I have another Zap that triggers on this email - imports the CSV and adds a Tag to each ActiveCampaign record.

That Zap looks like this:

 

The problem is - every record that is created or updated by this monthly Zap will also trigger my New or Updated Contact Zap above - causing a lot of extra Zap Runs that I don’t need or want.

Zap 2: Turn Zap OFF/ON Monthly

The solution - is the same as it was in Scenario 1.

We want to make a 3rd Zap that will turn my New or Updated Contact Zap OFF while my monthly update is happening.

In this case - I know that my system will send me the CSV file on the 1st of each month just after 1 AM but sometimes this can be delayed up to 30 minutes.

So the Zap structure is the same as Scenario 1 - I’d just make adjustments to the Schedule in Step 1 and the Delay in Step 3. 

Step 1 Trigger - Schedule by Zapier

For the trigger - we’ll use Schedule by Zapier and set it to trigger on the 1st of every Month at 1am.

Note that the Timezone settings in the Zap may not apply to the trigger time and instead may use the Timezone Settings on the profile or default to UTC. So it’s important to test this Zap to make sure it is triggering at the expected time.

 

Step 2 Action - Zapier Manager Turn Zap Off

Step 2 will be a Zapier Manager Turn Zap Off action. 

Here again we want to make sure to select the Account from the dropdown menu (in addition to the Desired Zap State and Zap).

 

Step 3 Action - Delay for 35 Minutes

In this scenario - we definitely need the delay - since I’m not sure exactly what time the Email will be received - I just know it will be between 1-1:30am.

So I’ll set the delay for 35 minutes to give myself an extra 5 minute buffer.

 

Step 4 Action - Zapier Manager Turn Zap On

Step 4 will be a Zapier Manager Turn Zap On action. 

Here again - we want to make sure to select the Account from the dropdown menu (in addition to the Desired Zap State and Zap).

 

Scenario 2 Mass Record Update Summary

In this scenario - we have a mass update that will happen each month at the same time.

We have another Zap that would typically trigger on these updates - and we want to turn it off while the mass update is happening - so the Zap doesn’t trigger.

The solution again is a four step Zap using Schedule by Zapier and a Delay action.

This will prevent the normal New or Updated Zap from triggering since it will be OFF during the mass update.

Summary

Zaps will trigger for “new” records that are added while they are on.

Sometimes - like in the case of deduplication - we want the Zap to trigger for records multiple times.

In order to do that - we have to reset the deduplication table which can be accomplished by cycling the Zap OFF and then ON again.

In other cases - such as with a Mass Update - we don’t want the Zap to trigger during the period our automatic update is happening every month.

Using the straightforward Zap structure outlined above - we can schedule a Zap to be turned OFF and ON at specific times every hour, day, week or month.

This will work to reset the deduplication table as well as keep the Zap off at times we don’t want it to trigger.

If you do give that a try - I’m always happy to hear your experience in the comments below. :)


0 replies

Be the first to reply!

Reply