Automate Weather Updates with n8n and OpenWeatherMap
detail.loadingPreview
Effortlessly retrieve real-time weather information for any city using a simple webhook. This n8n workflow automates fetching current temperature and feel-like conditions, providing instant weather updates.
About This Workflow
This n8n workflow elegantly automates the retrieval of current weather data. It begins with a webhook, ready to receive a city name as a query parameter. Upon receiving a request, the workflow intelligently sets the city to be queried, defaulting to Berlin, Germany, if no city is specified. This city information is then passed to the OpenWeatherMap node, which fetches detailed weather data. Finally, the data is transformed into a human-readable response, stating the current temperature, the 'feels like' temperature, and the city's name, ready to be sent back to the caller. It's a perfect example of how to integrate external APIs into your automated processes for dynamic data.
Key Features
- Dynamic City Input: Accepts city names via webhook for flexible weather requests.
- Automated API Integration: Seamlessly connects with OpenWeatherMap to fetch real-time weather.
- Customizable Response: Generates a clear and concise summary of weather conditions.
- Default City Option: Provides a fallback to 'Berlin, DE' if no city is specified.
How To Use
- Set up the Webhook: Configure the 'Webhook GET' node with a desired path (e.g., 'weather'). Ensure 'responseMode' is set to 'lastNode'.
- Define City Input: Connect the 'Webhook GET' node to the 'Set City' node. In 'Set City', use the expression
={{ $json["query"]["parameter"] || 'berlin,de' }}to dynamically set the city from the webhook query or use 'berlin,de' as a default. - Integrate OpenWeatherMap: Connect the 'Set City' node to the 'OpenWeatherMap' node. Ensure you have configured your OpenWeatherMap API credentials.
- Create the Response: Connect the 'OpenWeatherMap' node to the 'Create Response' node. In 'Create Response', use the expression
=It has {{$json["main"]["temp"]}}\xE2\x84\x83 and feels like {{$json["main"]["feels_like"]}}\xE2\x84\x83 in {{$json["name"]}}to format the output message. The webhook will then return this formatted message.
Apps Used
Workflow JSON
{
"id": "392e0c16-f715-4aa4-ae28-53c80e549437",
"name": "Automate Weather Updates with n8n and OpenWeatherMap",
"nodes": 8,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 392e0c16-f715...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.