Integrating AI with Open-Meteo API for Enhanced Weather Forecasting n8n Workflow Template

n8n workflow template · 6 nodes · OpenAI

Integrating AI with Open-Meteo API for Enhanced Weather Forecasting is a free n8n workflow template that starts when a chat message is received and works with OpenAI. It has 6 nodes, 6 of them AI nodes (Chat Trigger, OpenAI Chat Model, AI Agent and Window Buffer Memory). To run it, you add your own credentials for OpenAI API.

At a glance

Trigger
Chat Trigger (When chat message received)
Nodes
6
Apps
OpenAI
AI nodes
6
Credentials
1 type
Category
AI agents and LLM tools

Apps and integrations

  • OpenAI

Node types used

  • Chat Trigger
  • OpenAI Chat Model
  • AI Agent
  • Window Buffer Memory
  • HTTP Request Tool

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Within N8N, there will be a chat button to test, or you can use the external chat link from the trigger.

Open Meteo SPEC - City Geolocation

This tool will go to the URL to fetch the geolocation data of the city, and I only need to get the name of the city.

So, I will ask the user to input the name of the city and pass some pre-existing information, such as returning only the first city and returning in JSON format.

  • name (By Model) - And placeholder - The parameter that the AI will need to fill in as required.
  • count - 1 by default because I want only the first city.
  • format - Putting JSON for no specific reason, but OpenAI could figure out how to process that information.

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Integrating AI with Open-Meteo API for Enhanced Weather Forecasting

Use case

Workshop

We are using this workflow in our workshops to teach how to use Tools a.k.a functions with artificial intelligence. In this specific case, we will use a generic "AI Agent" node to illustrate that it could use other models from different data providers.

Enhanced Weather Forecasting

In this small example, it's easy to demonstrate how to obtain weather forecast results from the Open-Meteo site to accurately display the upcoming days.

This can be used to plan travel decisions, for example.

What this workflow does

  1. We will make an HTTP request to find out the geographic coordinates of a city.
  2. Then, we will make other HTTP requests to discover the weather for the upcoming days.

In this workshop, we demonstrate that the AI will be able to determine which tool to call first—it will first call the geolocation tool and then the weather forecast tool. All of this within a single client conversation call.

Setup

Insert an OpenAI Key and activate the workflow.

by Davi Saranszky Mesquita

Create an Hosted Web Chat

And setup the trigger!

Open Meteo SPEC - Weather Forecast

This tool will go to the Open Meteo site with the geolocation information at

It will pass the information on latitude, longitude, and the number of days for which it will bring data.

There are many default pieces of information within, but the focus is not to explain the Open Meteo API.

Variables like latitude, longitude, and forecast_days are self-explanatory for OpenAI, making it the easiest tool to configure.

  • latitude (By Model) and Placeholder
  • longitude (By Model) and Placeholder
  • forecast_days (By Model) and Placeholder

Nodes in this workflow

The 6 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. When chat message received (Chat Trigger)
  2. OpenAI Chat Model (OpenAI Chat Model)
  3. Generic AI Tool Agent (AI Agent)
  4. Chat Memory Buffer (Window Buffer Memory)
  5. A tool to get the weather forecast based on geolocation (HTTP Request Tool)
  6. A tool for inputting the city and obtaining geolocation (HTTP Request Tool)

Credentials you need

  • OpenAI API – used by OpenAI Chat Model

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us