Mailchimp · Arazzo Workflow

Mailchimp Find and Pause an Automation

Version 1.0.0

List classic automations, pick the first, and pause all its emails.

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

Provider

mailchimp

Workflows

find-and-pause-automation
Find the first automation and pause all its emails.
Lists automations and pauses all emails in the first one found; ends if there are none.
2 steps inputs: count outputs: pausedWorkflowId
1
listAutomations
getAutomations
List the classic automation workflows on the account.
2
pauseEmails
postAutomationsIdActionsPauseAllEmails
Pause all emails in the first automation found. Returns a 204 empty response on success.

Source API Descriptions

Arazzo Workflow Specification

mailchimp-find-and-pause-automation-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Mailchimp Find and Pause an Automation
  summary: List classic automations, pick the first, and pause all its emails.
  description: >-
    A find-then-act flow that halts a running automation. The workflow lists the
    account's automations and branches on whether any exist: when at least one
    automation is found it pauses all emails in the first automation, and when
    none exist it ends without acting. The automation (workflow) id from the
    list step is passed straight into the pause action. 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-and-pause-automation
  summary: Find the first automation and pause all its emails.
  description: >-
    Lists automations and pauses all emails in the first one found; ends if
    there are none.
  inputs:
    type: object
    properties:
      count:
        type: integer
        description: Number of automations to request when listing.
        default: 10
  steps:
  - stepId: listAutomations
    description: List the classic automation workflows on the account.
    operationId: getAutomations
    parameters:
    - name: count
      in: query
      value: $inputs.count
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstWorkflowId: $response.body#/automations/0/id
    onSuccess:
    - name: automationFound
      type: goto
      stepId: pauseEmails
      criteria:
      - context: $response.body
        condition: $.automations.length > 0
        type: jsonpath
    - name: noAutomations
      type: end
      criteria:
      - context: $response.body
        condition: $.automations.length == 0
        type: jsonpath
  - stepId: pauseEmails
    description: >-
      Pause all emails in the first automation found. Returns a 204 empty
      response on success.
    operationId: postAutomationsIdActionsPauseAllEmails
    parameters:
    - name: workflow_id
      in: path
      value: $steps.listAutomations.outputs.firstWorkflowId
    successCriteria:
    - condition: $statusCode == 204
  outputs:
    pausedWorkflowId: $steps.listAutomations.outputs.firstWorkflowId