Cross-Provider Workflow

Geocode to Current Weather Email

Version 1.0.0

Geocode an address, get current weather, then email a summary via SendGrid.

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

Providers Orchestrated

positionstack weatherapi sendgrid

Workflows

geocode-current-weather-email
Geocode an address, fetch current weather, and email it.
Forward-geocodes an address with positionstack, retrieves current conditions from WeatherAPI, and emails a conditions summary through SendGrid Mail Send.
3 steps inputs: address, recipientEmail outputs: conditions, emailStatus, label
1
geocode-address
$sourceDescriptions.positionstackApi.forwardGeocode
Forward-geocode the supplied address into coordinates.
2
get-current-weather
$sourceDescriptions.weatherapiApi.getCurrentWeather
Fetch current conditions for the geocoded coordinates.
3
email-conditions
$sourceDescriptions.sendgridApi.SendMail
Email the current conditions summary via SendGrid Mail Send.

Source API Descriptions

Arazzo Workflow Specification

geo-positionstack-weatherapi-sendgrid-email.yml Raw ↑
arazzo: 1.0.1
info:
  title: Geocode to Current Weather Email
  summary: Geocode an address, get current weather, then email a summary via SendGrid.
  description: >-
    A geo and weather workflow that converts an address to coordinates with
    positionstack, retrieves the current conditions for that location from WeatherAPI,
    and delivers a formatted conditions email to a subscriber through SendGrid's Mail
    Send API. Chains a geocoding provider, a weather provider, and an email provider.
  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: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: geocode-current-weather-email
    summary: Geocode an address, fetch current weather, and email it.
    description: >-
      Forward-geocodes an address with positionstack, retrieves current conditions
      from WeatherAPI, and emails a conditions summary through SendGrid Mail Send.
    inputs:
      type: object
      properties:
        address:
          type: string
        recipientEmail:
          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-current-weather
        description: Fetch current conditions for the geocoded coordinates.
        operationId: $sourceDescriptions.weatherapiApi.getCurrentWeather
        parameters:
          - name: q
            in: query
            value: $steps.geocode-address.outputs.latitude
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          conditionText: $response.body#/current/condition/text
          tempC: $response.body#/current/temp_c
          locationName: $response.body#/location/name
      - stepId: email-conditions
        description: Email the current conditions summary via SendGrid Mail Send.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.recipientEmail
                subject: Current weather for your location
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: $steps.get-current-weather.outputs.conditionText
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          messageStatus: $statusCode
    outputs:
      label: $steps.geocode-address.outputs.label
      conditions: $steps.get-current-weather.outputs.conditionText
      emailStatus: $steps.email-conditions.outputs.messageStatus