Cross-Provider Workflow

Shopify Abandoned Cart to SendGrid Recovery Email

Version 1.0.0

Look up a Shopify customer, then send an abandoned-cart recovery email with SendGrid.

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

Providers Orchestrated

shopify sendgrid

Workflows

recover-abandoned-cart
Fetch a Shopify customer and email them an abandoned-cart reminder.
Looks up a Shopify customer by id to confirm their email, then sends a SendGrid recovery email encouraging them to complete their abandoned checkout.
2 steps inputs: checkoutUrl, customerId outputs: customerEmail, emailStatus
1
get-customer
$sourceDescriptions.shopifyApi.getCustomer
Retrieve the Shopify customer who abandoned their cart.
2
email-recovery
$sourceDescriptions.sendgridApi.SendMail
Send the abandoned-cart recovery email via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

shop-abandoned-cart-email-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Shopify Abandoned Cart to SendGrid Recovery Email
  summary: Look up a Shopify customer, then send an abandoned-cart recovery email with SendGrid.
  description: >-
    A cart-recovery workflow that retrieves a Shopify customer record and emails
    them a personalized reminder through SendGrid to complete a purchase they
    left behind. Demonstrates combining a commerce platform's customer data with
    a transactional email provider to win back abandoned carts.
  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: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: recover-abandoned-cart
    summary: Fetch a Shopify customer and email them an abandoned-cart reminder.
    description: >-
      Looks up a Shopify customer by id to confirm their email, then sends a
      SendGrid recovery email encouraging them to complete their abandoned
      checkout.
    inputs:
      type: object
      properties:
        customerId:
          type: string
        checkoutUrl:
          type: string
    steps:
      - stepId: get-customer
        description: Retrieve the Shopify customer who abandoned their cart.
        operationId: $sourceDescriptions.shopifyApi.getCustomer
        parameters:
          - name: customer_id
            in: path
            value: $inputs.customerId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          customerEmail: $response.body#/customer/email
          firstName: $response.body#/customer/first_name
      - stepId: email-recovery
        description: Send the abandoned-cart recovery email via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $steps.get-customer.outputs.customerEmail
                subject: You left something in your cart
            from:
              email: [email protected]
            content:
              - type: text/html
                value: Your cart is waiting. Complete your purchase any time.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      customerEmail: $steps.get-customer.outputs.customerEmail
      emailStatus: $steps.email-recovery.outputs.emailStatus