Cross-Provider Workflow

HubSpot Deal Won to SendGrid Email

Version 1.0.0

Find a won HubSpot deal, then send a thank-you email via SendGrid.

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

Providers Orchestrated

hubspot sendgrid

Workflows

hubspot-deal-won-to-thank-you
Search a won HubSpot deal, read it, then email a SendGrid thank-you.
Searches HubSpot deals for a closed-won stage, retrieves the matching deal detail, and sends a thank-you email to the customer email address through SendGrid.
3 steps inputs: customerEmail, dealId, fromEmail outputs: amount, dealName, emailStatus
1
find-won-deals
$sourceDescriptions.hubspotDealsApi.searchDeals
Search HubSpot for deals in the closed-won stage.
2
get-deal
$sourceDescriptions.hubspotDealsApi.getDeal
Retrieve the full detail of the won deal.
3
send-thank-you
$sourceDescriptions.sendgridMailApi.SendMail
Send a thank-you email to the customer via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

crm-hubspot-deal-won-to-sendgrid-email-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: HubSpot Deal Won to SendGrid Email
  summary: Find a won HubSpot deal, then send a thank-you email via SendGrid.
  description: >-
    A cross-provider workflow that searches HubSpot CRM for a closed-won deal,
    reads its detail, and sends a celebratory thank-you email to the customer
    through SendGrid's Mail Send API. Demonstrates triggering a customer
    communication off a sales milestone reached in the CRM.
  version: 1.0.0
sourceDescriptions:
  - name: hubspotDealsApi
    url: https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/openapi/hubspot-crm-deals-api-openapi.yml
    type: openapi
  - name: sendgridMailApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: hubspot-deal-won-to-thank-you
    summary: Search a won HubSpot deal, read it, then email a SendGrid thank-you.
    description: >-
      Searches HubSpot deals for a closed-won stage, retrieves the matching deal
      detail, and sends a thank-you email to the customer email address through
      SendGrid.
    inputs:
      type: object
      properties:
        dealId:
          type: string
        customerEmail:
          type: string
        fromEmail:
          type: string
    steps:
      - stepId: find-won-deals
        description: Search HubSpot for deals in the closed-won stage.
        operationId: $sourceDescriptions.hubspotDealsApi.searchDeals
        requestBody:
          contentType: application/json
          payload:
            filterGroups:
              - filters:
                  - propertyName: dealstage
                    operator: EQ
                    value: closedwon
            properties:
              - dealname
              - amount
            limit: 1
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          total: $response.body#/total
      - stepId: get-deal
        description: Retrieve the full detail of the won deal.
        operationId: $sourceDescriptions.hubspotDealsApi.getDeal
        parameters:
          - name: dealId
            in: path
            value: $inputs.dealId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          dealName: $response.body#/properties/dealname
          amount: $response.body#/properties/amount
      - stepId: send-thank-you
        description: Send a thank-you email to the customer via SendGrid.
        operationId: $sourceDescriptions.sendgridMailApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.customerEmail
                subject: Thank you for your business
            from:
              email: $inputs.fromEmail
            content:
              - type: text/plain
                value: We are thrilled to be working with you on your new order.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      dealName: $steps.get-deal.outputs.dealName
      amount: $steps.get-deal.outputs.amount
      emailStatus: $steps.send-thank-you.outputs.emailStatus