Question

How do I delay of 15hrs of business days only

  • 8 February 2023
  • 8 replies
  • 301 views

Userlevel 1
Badge +1

I would like to add a 15 hr delay to Zapier, but I want the delay to follow a business day, so if zap runs on Friday night, then the delay would be released on Monday not Saturday.

How can I do that?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +11

Hi @Fahad, welcome to the Community! 🙂

We have an article in Community that discusses how to delay Zaps so that they only run during business hours which I think should be helpful to you in setting up the desired workflow here:


Hopefully that helps to get you started. Please do let us know if you run into any issues on that at all!

Userlevel 1
Badge +1

Hi @Fahad, welcome to the Community! 🙂

We have an article in Community that discusses how to delay Zaps so that they only run during business hours which I think should be helpful to you in setting up the desired workflow here:


Hopefully that helps to get you started. Please do let us know if you run into any issues on that at all!


I did go through it before, but it doesn’t align with what am trying to do.

That Article is for delaying until a specific time and am delaying for specific hours

Userlevel 7
Badge +8

Hi @Fahad 

 

It would be exactly the same setup. When would you release it on Monday? 8 AM? 

Userlevel 1
Badge +1

Hi @Fahad 

 

It would be exactly the same setup. When would you release it on Monday? 8 AM? 

I dont understand, I want to add a 15 hrs delay only, not delay until a certain time like 8am or something.

For example: if the automation triggers on Thursday 12am then I want the delay to hold for 15hrs before continuing, not sure how the lookup table with the dates can help in here.

Or am I missing something?

Userlevel 7
Badge +8

I mean, if it's Friday, and the delay for 15 hours will put it in Saturday noon, you want to release it on Monday, what time? 

Userlevel 1
Badge +1

I mean, if it's Friday, and the delay for 15 hours will put it in Saturday noon, you want to release it on Monday, what time? 

I dont have a specific time to release them, I just want to add a 15hrs delay from the date and time the trigger happens.

If something happens on Friday night, then I want the delay to resume from Monday 12:00 am onwards till the 15 hour mark is completed.

Does that make it clear?

Userlevel 7
Badge +8

That makes it a bit complicated but nothing cannot be solved.

 

It would need a bit of complicated Code by Zapier step to do this calculation 

Userlevel 6
Badge +8

This Python Code step should be pretty close to what you need:

 

from datetime import datetime, timedelta
from dateutil import tz

my_timezone = tz.gettz('US/Pacific')
now = datetime.now(my_timezone)
release_time = now + timedelta(hours=15)

if release_time.weekday() == 5:
    release_time = release_time + timedelta(hours=48)
elif release_time.weekday() == 6:
    release_time = release_time + timedelta(hours=24)

output = [{'release_time': str(release_time)}]