Show external weather information in an IFS workflow
Documentation-based guide draft · Reviewed against sources on 2026-09-27 · Not executed in an IFS environment. IFS references use 26R1 unless stated otherwise. Confirm available APIs, components, and permissions in your installed release.
Build a read-only workflow that retrieves weather for a fixed location, maps three response fields, and presents a timestamped result. This lab uses Open-Meteo’s documented forecast API; confirm the provider’s current usage terms before using it for commercial workloads.
Before you start
Section titled “Before you start”Use Workflow Designer in development and an approved outbound network route. The exercise starts with fixed Stockholm coordinates so location lookup and weather parsing can be tested separately. No business record is updated.
1. Test the exact HTTPS request
Section titled “1. Test the exact HTTPS request”Open this request in Postman or a browser:
https://api.open-meteo.com/v1/forecast?latitude=59.33&longitude=18.07¤t=temperature_2m,weather_code&timezone=UTCInspect current, current_units, and utc_offset_seconds. Record the actual JSON structure. Do not use a saved example temperature as evidence that a live forecast is current.
The public endpoint may not be appropriate for every commercial deployment. Use the approved endpoint/credential plan for your organization when moving beyond the lab.
2. Store the endpoint configuration
Section titled “2. Store the endpoint configuration”Open IFS REST Task Configurations and create a Free Text entry named LAB_WEATHER_BASE with the base value https://api.open-meteo.com/v1/forecast.
Create a workflow with process key labWeatherRead. Add Start → IFS REST Call → Script Task → End. For the REST task, select GET and set URL to:
<<CONFIG:LAB_WEATHER_BASE>>?latitude=59.33&longitude=18.07¤t=temperature_2m,weather_code&timezone=UTCUse Authentication None only for an endpoint that is actually public. A paid/authenticated provider configuration must use its supported credential mechanism.
3. Map the response fields
Section titled “3. Map the response fields”Add these REST task outputs:
| Output Key | Path to Value |
|---|---|
weatherTemperature |
$.current.temperature_2m |
weatherCode |
$.current.weather_code |
weatherTime |
$.current.time |
weatherUnit |
$.current_units.temperature_2m |
Inspect the task. Confirm that the keys contain values, not an entire JSON document or the literal JSONPath string. The IFS REST task has a documented response-size limit below 1 MB; this narrow response avoids requesting unnecessary hourly arrays.
4. Validate and format a display value
Section titled “4. Validate and format a display value”In the following JavaScript Script Task, use:
var raw = execution.getVariable('weatherTemperature');var unit = execution.getVariable('weatherUnit');var time = execution.getVariable('weatherTime');var temperature = Number(raw);var valid = raw != null && String(raw).trim() !== '' && isFinite(temperature) && time != null && unit != null;execution.setVariable('weatherAvailable', valid);execution.setVariable('weatherSummary', valid ? String(temperature) + ' ' + String(unit) + ' at ' + String(time) + ' UTC' : 'Weather data unavailable');This does not translate weather_code into a condition label. If adding that feature, use the provider’s current code table rather than treating the number as a temperature or a universal severity ranking.
5. Add location input and a read-only display
Section titled “5. Add location input and a read-only display”After the fixed-coordinate case works, introduce latitude/longitude variables from an approved site/location lookup. Validate numeric ranges before constructing the request. Keep the host/path fixed; user input must not select an arbitrary outbound URL.
For a user-invoked version, add an appropriate display/review User Task and a supported ExecuteWorkflow command using workflow forms and commands. Map the summary into the form using the designer-supported variable/default binding and test the actual page command. Do not attach a blocking weather call to every business save.
6. Test unavailable and stale data
Section titled “6. Test unavailable and stale data”Test invalid coordinates, missing output fields, a blocked URL, and a provider timeout. Confirm the workflow does not display a previous observation as if it were a fresh success. Treat the returned observation time separately from the time your workflow received it; a UTC suffix is correct here because the request explicitly selects UTC.
Remove the lab command/trigger before retiring the workflow and Free Text configuration. Record the request, response shape, mapped variables, and observed runtime behavior. Weather should inform the user, not silently approve safety-critical work.
Provider contract: Open-Meteo forecast documentation.
Sources and scope
Section titled “Sources and scope”Older IFS Applications examples are historical context, not evidence of Cloud compatibility. No third-party code, screenshots, or downloadable workflows are reproduced.