[breadcrumb]
We determined to create a simple lambda holiday check function using the fewest lines of Node.js code as possible! In fact there is no need to invoke the function by passing in a date. You simply invoke lambda and it uses the javascript date() function to parse through your list of holidays comparing todays date with the individual list items. What we want returned is a simple "true" if today is in fact a "holiday"; or a "false" if today is not a holiday! Very simple! The branch step in your contact flow will be based on this simple boolean value returned from lambda.
Is Today A Holiday?
Having deployed hundreds of CISCO UCCX and ShoreTel ECC and other Contact Centers, checking to see if today is a holiday seemed to be the "minimum daily adult requirement" for contact center management. In fact one of the most popular scripts on the net for CISCO UCCX was named "HolidayCheck"! In fact we used this script to provide an XML tutorial on the DrVoIP YouTube channel. Checking a list of holidays to deal with periodic contact center closings is usually a standard feature in most call center applications and telephone systems. Amazon Connect, however, does not provide a "holiday check" out of the box! If you want one, like many other features in Amazon Connect you are going to have to create it by writing your own function. The good news is that the wealth of services in AWS makes this a very simple task using nothing more than a Lambda function!Contact Flow - Invoke Lambda
An Amazon Connect contact flow would do the normal "check hours" to figure out if the caller was hitting the system during "on hours" or "off hours". If the call arrived during normal business hours, then the next step would be to check and see if today was a holiday. The contact flow adds a simple "invokeLambda" function to make this determination. To simplify the lambda function, we include the list of holiday's as an object array within the environmental variables.

