Cross-Provider Workflow

Shopify Low Inventory to Slack and SendGrid Alert

Version 1.0.0

Read Shopify inventory levels, post a Slack alert, then email the purchasing team.

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

Providers Orchestrated

shopify slack sendgrid

Workflows

inventory-low-alert
List Shopify inventory levels, then alert Slack and email purchasing.
Lists Shopify inventory levels for the given location ids, posts a low-stock alert to a Slack channel, and emails the purchasing team a reorder notice via SendGrid.
3 steps inputs: locationIds, purchasingEmail, slackChannel, slackToken outputs: emailStatus, messageTs
1
list-inventory
$sourceDescriptions.shopifyApi.listInventoryLevels
List Shopify inventory levels for the location.
2
post-slack-alert
$sourceDescriptions.slackApi.postChatPostmessage
Post a low-stock alert to the Slack channel.
3
email-purchasing
$sourceDescriptions.sendgridApi.SendMail
Email the purchasing team a reorder notice via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

shop-inventory-low-alert-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Shopify Low Inventory to Slack and SendGrid Alert
  summary: Read Shopify inventory levels, post a Slack alert, then email the purchasing team.
  description: >-
    An operations workflow that lists Shopify inventory levels for a location,
    posts a low-stock alert to a Slack channel, and emails the purchasing team a
    reorder notice through SendGrid. Demonstrates fanning a single inventory
    signal out to both a team chat provider and an email provider.
  version: 1.0.0
sourceDescriptions:
  - name: shopifyApi
    url: https://raw.githubusercontent.com/api-evangelist/shopify/refs/heads/main/openapi/shopify-admin-rest-api-openapi.yml
    type: openapi
  - name: slackApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.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: inventory-low-alert
    summary: List Shopify inventory levels, then alert Slack and email purchasing.
    description: >-
      Lists Shopify inventory levels for the given location ids, posts a low-stock
      alert to a Slack channel, and emails the purchasing team a reorder notice
      via SendGrid.
    inputs:
      type: object
      properties:
        locationIds:
          type: string
        slackToken:
          type: string
        slackChannel:
          type: string
        purchasingEmail:
          type: string
    steps:
      - stepId: list-inventory
        description: List Shopify inventory levels for the location.
        operationId: $sourceDescriptions.shopifyApi.listInventoryLevels
        parameters:
          - name: location_ids
            in: query
            value: $inputs.locationIds
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          inventoryLevels: $response.body#/inventory_levels
      - stepId: post-slack-alert
        description: Post a low-stock alert to the Slack channel.
        operationId: $sourceDescriptions.slackApi.postChatPostmessage
        parameters:
          - name: token
            in: header
            value: $inputs.slackToken
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.slackChannel
            text: Low inventory detected. Review reorder levels.
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          messageTs: $response.body#/ts
      - stepId: email-purchasing
        description: Email the purchasing team a reorder notice via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.purchasingEmail
                subject: Low inventory reorder notice
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Inventory is running low. Please review and reorder.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      messageTs: $steps.post-slack-alert.outputs.messageTs
      emailStatus: $steps.email-purchasing.outputs.emailStatus