See llms.txt for all machine-readable content.

Back to Templates

Skip weekends and public holidays in schedules with Nager.Date

Quick overview

This workflow runs daily (or as a sub-workflow) and checks whether a given date is a business day by combining weekday rules with public-holiday data from the Nager.Date API, then routes execution to a “continue” or “stop” branch.

How it works

  1. Triggers every day at 7am, runs manually, or is called by another workflow with optional override inputs.
  2. Loads gate settings like country code, subdivision/region, timezone, working days, and an optional check date.
  3. Calculates the date to evaluate and requests public holidays for the current year and next year from the Nager.Date (nagerholidays.com) API.
  4. Determines whether the checked date is a business day based on working weekdays, matching national or subdivision holidays, and any custom closed/ignored dates, with a configurable fallback policy if holiday data is unavailable.
  5. Calculates the next business day (up to 31 days ahead) and outputs decision details like reason, holiday name, and warning messages.
  6. Routes execution to a “Continue: business day” path when it is a business day, or to a “Stop: not a business day” path otherwise.

Setup

  1. Update the gate defaults in the Set gate config step, including countryCode, subdivisionCode (optional), timezone, workingDays, and optional holidayTypes.
  2. (Optional) Set extraClosedDates, ignoreHolidayDates, and onHolidayDataFailure to match your business rules and desired behavior when the Nager.Date API is unavailable.
  3. Replace the “Continue: business day” branch with your real scheduled task, or call this workflow from another workflow and pass overrides (for example, checkDate and countryCode).