arazzo: 1.0.1 info: title: ActiveCampaign Create Contact and Associate to an Account by Name summary: Resolve an account by name, create a contact, then associate them. description: >- A B2B contact intake flow. The workflow searches accounts by name, confirms a match was returned, creates a new contact, and then associates that contact with the matched account along with a job title. 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: activecampaignApi url: ../openapi/activecampaign-v3.json type: openapi workflows: - workflowId: create-contact-associate-account-by-name summary: Resolve an account by name, create a contact, then associate them. description: >- Searches accounts by name, creates a contact, and associates the new contact with the matched account. inputs: type: object required: - apiToken - accountName - email properties: apiToken: type: string description: ActiveCampaign API token sent in the Api-Token header. accountName: type: string description: Name used to resolve the target account. email: type: string description: Email address of the contact to create. firstName: type: string description: Optional first name of the contact. lastName: type: string description: Optional last name of the contact. jobTitle: type: string description: Optional job title of the contact within the account. steps: - stepId: findAccount description: Search accounts by the supplied name. operationId: list-all-accounts parameters: - name: Api-Token in: header value: $inputs.apiToken - name: search in: query value: $inputs.accountName successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.accounts.length > 0 type: jsonpath outputs: accountId: $response.body#/accounts/0/id - stepId: createContact description: Create the contact from the supplied email and name fields. operationId: create-a-new-contact parameters: - name: Api-Token in: header value: $inputs.apiToken requestBody: contentType: application/json payload: contact: email: $inputs.email firstName: $inputs.firstName lastName: $inputs.lastName successCriteria: - condition: $statusCode == 201 outputs: contactId: $response.body#/contact/id - stepId: associateContact description: Associate the new contact with the matched account. operationId: create-an-account-1 parameters: - name: Api-Token in: header value: $inputs.apiToken requestBody: contentType: application/json payload: accountContact: account: $steps.findAccount.outputs.accountId contact: $steps.createContact.outputs.contactId jobTitle: $inputs.jobTitle successCriteria: - condition: $statusCode == 201 outputs: accountContactId: $response.body#/accountContact/id outputs: accountId: $steps.findAccount.outputs.accountId contactId: $steps.createContact.outputs.contactId accountContactId: $steps.associateContact.outputs.accountContactId