Cross-Provider Workflow

Geocode to Weather Forecast SMS Alert

Version 1.0.0

Geocode an address, fetch its forecast, then text the forecast via Twilio.

1 workflow 3 source APIs 3 providers
View Spec View on GitHub ArazzoWorkflowsCross-Provider

Providers Orchestrated

positionstack weatherapi twilio

Workflows

geocode-forecast-sms
Geocode an address, fetch a forecast, and text it to a recipient.
Forward-geocodes an address with positionstack, requests a forecast for the resolved coordinates from WeatherAPI, and sends the forecast as an SMS through Twilio Messaging.
3 steps inputs: accountSid, address, days, fromPhone, toPhone outputs: forecast, label, messageSid
1
geocode-address
$sourceDescriptions.positionstackApi.forwardGeocode
Forward-geocode the supplied address into coordinates.
2
get-forecast
$sourceDescriptions.weatherapiApi.getForecast
Fetch a multi-day forecast for the geocoded coordinates.
3
send-sms
$sourceDescriptions.twilioMessagingApi.createMessage
Text the forecast summary to the recipient via Twilio Messaging.

Source API Descriptions

Arazzo Workflow Specification

geo-positionstack-weatherapi-twilio-sms-forecast.yml Raw ↑
arazzo: 1.0.1
info:
  title: Geocode to Weather Forecast SMS Alert
  summary: Geocode an address, fetch its forecast, then text the forecast via Twilio.
  description: >-
    A geo, weather, and logistics workflow that resolves a free-form address to
    coordinates with positionstack, pulls a multi-day forecast for that point from
    WeatherAPI, and sends a concise forecast summary to a recipient as an SMS through
    Twilio's Messaging API. Demonstrates chaining a geocoding provider, a weather
    provider, and a communications provider in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: positionstackApi
    url: https://raw.githubusercontent.com/api-evangelist/positionstack/refs/heads/main/openapi/positionstack-openapi.yml
    type: openapi
  - name: weatherapiApi
    url: https://raw.githubusercontent.com/api-evangelist/weatherapi/refs/heads/main/openapi/weatherapi-openapi-original.yml
    type: openapi
  - name: twilioMessagingApi
    url: https://raw.githubusercontent.com/api-evangelist/twilio/refs/heads/main/openapi/twilio-messaging-openapi.yml
    type: openapi
workflows:
  - workflowId: geocode-forecast-sms
    summary: Geocode an address, fetch a forecast, and text it to a recipient.
    description: >-
      Forward-geocodes an address with positionstack, requests a forecast for the
      resolved coordinates from WeatherAPI, and sends the forecast as an SMS through
      Twilio Messaging.
    inputs:
      type: object
      properties:
        address:
          type: string
        days:
          type: integer
        accountSid:
          type: string
        toPhone:
          type: string
        fromPhone:
          type: string
    steps:
      - stepId: geocode-address
        description: Forward-geocode the supplied address into coordinates.
        operationId: $sourceDescriptions.positionstackApi.forwardGeocode
        parameters:
          - name: query
            in: query
            value: $inputs.address
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          latitude: $response.body#/data/0/latitude
          longitude: $response.body#/data/0/longitude
          label: $response.body#/data/0/label
      - stepId: get-forecast
        description: Fetch a multi-day forecast for the geocoded coordinates.
        operationId: $sourceDescriptions.weatherapiApi.getForecast
        parameters:
          - name: q
            in: query
            value: $steps.geocode-address.outputs.latitude
          - name: days
            in: query
            value: $inputs.days
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          locationName: $response.body#/location/name
          forecastDay: $response.body#/forecast/forecastday/0/day/condition/text
          maxTemp: $response.body#/forecast/forecastday/0/day/maxtemp_c
      - stepId: send-sms
        description: Text the forecast summary to the recipient via Twilio Messaging.
        operationId: $sourceDescriptions.twilioMessagingApi.createMessage
        parameters:
          - name: AccountSid
            in: path
            value: $inputs.accountSid
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            To: $inputs.toPhone
            From: $inputs.fromPhone
            Body: $steps.get-forecast.outputs.forecastDay
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          messageSid: $response.body#/sid
          messageStatus: $response.body#/status
    outputs:
      label: $steps.geocode-address.outputs.label
      forecast: $steps.get-forecast.outputs.forecastDay
      messageSid: $steps.send-sms.outputs.messageSid