Knowledge Center next icon How to setup 'Active Hours' in workflows
Dec 16, 2022
6 minutes read

How to setup 'Active Hours' in workflows

Goal

Understand how to setup ''Active Hours'' in workflows and what it does.

Active Hours can be seen as a wait gate for continuing to the next step in a workflow. This way, you can support cases that require communication only to be send out during business hours for example.

We choose to do this in a workflow step and not on general account level as now you have the flexibility to setup different windows based on your use case. You can even use different windows in 1 workflow.

*Do note that this is only a gate on the CDP workflow side, we have no influence on the actual sending of the campaign as this also involves campaigns, messaging, operators etc.

Product

  • Mobile Marketing Cloud

    • Customer Data Platform

      • Workflows

Steps

In the workflow editor, the Wait Until step is extended with an option to configure the active hours. You can setup the wait until step with a specif date, just use active hours without a specif date or do a combination of both.

You can setup a window of active hours, during which you do want to send out communication (or go to the next step in that matter). Any profile or event (depending on your trigger) with a date outside this window will end up in the queue, waiting for the next active hour window.

You can set different windows for different days of the week and the most restrictive setting counts. So if you are mixing the 'Date specified in the event property' with active hours, we first check the date property and then the active hours. So it can happen that based on the date property you can continue, but the active hours is restricting this. Then it will wait until the first active hour window.

Single time-span


Example of a single timespan, where during all weekdays the active window is from 09:00 to 15:00 and no window in the weekend.

A profile got triggered based on an incoming event on Tuesday at 16:00, this is outside the active window and therefore this profile is now waiting until Wednesday 09:00.

A profile got triggered based on an incoming event on Friday at 16:00, this is outside the active window and therefore this profile is now waiting until Monday 09:00 (weekend has no active hours)

image.png

Multiple time-spans

You can also setup multiple timespans. In the below case we have 2 time-spans during the week and no time-spans during the weekend.

Anyone who enters the step Friday after 08:00, will only continue to the next step on Monday 09:00 as there is no active window in the weekend.

Anyone who enters the step from Monday till Friday between 15:01 and 17:09, will continue to the next step at 17:10 that day.

image.png

Different time spans per selected day

You can also set different time spans per selected day, tick the box if you want to set this up.

image.png

You can use this for example if from Monday till Friday your opening hours are from 09:00 till 17:00, but on Wednesday you close at 13:00 and don't want to have communication send out after this time. Now we will wait until Thursday 09:00.

When a day is not enabled, you can't set the hours (grayed out). If you want to set hours for this day, you first need to enable the day by clicking on it.

image.png

Combining active hours with a date or birthday type property

When using the combination of a date specified on the event property and active hours, please pay attention that this does not work for dates in the past. Meaning, active hours checks if the date/time has already passed and for these type of properties this has passed already (most of the times). So the window will 'wait' until a date in the past, and therefore continues immediately.

Example:

Let's say below is your birthday and you don't use the Anniversary trigger, but added the anniversary date in the wait until property in the wait until step.

image.png

When entering the flow and checking active hours, the active window is everyday between 16:53 and 20:00. So we 'wait' until 2002-12-16 16:53. This time has passed already so we continue directly to the next step.

image.png


How could you still achieve this?

If you're still looking for this type of flow and for some reason can't use the anniversary step for this, you set it up by creating a wait until step, which waits until the date property on the event and then adding a new wait until step using the active hours.

Good to Know

  • Don't let your active window come down to minutes, as there can be delays in the actual sending of the message as we don't have influence on that (messaging, operator etc.)

  • It can happen that there is a queue of events, but the event got send at 19:00, which falls in the active hours window. But only at 20:15 the event got profiled and the step got triggered. We don't continue as at the time the step got triggered the window is not active anymore. We'll wait for the next work day 09:00.

  • Do not use overlapping hours, this will result in an error in the workflow log for the wait until step.

Error: None or multiple event type property/properties found.

image.png

  • When you have an event added workflow and in your wait until step you use the date on event property, but this property is not in your added event, the workflow will result in an error for this step

Error: NoWaitDateFoundException: No date found on property (fff5b11f-c6a5-56fa-ba92-87bd27281efd/Date of birth) in Event

  • Dates in the past always pass immediately (mostly when using birthday type properties in the wait until step for example in combination with activate hours)

  • When you enable active hours, but don't fill any active window, then the system sees this as no active hours available and continues to the next step immediately.

  • Edits in active window, take the following example. Workflow wait step triggered on Saturday 08:00 and is scheduled to wait till Monday 08:00. Saturday on 22:00 the active hours are edited to also have a Sunday 08:00- 22:00. Current ActiveHours implementation does NOT reschedule the already scheduled jobs.

  • Frontend shows the local timezone of the browser. Times are saved in UTC in the back-end.

image.png


Test case examples

Below some additional test case examples that were covered and the expected result.

WaitDateProperty value

Offset

Active Hours windows

Result

undefined

undefined

undefined

Should not save
Should throw StepMisconfiguredException when attempted to run

Monday - 14:00:00

5 hours after

undefined

Monday - 19:00:00

Monday - 14:00:00

undefined

Monday | 13:00:00 - 15:00:00

Monday - 14:00:00

Monday - 12:00:00

undefined

Monday | 13:00:00 - 15:00:00

Monday - 13:00:00

Monday - 16:00:00

undefined

Monday | 13:00:00 - 15:00:00

Monday - 13:00:00
(next week)

Monday - 09:00:00

5 hours after

Monday | 13:00:00 - 15:00:00

Monday - 14:00:00

Monday - 05:00:00

5 hours after

Monday | 13:00:00 - 15:00:00

Monday - 13:00:00

Monday - 11:00:00

5 hours after

Monday | 13:00:00 - 15:00:00

Monday - 13:00:00
(next week)

undefined

undefined

Current day with window starting after current time

Adjusted to start of ActiveHours window

undefined

undefined

Current day with window encapsulating current time

No change in target time

undefined

undefined

Current day with window before current time

Adjust to start of ActiveHours window a week later

group icon
Get support

Can’t find the answer you are looking for?
Ask for the help of our chatbot, or get in touch with our support team.

Contact Support
Is this region a better fit for you?
Go
close icon