# \[notification pipeline\] Wait until a specific time to send notifications

**URL:** <https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080>\
**Category:** Ignition\
**Created:** [March 29, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080 "2024-03-29T17:29:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 29, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/1 "2024-03-29T17:29:19Z")

</div>

Hello Folks,

I have a type of alarms that should send notifications only during working hours, let's say 8am-6pm.  
But, if an alarm triggers outside of this time window, it should wait until 8am and then, if the alarm is still active, start sending notifications.  
I'm not sure of how to approach that.

Add to that that notifications are tried n times before being escalated to a different pipeline, and ideally the whole thing should be delayed until the day shift starts.

So I'm once again asking your wisdom.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 29, 2024, 5:47pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/2 "2024-03-29T17:47:26Z")

</div>

Have you tried something like this yet?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/8/48968e967fc7c76451261d7d6dadcca018deafc8.png)

Expression:

```auto
timeBetween(now(),"8:00:00 am", "6:00:00 pm")

```

Theoretically it should keep an alarm in pipeline delay limbo until it finally turns 8AM or until it drops out of the pipeline.

I don't know what this would do to performance if there were many alarms trapped like this though.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 29, 2024, 6:22pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/3 "2024-03-29T18:22:05Z")

</div>

I'm a bit worried about keeping many pipelines alive like this, to be honest.  
But I guess if delay blocks use their own async thread it could be fine ?

Also another thing that has me worried is how messy it will all be when I try integrating that into the rest of the pipeline. Because there's not just one shift, but only one needs to be delayed like this.

I don't know, I guess it's not as difficult as I'm making it to be, but I'm just struggling to make all the pieces of the puzzle fit together.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 29, 2024, 6:42pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/4 "2024-03-29T18:42:25Z")

</div>

This _would_ work, except it won't, because Pipelines have a hardcoded max transition count of 1024 (arbitrarily chosen) to prevent an event cycling through infinitely.

If you increased the delay enough you could sneak in under the limit, at the expense of increasing the possible amount of time after 8:00am before it pops out of the delay block and goes to notify.

edit: oops, read it wrong, even 1 minute should be under the 1024 transition limit. Thought it was 1 second.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 29, 2024, 7:00pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/5 "2024-03-29T19:00:46Z")

</div>

Would you say it's the way to go ?  
Frankly, even if the notifications start popping up at 8:05 or even 8:10 am, it's probably fine.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 29, 2024, 7:02pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/6 "2024-03-29T19:02:43Z")

</div>

I can't think of any other solution. It would be a little simpler but conceptually the same if the Delay block accepted an expression for the delay value... alas.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 29, 2024, 7:03pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/7 "2024-03-29T19:03:50Z")

</div>

Yes, I found out bitterly that delay blocks can't take parameters.  
Any reason they don't ? Possible improvement in the future ?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 29, 2024, 7:05pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/8 "2024-03-29T19:05:23Z")

</div>

Could be an enhancement. The only downside I can really see is that it could make troubleshooting and understanding the current possible state of the pipeline a bit more difficult. That's kind of true anywhere you involve an expression though.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 29, 2024, 7:08pm UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/9 "2024-03-29T19:08:18Z")

</div>

Well I'm using a loop on a 5s delay block, with an iteration counter, checking for `counter * 5 >= event['delay']`, I doubt a delay block with `event['delay']` as argument would make debugging harder

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 30, 2024, 7:16am UTC](https://forum.inductiveautomation.com/t/notification-pipeline-wait-until-a-specific-time-to-send-notifications/88080/10 "2024-03-30T07:16:40Z")

</div>

Just in case you haven't noticed that yet: You can reverse pipeline blocks orientation. Right click on them, you'll find the option there.
