arazzo: 1.0.1
info:
title: ActiveCampaign Resolve Automation by Name and Enroll Contact
summary: Find an automation by name then enroll an existing contact into it.
description: >-
A find-then-act enrollment flow. The workflow lists all automations and
matches one by name, then enrolls the supplied contact into the resolved
automation. Because the automations list endpoint does not accept a name
filter, the match is evaluated client-side from the returned collection.
Every step spells out its request inline, including the Api-Token
authentication header, so the flow can be read and executed without opening
the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: automationsApi
url: ../openapi/activecampaign-automations-api-openapi.yml
type: openapi
- name: contactsApi
url: ../openapi/activecampaign-contacts-api-openapi.yml
type: openapi
workflows:
- workflowId: enroll-contact-in-automation-by-name
summary: Resolve an automation by name and enroll a contact into it.
description: >-
Lists automations, matches the first one whose name equals the supplied
value, and enrolls the supplied contact into that automation.
inputs:
type: object
required:
- apiToken
- automationName
- contactId
properties:
apiToken:
type: string
description: ActiveCampaign API token sent in the Api-Token header.
automationName:
type: string
description: Name of the automation to resolve.
contactId:
type: integer
description: Identifier of the contact to enroll.
steps:
- stepId: listAutomations
description: List all automations so one can be matched by name.
operationId: $sourceDescriptions.automationsApi.list-all-automations
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.automations[?(@.name == '$inputs.automationName')]
type: jsonpath
outputs:
automationId: $response.body#/automations/0/id
- stepId: enrollContact
description: Enroll the supplied contact into the resolved automation.
operationId: $sourceDescriptions.contactsApi.create-new-contactautomation
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
requestBody:
contentType: application/json
payload:
contactAutomation:
contact: $inputs.contactId
automation: $steps.listAutomations.outputs.automationId
successCriteria:
- condition: $statusCode == 201
outputs:
contactAutomationId: $response.body#/contactAutomation/id
outputs:
automationId: $steps.listAutomations.outputs.automationId
contactAutomationId: $steps.enrollContact.outputs.contactAutomationId
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
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. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.