Dynamic Weather API Lookup and Response - n8n Workflow

Use this powerful n8n workflow to instantly retrieve current weather data for any specified city via a simple Webhook call. Explore effective n8n templates for API integration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing an easy-to-use API wrapper for OpenWeatherMap.
Users looking for practical n8n templates for building custom microservices.
System integrators who need a simple endpoint to fetch structured weather data.
Anyone studying how to utilize the Webhook n8n node as a core request handler.

Overview

This versatile n8n workflow provides a robust, customizable, and instantly deployable API endpoint for retrieving current weather conditions globally. By utilizing the Webhook n8n trigger, the system can accept city names as input (via a query parameter) and automatically interact with the OpenWeatherMap API. This n8n workflow is designed to minimize complexity, offering a streamlined response containing only the essential temperature and weather description. This is an excellent introductory example of how to build simple, functional backends and utilize custom parameters within a standard n8n template structure.

How it Works

This automation acts as a self-contained weather microservice, starting with a custom n8n trigger and flowing through data extraction and cleanup nodes.


  1. Workflow Trigger (Webhook): The n8n workflow execution begins when an HTTP request hits the specified Webhook URL. This Webhook is configured to wait for the last node's output before responding, turning the entire n8n process into a synchronous API call.

  2. Input Capture: The Webhook n8n node automatically captures the required city name from the incoming request's query parameters (e.g., ?city=Paris).

  3. API Interaction (OpenWeatherMap): The OpenWeatherMap n8n node receives the extracted city name. It uses this parameter to execute a search against the OpenWeatherMap service, retrieving comprehensive current weather data.

  4. Data Structuring (Set): The final step uses a Set n8n node to clean the API response. It extracts only the essential details—the temperature (temp) and the weather description (description)—discarding all extraneous data fields. This results in a clean, focused output that is immediately returned to the original caller by the initiating Webhook n8n trigger.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance as a new workflow.

  2. OpenWeatherMap Credentials: Click on the OpenWeatherMap n8n node. You will need to set up credentials using your API key obtained from the OpenWeatherMap service.

  3. Activate Webhook: Once credentials are set, activate the n8n workflow. A unique Webhook URL will be generated.

  4. Testing: Test the n8n trigger by calling the generated Webhook URL, ensuring you append a query parameter for the city, e.g., YOURWEBHOOKURL?city=London.

Node Details

Webhook (n8n trigger):
Function: Serves as the primary entry point for the n8n workflow, listening for external requests.
Key Configuration: Configured to respond with the output of the last n8n node (responseMode: lastNode). It captures the target city name via the incoming URL query parameter.

OpenWeatherMap (n8n node):
Function: Fetches current weather data for the city specified by the input from the Webhook n8n trigger.
Key Configuration: The 'City Name' parameter is dynamically set using an expression: ={{$node["Webhook"].json["query"]["city"]}}.

Set (n8n node):
Function: Filters and formats the complex API response, ensuring a clean data structure is returned.
* Key Configuration: Uses 'Keep Only Set' to discard unnecessary fields. It explicitly maps and sets two new fields: temp (from main.temp) and description (from weather[0].description).

Related n8n Workflows

Free

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

Featured*