Cross-Provider Workflow

Location Search to Forecast Email

Version 1.0.0

Resolve a location with WeatherAPI search, forecast it, then email it via SendGrid.

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

Providers Orchestrated

weatherapi sendgrid

Workflows

search-forecast-email
Resolve a location, forecast it, and email the forecast.
Searches WeatherAPI for a matching location, fetches its forecast, and emails the forecast summary via SendGrid Mail Send.
3 steps inputs: days, place, recipientEmail outputs: emailStatus, forecastText, resolvedName
1
search-location
$sourceDescriptions.weatherapiApi.searchLocations
Resolve the place name to a canonical WeatherAPI location.
2
get-forecast
$sourceDescriptions.weatherapiApi.getForecast
Fetch a multi-day forecast for the resolved location.
3
email-forecast
$sourceDescriptions.sendgridApi.SendMail
Email the forecast summary to the subscriber.

Source API Descriptions

Arazzo Workflow Specification

geo-weatherapi-search-forecast-sendgrid.yml Raw ↑
arazzo: 1.0.1
info:
  title: Location Search to Forecast Email
  summary: Resolve a location with WeatherAPI search, forecast it, then email it via SendGrid.
  description: >-
    A weather workflow that resolves an ambiguous place name to a canonical location
    via WeatherAPI's search, retrieves a multi-day forecast for it, and emails the
    forecast to a subscriber through SendGrid's Mail Send API. Demonstrates a two-step
    weather pipeline feeding an email provider.
  version: 1.0.0
sourceDescriptions:
  - 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: search-forecast-email
    summary: Resolve a location, forecast it, and email the forecast.
    description: >-
      Searches WeatherAPI for a matching location, fetches its forecast, and emails
      the forecast summary via SendGrid Mail Send.
    inputs:
      type: object
      properties:
        place:
          type: string
        days:
          type: integer
        recipientEmail:
          type: string
    steps:
      - stepId: search-location
        description: Resolve the place name to a canonical WeatherAPI location.
        operationId: $sourceDescriptions.weatherapiApi.searchLocations
        parameters:
          - name: q
            in: query
            value: $inputs.place
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          resolvedName: $response.body#/0/name
          resolvedRegion: $response.body#/0/region
          lat: $response.body#/0/lat
          lon: $response.body#/0/lon
      - stepId: get-forecast
        description: Fetch a multi-day forecast for the resolved location.
        operationId: $sourceDescriptions.weatherapiApi.getForecast
        parameters:
          - name: q
            in: query
            value: $steps.search-location.outputs.resolvedName
          - name: days
            in: query
            value: $inputs.days
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          forecastText: $response.body#/forecast/forecastday/0/day/condition/text
          maxTemp: $response.body#/forecast/forecastday/0/day/maxtemp_c
      - stepId: email-forecast
        description: Email the forecast summary to the subscriber.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.recipientEmail
                subject: Your forecast
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: $steps.get-forecast.outputs.forecastText
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      resolvedName: $steps.search-location.outputs.resolvedName
      forecastText: $steps.get-forecast.outputs.forecastText
      emailStatus: $steps.email-forecast.outputs.emailStatus