arazzo: 1.0.1
info:
title: SendGrid Single Send Stats
summary: List Single Sends, branch on whether any exist, and pull aggregate stats for one.
description: >-
A reporting flow over Single Send performance. The workflow lists the
account's Single Sends, branches on whether any were returned, and when at
least one exists retrieves the aggregate stats for the supplied Single Send
ID. Both calls return 200. Each step inlines its request and bearer token so
the flow can be read and run without consulting the OpenAPI files.
version: 1.0.0
x-realizes-capability-ids:
- BC-400.60
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-400.60
capability_name: Digital Marketing Management
spec: sendgrid-single-sends-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: singleSendsApi
url: ../openapi/sendgrid-single-sends-api-openapi.yml
type: openapi
- name: statsApi
url: ../openapi/sendgrid-stats-api-openapi.yml
type: openapi
workflows:
- workflowId: single-send-stats
summary: List Single Sends and pull aggregate stats for one when present.
description: >-
Lists Single Sends and branches: when any exist, retrieves aggregate stats
for the supplied Single Send ID.
inputs:
type: object
required:
- apiKey
- singleSendId
properties:
apiKey:
type: string
description: SendGrid API key sent as a bearer token.
singleSendId:
type: string
description: The Single Send ID to pull aggregate stats for.
steps:
- stepId: listSingleSends
description: >-
List the account's Single Sends and branch on whether any were returned.
operationId: ListSingleSend
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.apiKey"
successCriteria:
- condition: $statusCode == 200
outputs:
result: $response.body#/result
onSuccess:
- name: hasSingleSends
type: goto
stepId: getSingleSendStat
criteria:
- context: $response.body
condition: $.result.length > 0
type: jsonpath
- name: noSingleSends
type: end
criteria:
- context: $response.body
condition: $.result.length == 0
type: jsonpath
- stepId: getSingleSendStat
description: Retrieve aggregate stats for the supplied Single Send ID.
operationId: GetSingleSendStat
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.apiKey"
- name: id
in: path
value: $inputs.singleSendId
successCriteria:
- condition: $statusCode == 200
outputs:
results: $response.body#/results
outputs:
singleSends: $steps.listSingleSends.outputs.result
stats: $steps.getSingleSendStat.outputs.results
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.