Agentic workflows use a model to decide what should happen next inside a process. In this n8n example, the model distinguishes a public holiday question from a request about office hours. A separate check asks for missing details before it can look up a holiday. Build it in three steps, from importing the workflow to checking its output against the government calendar.
Decide what the model needs to do
Suppose someone types “Is our Scotland office open on 2026-11-30?” The location and date are clear, but the question is about opening hours. The same date in “Is 2026-11-30 a bank holiday in Scotland?” belongs in a lookup. A model can route the questions differently. Once the route is chosen, straightforward code can check the required fields and compare them with the calendar. If the input is already a form with a date picker and a region dropdown, you can send it straight to the lookup. Anthropic’s guide to agents and workflows · How agentic and generative AI differ
The government publishes separate lists for Scotland, Northern Ireland, and England and Wales. Entries carry a date, a title, and sometimes a note. That note matters when a holiday is observed on a substitute day. The schedule for a specific office or shop comes from a different source entirely. This workflow returns that distinction as part of its output, so a question about opening hours can reach a colleague who holds the real schedule. GOV.UK calendar · Public JSON feed
1. Import the workflow and run it with your model
Download the n8n workflow JSON. In an n8n workflow, open the menu and choose Import from File. The workflow is inactive on import and starts from a manual trigger, so you can inspect it before running anything. Open Enter questions. It contains the questions, their IDs, the model name, and the endpoint. The calendar address is configured separately in the HTTP node. n8n import instructions
The default model setting expects an OpenAI-compatible endpoint at http://127.0.0.1:11434/v1/chat/completions with the model qwen2.5:1.5b. A local Ollama setup is one way to provide it. If n8n runs in Docker and Ollama runs on the same machine, set the endpoint to an address reachable from the container. On Docker Desktop, host.docker.internal points at the host. If you choose a service that requires authentication, configure credentials in the request node. The supplied workflow has no credentials. Ollama’s OpenAI compatibility guide · Docker Desktop networking
If you already run Ollama, download this model with ollama pull qwen2.5:1.5b. Before running the full set, confirm the runtime that hosts n8n can reach both the local model and the government feed. If it can reach the model only from your browser or host shell, the address may still be wrong for n8n. Run the first question by itself and check that the model request returns a label and the calendar request returns a list of events. Qwen2.5 in Ollama’s model library
Click Execute Workflow. Open Route with the local model after the run and look for the model’s response in choices[0].message.content. The prompt asks for a single label, HOLIDAY, OFFICE, or OTHER. Where the model is unavailable or returns unusable text, the validation node records router_unavailable. Check the URL and the model name before editing the prompt. You can run just one question by leaving its entry in the list and setting the others aside.
The model sees the question and a short instruction that defines the three routes. It returns a label before the workflow reads any calendar data. To check a different model, keep those instructions and the questions the same for your first run. If a model adds a sentence to its label, the validation node will report an unusable response. Open that response first. Models that support a constrained output format can enforce the three permitted labels at the service itself.
2. Check what happened after the route was chosen
Open Validate date and region and pick an item by question ID. The validation step requires one recognized division and a real date in YYYY-MM-DD format for holiday queries. A question missing a region leaves by the clarification branch. So does one with a date like 03/04/2026. A question about a particular office gets an instruction to check its real schedule. Only valid holiday lookups go on to the HTTP request.
Open Return calendar results to see the date, region, official source, and outcome. A matching event supplies its title and notes. not_listed means the requested day falls between the first and last published entries for that region and has no entry of its own. outside_coverage means the current list cannot settle the question. source_unavailable means the calendar request or response could not be used. Those statuses let you see what happened when the workflow has no holiday name to return.
| Input | Outcome to compare in n8n | What you should see |
|---|---|---|
Scotland, 2026-11-30 | listed | St Andrew’s Day, with a link to the official calendar. |
England and Wales, 2026-11-30 | not_listed | No entry for that date in the England and Wales list. |
England and Wales, 2026-12-28 | listed | Boxing Day with the substitute-day note. |
Scotland office open on 2026-11-30? | need_office_schedule | A request to check office hours through another source. |
Scotland, 2099-02-05 | outside_coverage | The published range and a link to the official calendar. |
Here is an excerpt from the Scotland result. The response also carries the original question and the calendar’s reported coverage. When you put the result in a chat reply, keep the region next to the title. St Andrew’s Day on its own would leave the reader to guess which calendar answered the question.
{
"id": "scotland-nov30",
"route": "HOLIDAY",
"division": "scotland",
"date": "2026-11-30",
"status": "listed",
"source": "https://www.gov.uk/bank-holidays",
"title": "St Andrew’s Day"
}
3. Run the same questions after every change
The ten-question check sheet includes the questions, expected outcomes, and recorded results. On November 21, 2026, all ten passed in n8n 2.31.7 using Qwen2.5-1.5B-Instruct through a local OpenAI-compatible endpoint. Seven reached the government feed, and three stopped at the clarification branch. The local test endpoint constrained the model to the three permitted labels. The source data is available under the Open Government Licence v3.0. Open Government Licence
For every clarification case, check where it went. If the office question went to the calendar, look at the model’s label. If the label was OFFICE and the workflow still made a request, look at the branch. If the region and date were correct but the holiday name was wrong, look at the data for that division. Keeping the ID on each output lets you follow the same question through these stages, even when several questions are running in a batch.
Use both pairs of regional questions. November 30 is a listed holiday in Scotland alone among the two divisions tested. August 31 gives the reverse result. A lookup that searches every event without reading the region may look right on one pair’s first question and still return two wrong matches across the sheet. Keep the check sheet’s original date alongside the actual run date; if a future government update changes an answer, you can tell which run used which result.
Try a source failure in a copy. Temporarily replace the calendar address with http://127.0.0.1:1/ if that loopback port is unused in your n8n environment. Run one fully specified holiday question and confirm that the result is source_unavailable. Restore the official address and try the same change on the model endpoint. This time, look for router_unavailable. Both failure paths returned these statuses in separate runs of the Scotland question. If either test returns not_listed, the flow has treated a failed check as a fact about the calendar.
What to change for your own help desk
Before wiring the workflow up to a chat channel, decide what the assistant should do when it needs a detail. In this guide, each item is independent. A follow-up like “What about Scotland?” has no date unless you provide the earlier turn. One simple design is for the client to keep the date the user confirmed and send it with the follow-up. To support phrases like “next Monday,” decide whose time zone defines today and show the resolved calendar date in the response. Both features deserve their own checks before people rely on them.
For a different task, look for the equivalent of the official calendar. An internal support assistant might need a published returns policy and a separate order record. Its first decision could be whether the user wants eligibility rules or the status of a specific return. Set a clear source for each route and decide which fields are required before the lookup. Once the route and source are visible in the execution history, you can tell whether a bad response began with a misunderstood question or an incorrect lookup. That is usually the quickest place to start fixing it.
Frequently asked questions
Do I need a model to check whether a date is a holiday?
A form with a date and a region can go straight to a lookup. A model earns its place when people type questions that could be about a public holiday, a workplace schedule, or something else.
Why fix the data source in the workflow?
The official feed provides a consistent answer and a source you can check independently. The model decides what kind of question it received, and the lookup code compares the date against the official entries.
Can I use the UK holiday feed without an account?
Yes. The public GOV.UK JSON feed can be read directly. Hosting n8n or substituting a paid model service may have separate costs.
What if the date is outside the published period?
The workflow reports when a date falls outside the range between the first and last published events for that region and returns a link to the official calendar.
What should I check after switching the model?
Run the same date across different divisions, then try a question with no region and one about office hours. Look at the selected route and whether it triggered a request to the calendar.