Cross-Provider Workflow

Weather Alerts to Slack Channel

Version 1.0.0

Pull active weather alerts for a location, then post them to a Slack channel.

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

Providers Orchestrated

weatherapi slack

Workflows

weather-alerts-to-slack
Fetch active weather alerts and post them to Slack.
Requests active weather alerts for a location from WeatherAPI, then posts the alert headline to a Slack channel via chat.postMessage.
2 steps inputs: channel, location outputs: alertEvent, messageTs
1
get-alerts
$sourceDescriptions.weatherapiApi.getAlerts
Fetch active weather alerts for the requested location.
2
post-to-slack
$sourceDescriptions.slackChatApi.postChatPostmessage
Post the alert headline to the team Slack channel.

Source API Descriptions

Arazzo Workflow Specification

geo-weatherapi-alerts-slack-notify.yml Raw ↑
arazzo: 1.0.1
info:
  title: Weather Alerts to Slack Channel
  summary: Pull active weather alerts for a location, then post them to a Slack channel.
  description: >-
    A severe-weather operations workflow that retrieves active weather alerts for a
    location from WeatherAPI and posts a summary to a team Slack channel via the Slack
    chat.postMessage method. Demonstrates pairing a weather provider with a team
    messaging provider to keep operations teams informed of hazardous conditions.
  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: slackChatApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.yml
    type: openapi
workflows:
  - workflowId: weather-alerts-to-slack
    summary: Fetch active weather alerts and post them to Slack.
    description: >-
      Requests active weather alerts for a location from WeatherAPI, then posts the
      alert headline to a Slack channel via chat.postMessage.
    inputs:
      type: object
      properties:
        location:
          type: string
        channel:
          type: string
    steps:
      - stepId: get-alerts
        description: Fetch active weather alerts for the requested location.
        operationId: $sourceDescriptions.weatherapiApi.getAlerts
        parameters:
          - name: q
            in: query
            value: $inputs.location
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          alertHeadline: $response.body#/alerts/alert/0/headline
          alertEvent: $response.body#/alerts/alert/0/event
          locationName: $response.body#/location/name
      - stepId: post-to-slack
        description: Post the alert headline to the team Slack channel.
        operationId: $sourceDescriptions.slackChatApi.postChatPostmessage
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.channel
            text: $steps.get-alerts.outputs.alertHeadline
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          messageTs: $response.body#/ts
          postedChannel: $response.body#/channel
    outputs:
      alertEvent: $steps.get-alerts.outputs.alertEvent
      messageTs: $steps.post-to-slack.outputs.messageTs