arazzo: 1.0.1
info:
title: Mailchimp Find Campaign and Pull Its Report
summary: Search campaigns by query, then retrieve the report for the first match.
description: >-
A find-then-act reporting flow. The workflow searches campaigns by a query
string and branches on whether any matched: when a campaign is found it
pulls the full report (sends, opens, clicks) for the first match, and when
none match it ends. The matched campaign id threads from the search step
into the report lookup. Authentication uses HTTP Basic auth with any
username and your Mailchimp API key as the password.
version: 1.0.0
x-realizes-capability-ids:
- BC-400.50
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.50
capability_name: Marketing Operations Management
spec: mailchimp-reports-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: reportsApi
url: ../openapi/mailchimp-reports-api-openapi.yml
type: openapi
- name: searchcampaignsApi
url: ../openapi/mailchimp-searchcampaigns-api-openapi.yml
type: openapi
workflows:
- workflowId: find-campaign-pull-report
summary: Search for a campaign and retrieve its report.
description: >-
Searches campaigns by query and pulls the report for the first match; ends
if there are no matches.
inputs:
type: object
required:
- query
properties:
query:
type: string
description: The search query used to filter campaigns (e.g. a title fragment).
steps:
- stepId: searchCampaigns
description: Search campaigns matching the supplied query string.
operationId: getSearchCampaigns
parameters:
- name: query
in: query
value: $inputs.query
successCriteria:
- condition: $statusCode == 200
outputs:
matchedCampaignId: $response.body#/results/0/campaign/id
onSuccess:
- name: campaignFound
type: goto
stepId: getReport
criteria:
- context: $response.body
condition: $.results.length > 0
type: jsonpath
- name: noMatch
type: end
criteria:
- context: $response.body
condition: $.results.length == 0
type: jsonpath
- stepId: getReport
description: >-
Retrieve the campaign report (sends, opens, clicks) for the first matched
campaign.
operationId: getReportsId
parameters:
- name: campaign_id
in: path
value: $steps.searchCampaigns.outputs.matchedCampaignId
successCriteria:
- condition: $statusCode == 200
outputs:
emailsSent: $response.body#/emails_sent
opens: $response.body#/opens/opens_total
clicks: $response.body#/clicks/clicks_total
outputs:
campaignId: $steps.searchCampaigns.outputs.matchedCampaignId
emailsSent: $steps.getReport.outputs.emailsSent
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.