Cross-Provider Workflow

Treblle API Problem Request to SendGrid Email

Version 1.0.0

Inspect failing Treblle requests, pull one's detail, and email an alert via SendGrid.

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

Providers Orchestrated

treblle sendgrid

Workflows

api-problem-email-alert
List Treblle requests, get one's detail, and email an alert via SendGrid.
Lists captured requests for a Treblle project, retrieves the detail of a problematic request, and emails an alert to the on-call engineer through SendGrid.
3 steps inputs: projectId, recipientEmail, requestId outputs: messageStatus, responseCode
1
list-requests
$sourceDescriptions.treblleApi.listRequests
List captured requests for the Treblle project.
2
get-request
$sourceDescriptions.treblleApi.getRequest
Retrieve the detail of the problematic request.
3
email-alert
$sourceDescriptions.sendgridMailApi.SendMail
Email an API problem alert to the on-call engineer via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

sec-treblle-api-problem-to-sendgrid-email.yml Raw ↑
arazzo: 1.0.1
info:
  title: Treblle API Problem Request to SendGrid Email
  summary: Inspect failing Treblle requests, pull one's detail, and email an alert via SendGrid.
  description: >-
    An API monitoring workflow that lists captured requests for a Treblle project, retrieves
    the detail of a problematic request, and emails an alert to the on-call engineer through
    SendGrid's Mail Send API. Demonstrates orchestrating an API observability platform with a
    communications provider in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: treblleApi
    url: https://raw.githubusercontent.com/api-evangelist/treblle/refs/heads/main/openapi/treblle-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: api-problem-email-alert
    summary: List Treblle requests, get one's detail, and email an alert via SendGrid.
    description: >-
      Lists captured requests for a Treblle project, retrieves the detail of a problematic
      request, and emails an alert to the on-call engineer through SendGrid.
    inputs:
      type: object
      properties:
        projectId:
          type: string
        requestId:
          type: string
        recipientEmail:
          type: string
    steps:
      - stepId: list-requests
        description: List captured requests for the Treblle project.
        operationId: $sourceDescriptions.treblleApi.listRequests
        parameters:
          - name: projectId
            in: path
            value: $inputs.projectId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          requestCount: $response.body#/meta/total
      - stepId: get-request
        description: Retrieve the detail of the problematic request.
        operationId: $sourceDescriptions.treblleApi.getRequest
        parameters:
          - name: projectId
            in: path
            value: $inputs.projectId
          - name: requestId
            in: path
            value: $inputs.requestId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          responseCode: $response.body#/data/response/code
          path: $response.body#/data/request/url
      - stepId: email-alert
        description: Email an API problem alert to the on-call engineer via SendGrid.
        operationId: $sourceDescriptions.sendgridMailApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.recipientEmail
                subject: Treblle API problem detected
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: A problematic API request was detected in Treblle and needs review.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          messageStatus: $statusCode
    outputs:
      responseCode: $steps.get-request.outputs.responseCode
      messageStatus: $steps.email-alert.outputs.messageStatus