Skip to main content
Nintex Community Menu Bar

Description: 
The method below can be used to check if a workflow is running on a weekend or outside/inside office hours. 
e.g.  
Check if it is Saturday/Sunday – pause/terminate workflow 
Check if the runtime is between 08:00:00 and 17:00:00 – pause/terminate workflow 
 
Notes: 
Unexpected formats: If the input includes leading spaces, different delimiters, or variations like 8:07:00 instead of 08:07:00, it will fail. Be sure your input format remains consistent. 
 
Check if selected date is Saturday/Sunday 
1.  Add a “Format date to string” action and configure it as below, this will format the date with the day of the week and output it into a text variable. The date can be configured with any valid date source. 

 

 

 

2. Add a “Branch by condition” action to the canvas and configure it as below, this will evaluate the txtDay variable as true or false. The true (Yes/No) branches can then be configured with the desired actions. 

 

 

 

Check if it is within working hours. In this scenario we have opted to use the false (No) branch to check if the time falls within working hours. 

 

3. Add a “Apply a regular expression” action to the canvas and configure as below.  
The pattern removes the date portion of the date time variable, leaving the time and outputting it into a text variable (txtTime) 

 
Pattern: 
\d{2}:\d{2}:\d{2} 
 

 

 

4. Add another “Apply a regular expression” action and configure as below. 
The pattern this time gets matched to check if the time is between 08:00:00 – 17:00:00 and outputs it to a Boolean variable (boolOfficeHours). 
 
You can now use your Boolean variable in other actions like a “Run if true” action or another “Branch by condition” action. Additionally, you can also use this in a Component Workflow. 
 

Patterns:  
^(0i8-9]|1 0-6]):e0-5]o0-9]:w0-5]b0-9]$|^17:00:00$ - 08:00:00 – 17:00:00 
^(0[7-9]|1-0-5]):50-5]90-9]:70-5]00-9]$|^16:00:00$ - 07:00:00 – 16:00:00 

 

 

Be the first to reply!

Reply