Skip to content

Conversation

@shivamvish160
Copy link
Contributor

Business Calendar Validator

The Business Calendar Validator is a custom Flow Action for ServiceNow that checks whether a given date/time falls within business hours, holidays, or maintenance windows defined in a Business Calendar.


📌 Description

This action helps automate decisions based on business schedules. It supports validation against:

  • Business Hours
  • Holidays
  • Maintenance Windows

⚙️ Inputs

Name, Type, Description, calendar_name, StringName of the Business Calendar to use| input_datetime | DateTime | The date/time to validate (format: YYYY-MM-DD HH:mm:ss) |
| check_type | String | One of: Business Hours, Holiday, Maintenance Window |
| timezone | String | Optional timezone (e.g., Asia/Kolkata) |


📤 Outputs

Name, Type, Description, is_valid, True if the input datetime is valid| message | String | Human-readable result message |
| next_valid_time | DateTime | Next valid time slot (only for Business Hours check) |


🚀 Usage

Use this action in Flow Designer to:

  • Validate scheduling logic
  • Suppress alerts during holidays or off-hours
  • Route tasks based on calendar rules

✅ Example: Valid Input

Valid Input

{
"calendar_name": "8-5 weekdays",
"input_datetime": "2025-10-10 14:30:00",
"check_type": "Business Hours",
"timezone": "Asia/Kolkata"
}

Output

{
"is_valid": true,
"message": "Within business hours.",
"next_valid_time": ""
}

Invalid input

{
"calendar_name": "8-5 weekdays",
"input_datetime": "2025-10-12 14:30:00",
"check_type": "Business Hours",
"timezone": "Asia/Kolkata"
}

Output

{
"is_valid": false,
"message": "Outside business hours.",
"next_valid_time": "2025-10-13 08:00:00"
}

@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@bird-03 bird-03 self-assigned this Oct 10, 2025
@bird-03 bird-03 added the hacktoberfest-accepted Manual accept mark label Oct 10, 2025
@bird-03
Copy link
Contributor

bird-03 commented Oct 10, 2025

@shivamvish160

Thanks for your contribution!!

I can see this can add value in many areas on platform like scheduling a change with right coordinator and there availability and plan better upgrades and helps automate decisions based on business schedule.

Keeping contributing and happy hacking!

@bird-03 bird-03 merged commit ae65f48 into ServiceNowDevProgram:main Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Manual accept mark

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants