Setting up the flow for the holiday October 17, 2022 15:07 Updated Index: Introduction Setting up the flow Customizing holidays Introduction The objective is to explain how to set up the bot flow in a simple way to check if a certain day is a holiday and transfer it to a specific flow, such as a notification message informing that that day has no service. Setting up the flow Access the block that will apply the settings and create an input action of the run a script type, change the script's naming to checkHoliday. It is not necessary to pass input variables. Save the script's return in a variable called isHoliday Use the following script function run() {const today = new Date();const holidays = ["01-01", "15-04", "21-04", "01-05", "16-06", "07-09", "12-10", "02-11", "15-11", "25-12", "14-10"];const month = ((today.getUTCMonth() + 1) <= 9) ? "0" + (today.getUTCMonth() + 1) : (today.getUTCMonth() + 1);const day = today.getUTCDate() <= 9 ? "0" + today.getUTCDate() : today.getUTCDate();const monthDay = day + "-" + month;return holidays.includes(monthDay);} Note: Delete the script that comes by default, paste the code above and press control + s to save. 4. In the block where the script was configured, go to the output conditions tab and create two conditions, the first one checking if the isHoliday variable is equal to true, if so, it will go to a desired block where it is informed that it is a holiday, if it is false will follow the normal flow. 5. Publish the flow. Customizing holidays By default, the script already brings some national holidays, there are some guidelines below on how to include or exclude holidays. Any change of dates must be performed only in the command below: let holidays = ["01-01", "15-04", "21-04", "01-05", "16-06", "07-09","12-10", "02-11", "15-11", "25-12"]; Include The inclusion of a new date must always be performed in the “dd-MM” format, if you use another symbol such as a slash (/) in place of the hyphen (-) it will not work, example of inclusion of the 31-12th. Add a comma Enter the desired date in the pattern “dd-MM” in double quotes Press control + s to save the script Publish the flow let holidays = ["01-01", "15-04", "21-04", "01-05", "16-06", "07-09","12-10", "02-11", "15-11", "25-12", “31-12”]; Note: As a good practice, it is suggested to include the date in chronological order to facilitate future changes, example: holiday 28-02 (carnival), must be included between 01-01 and 04-15, as shown below. ["01-01", “28-02”, "15-04", "21-04", "01-05", "16-06", "07-09","12-10", "02-11", "15-11", "25-12"]; Exclusion The exclusion of a specific date must be accompanied by the exclusion of a comma, as each holiday must be separated only by a comma. Example before: let holidays = ["01-01", "15-04", "21-04", "01-05", "16-06", "07-09","12-10", "02-11", "15-11", "25-12"]; Example after deleting 15-04 let holidays = ["01-01", "21-04", "01-05", "16-06", "07-09","12-10", "02-11", "15-11", "25-12"]; Structure suggestion The suggestion below uses the human service template bot available, it is important that the implementation is suitable for the structure of each bot. Create a new block called 1.0 - Check holiday that will receive the settings detailed above. Create a new block called 1.1 - It's a holiday that will have a message informing that on the given day there is no service due to the holiday and directing its standard output to the Start of the flow, or redirectioning it to the main bot, in case of router use. In block 1.0 - Check holiday, create two output conditions to check the variable isHoliday, if true, send it to 1.1 - It's a holiday, if false, send it, go to the time check block For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles How to configure the new interface in your bot's opening hours How to reset users through Beholder? Report of Support Registration of Tags by Line FAQ - Service