A workflow may run perfectly on an ordinary Tuesday and still create a poor customer experience on a holiday. It might assign a task that no one will see, promise a same-day response when the office is closed, or move a record into a process that depends on staff availability.
This HubSpot workflow uses a custom-coded action to determine whether the current date is a configured holiday in the HubSpot account timezone. It writes a Yes or No value to one contact property, stores the holiday name in another, and returns both values as workflow outputs.
For example, if the workflow runs on Thanksgiving Day, the contact can be marked as occurring on a holiday and the holiday name can be stored as “Thanksgiving Day.” Later actions can delay follow-up, route the contact to an on-call queue, or send messaging that sets the correct response expectations.
The Workflow
1. Enroll the contact
Like the previous date and time examples, this workflow can be tested with a manual enrollment trigger followed by one custom-coded action. Manual enrollment makes it easy to confirm that the action updates the correct properties and returns the expected outputs.
In production, the same code can be inserted after a form submission, ticket creation, lifecycle-stage update, new deal, or another event where the business needs to know whether the current day is a working day or a configured holiday. Re-enrollment can be enabled when the same record may pass through the process more than once.
2. Configure the holiday properties
The configuration section defines two destination properties. The first is a Yes/No dropdown property named is_holiday. Its internal options must match the values Yes and No. The second is a single-line text property named holiday_name.
When the date matches a configured holiday, the workflow stores Yes and the corresponding holiday name. When there is no match, it stores No and clears any previous value from the holiday-name property. Clearing the old value prevents a contact from carrying an outdated holiday name after being processed again on a normal day.
3. Maintain a configurable holiday calendar
The code stores holidays in a JavaScript object where each key is a date in YYYY-MM-DD format and each value is the visible holiday name. The supplied example contains an observed United States federal holiday calendar for 2026.
This approach keeps the calendar easy to understand and edit. Users can add regional holidays, company closure dates, religious observances, special events, or dates that apply only to a specific business. They can also replace the entire calendar for another country or operating region.
Because the dates are maintained inside the code, the calendar must be reviewed and updated for future years. A more advanced variation could retrieve holiday dates from an external service, a HubSpot custom object, or another maintained data source.
4. Calculate the date in the HubSpot account timezone
The action reads the private app token from the CUSTOM_CODED workflow secret and receives the enrolled contact ID from the workflow event. It then calls HubSpot’s Account Information API to retrieve the timezone configured for the portal.
The code uses that timezone to calculate the current year, month, and day. The parts are combined into a YYYY-MM-DD string so the result can be compared directly with the dates in the configured holiday calendar. This avoids relying on the server timezone, which could produce the wrong date near midnight.
How the Custom Logic Works
The excerpt below shows the core holiday configuration, timezone-safe date calculation, holiday lookup, CRM update, and workflow outputs. The complete action also includes request validation, logging, and error handling.
const IS_HOLIDAY_PROPERTY = "is_holiday";
const HOLIDAY_NAME_PROPERTY = "holiday_name";
const HOLIDAYS = {
"2026-01-01": "New Year's Day",
"2026-05-25": "Memorial Day",
"2026-07-03": "Independence Day (Observed)",
"2026-11-26": "Thanksgiving Day",
"2026-12-25": "Christmas Day"
};
const accountResponse = await hubspotRequest(
"https://api.hubapi.com/account-info/v3/details",
{
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`
}
}
);
const accountDetails =
await accountResponse.json();
const accountTimezone =
accountDetails.timeZone;
const parts = new Intl.DateTimeFormat(
"en-US",
{
timeZone: accountTimezone,
year: "numeric",
month: "2-digit",
day: "2-digit"
}
).formatToParts(new Date());
const dateParts = Object.fromEntries(
parts
.filter((part) =>
["year", "month", "day"].includes(part.type)
)
.map((part) => [part.type, part.value])
);
const { year, month, day } = dateParts;
const today = `${year}-${month}-${day}`;
const isHoliday =
Object.prototype.hasOwnProperty.call(
HOLIDAYS,
today
);
const isHolidayValue =
isHoliday ? "Yes" : "No";
const holidayName =
isHoliday ? HOLIDAYS[today] : "";
await hubspotRequest(
`https://api.hubapi.com/crm/objects/` +
`${CRM_API_VERSION}/contacts/${contactId}`,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
properties: {
[IS_HOLIDAY_PROPERTY]:
isHolidayValue,
[HOLIDAY_NAME_PROPERTY]:
holidayName
}
})
}
);
callback({
outputFields: {
is_holiday: isHolidayValue,
holiday_name: holidayName
}
});
5. Update the record and continue the workflow
The action updates both properties in one PATCH request and returns is_holiday and holiday_name as workflow outputs. Those values can be used immediately in branches without requiring another property lookup.
A Yes branch could delay the next action, change the task due date, notify an on-call owner, or send a holiday-specific confirmation email. A No branch could continue through the standard business process.
The same pattern can be adapted for companies, deals, tickets, or custom objects. It can also support separate calendars for different offices, regions, service teams, or customer locations.
Use Cases
1. Holiday-safe lead follow-up
Prevent workflows from promising immediate outreach when the sales team is unavailable. Holiday submissions can receive a different confirmation message and enter a next-business-day follow-up path.
2. Support and SLA management
Apply different response expectations to tickets created on company holidays. Critical requests can be routed to an on-call team, while routine requests wait for the next working day.
3. Task and deadline control
Avoid assigning tasks with due dates that fall on days when employees are not working. The holiday result can trigger a delay or support a later action that calculates the next available business day.
Wrapping Up
This workflow helps HubSpot distinguish between an ordinary business day and a configured holiday. The custom code checks the date in the account timezone, stores the result, records the holiday name, and gives later workflow steps a reliable signal for routing and scheduling.
No Bounds Digital helps organizations design AI-powered HubSpot workflows, custom-coded actions, custom object solutions, and CRM automation tailored to real operating processes. Contact No Bounds Digital to explore how custom development and AI services can turn your HubSpot data into faster, more intelligent action
