Canada Public Holiday Data Interface for AI Agents - n8n Workflow

Leverage this specialized n8n workflow template to transform the Canada Holidays API into a powerful Machine-Controlled Plane (MCP) server tool for AI agents. This n8n workflow provides 6 endpoints for querying holiday and province data.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Developers building AI agents who need reliable, structured access to Canadian public holiday data.

  • Users looking for advanced n8n templates to implement custom tool servers.

  • Automation specialists seeking to integrate external APIs into AI-driven workflows using the n8n node architecture.

  • Anyone utilizing the n8n platform to bridge external APIs with language models.

Overview

This sophisticated n8n workflow establishes a dedicated tool server using the Machine-Controlled Plane (MCP) framework, specifically designed for AI agents. It eliminates the need for manual API construction within the AI environment by packaging the Canada Holidays API into six callable functions. By utilizing a specialized n8n trigger, this setup allows AI agents to dynamically request information—like all holidays in a given year or details for a specific province—and receive raw, structured data responses directly from the API. This robust n8n workflow ensures high efficiency and accuracy when fetching complex geographic and temporal data, making it an essential component for any AI-powered regional planning or informational service. Utilizing the built-in functionality of the n8n platform, this n8n template speeds up development significantly.

How it Works

The core of this automation is the specialized MCP n8n trigger node, which acts as the communication endpoint.


  1. AI Request Initiation: An external AI agent (e.g., LangChain, OpenAI) sends a request to the MCP webhook URL provided by the n8n trigger.

  2. Tool Selection: The AI determines which of the six available tools (endpoints) is necessary to fulfill the query.

  3. Parameter Injection: The AI agent, guided by the tool descriptions, generates the required path or query parameters (e.g., year, provinceId). These parameters are injected into the respective n8n node using the $fromAI() expression.

  4. API Execution: The relevant HTTP Request Tool n8n node executes the API call to the https://canada-holidays.ca endpoint, dynamically using the injected parameters.

  5. Response Handling: The raw JSON response from the external API is immediately passed back through the n8n workflow to the MCP n8n trigger, which returns the result to the waiting AI agent.

This architecture ensures that the entire process is handled reliably within the n8n platform, providing a seamless operational interface for the AI agent.

Installation Guide

To deploy this specialized n8n workflow and create your own MCP server, follow these steps:


  1. Import the n8n Template: Copy the provided JSON code and import it directly into your n8n instance using the 'New' button or 'Import from JSON' option.

  2. No Credentials Needed: This particular n8n workflow uses a public API (Canada Holidays API) and requires no external credentials or authentication.

  3. Activate the n8n Workflow: Switch the workflow from 'Inactive' to 'Active'. This starts the MCP server listener.

  4. Retrieve the Webhook URL: Click on the 'Canada Holidays MCP Server' n8n trigger node to view its configuration. Copy the generated webhook URL (e.g., /webhook/canada-holidays-mcp). This is the endpoint the AI agent must call.

  5. Configure AI Agent: Configure your external AI agent framework to use this n8n node endpoint as a tool, referencing the provided tool names and parameter descriptions for effective function calling.

Node Details

This n8n workflow utilizes several key nodes to establish the MCP server functionality:

Canada Holidays MCP Server (MCP Trigger n8n node):
Function: Acts as the primary server endpoint and listens for tool-use requests from an AI agent. It is the central n8n trigger for this automation.
Key Configuration: Path is set to canada-holidays-mcp.

Get API Root / Get API Schema (HTTP Request Tool n8n node):
Function: Handles general informational API calls about the service.
Key Configuration: URL is hardcoded to the base API path or schema path.

List All Holidays (HTTP Request Tool n8n node):
Function: Retrieves a list of all public holidays, allowing filtering by year, federal, and optional status.
Key Configuration: Query parameters use the dynamic expression ={{ $fromAI('parameterName', 'description', 'type', defaultValue) }}. This ensures the AI agent provides the necessary input data.

Get Holiday by ID (HTTP Request Tool n8n node):
Function: Fetches details for a specific holiday using a holiday ID.
Key Configuration: The URL path includes a dynamic path parameter: .../holidays/{{ $fromAI('holidayId', ...) }}.

List All Provinces / Get Province by ID (HTTP Request Tool n8n node):
Function: Manages requests for Canadian province data, either listing all or querying a single province using its abbreviation (provinceId). All n8n node functionality here is driven by AI input.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

A hacker by nature, programmer by trade ⚒️ I'm looking to collaborate on things that save human labor 📫 How to reach me Github👇 -> Discord

Featured*