Actions2
Overview
This node retrieves weather data from an external weather service API. Specifically, the "5 Day Forecast" operation fetches weather forecast data for the next five days for a specified location. It supports multiple ways to specify the location, including city name, city ID, geographic coordinates, or zip code. The node allows users to select the unit format (Imperial, Metric, or Scientific) and optionally specify the language of the returned data.
Common scenarios where this node is useful include:
- Integrating weather forecasts into automation workflows for planning events or operations.
- Providing weather updates in dashboards or reports.
- Triggering actions based on upcoming weather conditions.
For example, a user could configure the node to get a 5-day forecast for Berlin using metric units and English language output, then use that data downstream to notify teams about expected rain.
Properties
| Name | Meaning |
|---|---|
| Format | The unit system for the weather data. Options: Imperial (Fahrenheit, miles/hour), Metric (Celsius, meter/sec), Scientific (Kelvin, meter/sec). |
| Location Selection | Method to specify the location for the forecast. Options: City Name, City ID, Coordinates, Zip Code. |
| City Name | The name of the city to get the weather forecast for (required if Location Selection is City Name). |
| City ID | The numeric ID of the city to get the weather forecast for (required if Location Selection is City ID). |
| Latitude | Latitude coordinate of the location (required if Location Selection is Coordinates). |
| Longitude | Longitude coordinate of the location (required if Location Selection is Coordinates). |
| Zip Code | Zip code and country code (e.g., "10115,de") of the location (required if Location Selection is Zip Code). |
| Language | Optional two-letter language code to localize the output (e.g., "en", "de"). |
Output
The node outputs JSON data representing the 5-day weather forecast as returned by the external weather API. This includes detailed weather information such as temperature, humidity, wind speed, weather conditions, timestamps, and more for multiple time points over the next five days.
The output is structured as an array of JSON objects, each corresponding to one input item processed. Each object contains the full forecast data under the json property.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for the external weather service (referred to generically as an API authentication token).
- The node makes HTTP GET requests to the weather API endpoint at
https://api.openweathermap.org/data/2.5/forecast. - Proper configuration of the API key credential within n8n is necessary for successful requests.
Troubleshooting
- Invalid Location Selection: If an unsupported location selection method is provided, the node throws an error indicating the unknown selection. Ensure the location selection matches one of the supported options.
- Unknown Operation: If an unsupported operation is selected, an error is thrown. For this summary, only "5 Day Forecast" is relevant.
- API Request Failures: Network issues, invalid API keys, or exceeding rate limits can cause request errors. These are surfaced as API errors. Verify API credentials and network connectivity.
- Missing Required Parameters: Depending on the location selection, required fields like city name, city ID, coordinates, or zip code must be provided. Missing these will cause errors.
- Language Codes: Using unsupported or incorrect language codes may result in default language responses or errors.
To resolve errors, verify all input parameters, ensure valid API credentials, and check the external API's status and usage limits.