Dynamic Weather Forecast Delivery via Slack Command - n8n Workflow

Automate fetching 7-day weather forecasts from the National Weather Service (NWS) and instantly deliver them to Slack using this robust n8n workflow. Implement custom APIs with simple n8n nodes.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users needing quick, location-specific weather updates directly within their communication platform.

  • System administrators looking for practical n8n templates integrating APIs like NWS and OpenStreetMap.

  • Developers building custom Slack bots using the n8n webhook trigger.

  • Anyone seeking a technical example of chaining multiple HTTP Request n8n nodes for complex data transformation.

Overview

This comprehensive n8n workflow solves the problem of needing detailed, structured weather information available instantly within Slack. Instead of manually navigating multiple websites, users can trigger this automation (likely via a Slack Slash Command) by providing a location name. The core value of this n8n workflow lies in its multi-step data processing pipeline: it translates a human-readable address into geographical coordinates (using the OpenStreetMap n8n node), converts coordinates into NWS grid points, fetches the 7-day forecast data, and finally formats the output beautifully before sending it to Slack. This entire process is orchestrated seamlessly using various specialized n8n node components.

How it Works

The automation begins with the Webhook n8n trigger, which waits for a POST request, typically containing a text input (the location query).


  1. Trigger and Location Lookup: The initial Webhook n8n trigger receives the location query. This query is immediately passed to the first HTTP Request n8n node (OpenStreetMap), which uses the Nominatim API to resolve the address text into latitude and longitude coordinates.

  2. Grid Point Identification: The coordinates are then used by the next HTTP Request n8n node (NWS) to call the National Weather Service API. This crucial step retrieves the specific NWS grid identifier (grid ID, X, and Y coordinates) required for detailed forecasting.

  3. Forecast Retrieval: A subsequent HTTP Request n8n node (NWS1) uses the determined grid points to fetch the raw 7-day forecast data from the official NWS API.

  4. Data Formatting and Delivery: The final step utilizes the Slack n8n node. A complex JavaScript expression processes the raw JSON forecast data, iterating through each forecast period to create a structured, readable message containing temperature, wind, and a short forecast summary. This formatted output is then instantly posted to the designated Slack channel via the Slack n8n node, completing the n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON code and import it directly into your n8n instance via the 'New' menu and 'Import from JSON'.

  2. Configure the Webhook n8n trigger: Note the unique URL generated by the Webhook n8n node. This is the endpoint that needs to be called to start the automation. If using a Slack Slash Command, this URL should be configured as the command endpoint.

  3. Set up Slack Credentials: You must configure an OAuth2 credential for the Slack n8n node. Ensure the connected Slack account has permissions to post messages to the target channel (Channel ID specified in the configuration).

  4. Update Channel ID: In the Slack n8n node, modify the channelId parameter (C0889718P8S in the template) to the specific Slack channel where you want the weather updates to be posted.

  5. Review User-Agent Headers: The HTTP Request n8n nodes for OpenStreetMap and NWS require a valid User-Agent header as per API guidelines. You may need to update the placeholder email and identifier to reflect your own information.

Node Details


  • Webhook n8n trigger: Acts as the entry point for the n8n workflow, listening for POST requests on the path /slack1. It extracts the location input from the request body.

  • OpenStreetMap (HTTP Request n8n node): Function: Converts the location text from the Webhook into latitude and longitude using the Nominatim API. Key Configuration: Uses query parameter q dynamically set to {{ $('Webhook').item.json.body.text }}.

  • NWS (HTTP Request n8n node): Function: Takes the coordinates obtained from OpenStreetMap and requests the NWS points endpoint to retrieve the necessary grid IDs (gridId, gridX, gridY). Key Configuration: URL is dynamically constructed using expressions like =https://api.weather.gov/points/{{ $json.body[0].lat }},{{ $json.body[0].lon }}.

  • NWS1 (HTTP Request n8n node): Function: Fetches the final 7-day forecast data using the grid points provided by the previous NWS n8n node. Key Configuration: URL is dynamically constructed using nested JSON parsing expressions to pull gridId, gridX, and gridY from the previous output.

  • Slack n8n node: Function: Formats the detailed forecast data from NWS1 and posts it to a designated Slack channel. Key Configuration: Uses a sophisticated JavaScript expression within the text parameter to map and join the forecast periods into a readable, markdown-formatted message, demonstrating advanced data handling within the n8n node interface.

Related n8n Workflows

Free

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

n8n Ambassador & Verified Partner

Featured*