Mailchimp · Arazzo Workflow

Mailchimp Find Campaign and Pull Its Report

Version 1.0.0

Search campaigns by query, then retrieve the report for the first match.

1 workflow 1 source API 1 provider
View Spec View on GitHub CampaignsEmail MarketingMarketing AutomationNewslettersTransactional EmailArazzoWorkflows

Provider

mailchimp

Workflows

find-campaign-pull-report
Search for a campaign and retrieve its report.
Searches campaigns by query and pulls the report for the first match; ends if there are no matches.
2 steps inputs: query outputs: campaignId, emailsSent
1
searchCampaigns
getSearchCampaigns
Search campaigns matching the supplied query string.
2
getReport
getReportsId
Retrieve the campaign report (sends, opens, clicks) for the first matched campaign.

Source API Descriptions

Arazzo Workflow Specification

mailchimp-find-campaign-pull-report-workflow.yml Raw ↑
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
sourceDescriptions:
- name: mailchimpMarketingApi
  url: ../openapi/mailchimp-marketing-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