Actions2
Overview
This node retrieves current weather data for a specified location using the OpenWeatherMap API. It supports multiple ways to specify the location, such as city name, city ID, geographic coordinates, or zip code. Users can choose the unit system (Imperial, Metric, or Scientific) and optionally set the language of the returned data.
Common scenarios include:
- Displaying real-time weather information on dashboards.
- Triggering workflows based on current weather conditions.
- Integrating weather data into reports or notifications.
For example, you could use this node to get the current temperature in Berlin in Celsius or fetch weather details by zip code for a specific region.
Properties
| Name | Meaning |
|---|---|
| Format | The unit system for the weather data: Imperial (Fahrenheit, miles/hour), Metric (Celsius, meter/sec), or Scientific (Kelvin, meter/sec). Default is Metric. |
| Location Selection | Method to specify the location: City Name, City ID, Coordinates, or Zip Code. |
| City Name | The name of the city to get weather for (required if Location Selection is City Name). |
| City ID | The numeric city ID to get weather 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") (required if Location Selection is Zip Code). |
| Language | Optional two-letter language code to localize the output (e.g., "en" for English, "de" for German). |
Output
The node outputs JSON data containing the current weather information as returned by the OpenWeatherMap API. This includes details such as temperature, humidity, wind speed, weather conditions, and more, structured according to the API's response format.
No binary data is output by this node.
Dependencies
- Requires an API key credential for the OpenWeatherMap service.
- The node makes HTTP GET requests to
https://api.openweathermap.org/data/2.5/weather. - The API key must be configured in the node credentials before execution.
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: Only "Current Weather" operation is supported here; specifying other operations will cause an error.
- API Request Failures: Network issues or invalid API keys will result in API errors. Verify your API key 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.
- To continue processing other items even if some fail, enable the "Continue On Fail" option in the workflow.