Automate Real-Time Weather Updates with n8n and OpenWeatherMap

Discover how to automate fetching and formatting real-time weather data using n8n’s workflow with OpenWeatherMap. This tutorial helps eliminate manual weather checks by delivering instant, customized updates for any city.
webhook
openWeatherMap
set
Learn how to Build this Workflow with AI:
Workflow Identifier: 1610
NODES in Use: Webhook, OpenWeatherMap, Set

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

Opening Problem Statement

Meet Sarah, a community planner responsible for organizing outdoor events in multiple cities. Every day, she spends at least 30 minutes scouring various weather websites to get the latest updates—temperature, humidity, wind speed, and weather conditions—so she can decide whether it’s safe to proceed with the day’s agenda. This manual process not only wastes her valuable time but also increases the chances of mistakes due to inconsistent sources or delayed information.

Imagine if Sarah had an automated way to instantly receive accurate weather details tailored to her needs without opening a browser or switching apps. She could save hours weekly and make confident decisions quickly, preventing event cancellations or last-minute chaos.

What This Automation Does

This n8n workflow is designed specifically to automate the retrieval and formatting of real-time weather data for any city. When triggered, it fetches the latest weather information from OpenWeatherMap and delivers a neatly structured response with key details. Here’s what happens:

  • Receives a city name input via a webhook URL (easy to integrate into any app or service)
  • Fetches current weather details including temperature in Celsius, humidity percentage, wind speed, and weather description
  • Formats the data into a clear, user-friendly JSON output for easy consumption
  • Supports accurate location identification by including city and country code
  • Allows rapid access to up-to-date weather insights without manual browsing

By automating this process, users like Sarah can save up to several hours each week and reduce errors in weather-dependent decisions.

Prerequisites ⚙️

  • n8n account with workflow execution privileges
  • OpenWeatherMap API key credential configured in n8n 🔑
  • Access to a webhook URL endpoint (automatically generated by n8n)
  • Optional: Ability to trigger webhook requests from external apps or scripts to provide city names dynamically

Step-by-Step Guide

Step 1: Create a New Workflow and Add a Webhook Node

In your n8n editor, click New Workflow, then + Add Node. Search for and select the Webhook node.

Set the path to a unique identifier like 39f1b81f-f538-4b94-8788-29180d5e4016 (or any custom string). This will be the URL endpoint that triggers the workflow.

Once saved, you will see a webhook URL formatted like https://your-n8n-domain/webhook/39f1b81f-f538-4b94-8788-29180d5e4016. This URL accepts HTTP requests that start the workflow.

Common mistake: Forgetting to copy the webhook URL before exiting or not setting the path uniquely.

Step 2: Add and Configure the OpenWeatherMap Node

Click + Add Node and select OpenWeatherMap.

Set the City Name parameter using an expression to fetch the city name dynamically from the webhook input:
{{ $json["body"]["city"] }}.

Ensure you have added your OpenWeatherMap API credentials in n8n under credentials.

This node will call the OpenWeatherMap API to get the current weather for the requested city.

Common mistake: Not entering the API credentials or incorrectly typing the city parameter.

Step 3: Add a Set Node to Format Weather Data

Add a Set node. This node extracts and formats specific fields from the OpenWeatherMap API response.

Under Values > String, add these key-value pairs using expressions:

  • tempC: {{ $json["main"]["temp"] }}
  • humidity: {{ $json["main"]["humidity"] }}
  • windspeed: {{ $json["wind"]["speed"] }}
  • description: {{ $json["weather"][0]["description"] }}
  • city: {{ $json["name"] }}, {{ $json["sys"]["country"] }}

Enable Keep Only Set so that only these fields appear in the output, making it clean and concise.

Common mistake: Forgetting to enable the “Keep Only Set” option which results in cluttered output.

Step 4: Connect the Nodes

Ensure your node connections follow this order:

  • Webhook triggers OpenWeatherMap
  • OpenWeatherMap triggers Set

This sequence ensures that upon receiving a city name, the API is called and the data is formatted correctly.

Step 5: Activate and Test Your Workflow

Save and activate the workflow.

Then, send a POST request to your webhook URL with a JSON body containing a city, for example:

{
  "city": "London"
}

You should see a JSON response with temperature, humidity, wind speed, description, and city name with country code.

Tip: Use tools like Postman or curl for testing the webhook invocation.

Customizations ✏️

1. Change Temperature Unit

In the OpenWeatherMap node, add a parameter or adjust the API call settings to retrieve temperature in Fahrenheit if desired (check OpenWeatherMap docs for unit parameter).

2. Include Additional Weather Details

Modify the Set node to extract other information like pressure or cloudiness by adding extra expression fields.

3. Trigger Weather Check at Scheduled Intervals

Add a Cron node (not in current workflow) before the Webhook to run the workflow automatically every hour/day.

Troubleshooting 🔧

Problem: “Webhook Not Responding”

Cause: Incorrect webhook path or inactive workflow.

Solution: Verify webhook path in the node and ensure the workflow is active.

Problem: “OpenWeatherMap API Error”

Cause: Missing or invalid API key.

Solution: Recheck OpenWeatherMap credentials in n8n and regenerate the API key if necessary.

Pre-Production Checklist ✅

  • Confirm the webhook URL path is unique and correctly copied.
  • Test with multiple city names to ensure API responses are accurate.
  • Verify that API credentials are correctly set and have active quota.
  • Check that the Set node outputs only the intended fields.

Deployment Guide

Once tested, activate your workflow in n8n.

Use the webhook URL to integrate this weather automation into your apps, websites, or scripts.

Monitor execution logs in n8n for any runtime issues and adjust as needed.

FAQs

Can I use this workflow with cities outside the OpenWeatherMap free tier limits?

OpenWeatherMap supports global cities; however, free tier has API call limits. Monitor usage accordingly.

Is my data safe when using the webhook?

This webhook only receives city names, so no sensitive data is transmitted. Ensure your n8n server is secure for best practices.

Can I extend this workflow to send alerts?

Yes, you can add notification nodes like Email or Slack after the Set node to alert based on weather changes.

Conclusion

By following this guide, you’ve built a custom n8n automation that instantly fetches and formats real-time weather data from OpenWeatherMap through a simple webhook trigger. This setup saves you time, increases accuracy, and allows integration in various apps requiring weather insights.

Imagine the countless hours saved from manual weather monitoring and the confidence gained from always having up-to-date data at your fingertips.

Next, consider expanding this workflow to schedule automated weather updates, integrate with SMS or messaging platforms for alerts, or enrich your dashboard applications with live environmental data.

With n8n and OpenWeatherMap, weather automation is just the beginning of smarter workflows customized by you!

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free