arazzo: 1.0.1 info: title: Mindbody Log Client Contact summary: Find a client and add a contact log entry to their record. description: >- A CRM follow-up flow for studio staff. The workflow searches for a client by search text, captures the matching client id, and adds a contact log entry recording an outreach interaction. Every step inlines the Mindbody API-Key, SiteId, and staff authorization headers along with its request body so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: mindbodyApi url: ../openapi/mindbody-public-api-v6-openapi-original.yml type: openapi workflows: - workflowId: log-client-contact summary: Resolve a client and record a contact log entry against their record. description: >- Searches the client directory and, when a client is found, adds a contact log entry with the supplied text, contact method, and assigned staff member. inputs: type: object required: - apiKey - siteId - authorization - searchText - text - contactMethod - assignedToStaffId properties: apiKey: type: string description: The Mindbody-issued API key sent in the API-Key header. siteId: type: string description: The ID of the site from which to pull data and write records. authorization: type: string description: A staff user authorization (OAuth bearer) token. searchText: type: string description: Name, email, or other text used to find the client. text: type: string description: The body of the contact log entry. contactMethod: type: string description: How the client wants to be contacted. assignedToStaffId: type: integer description: The ID of the staff member the contact log is assigned to. steps: - stepId: findClient description: >- Search the client directory by the supplied search text and capture the first matching client id. operationId: getClients parameters: - name: version in: path value: '6' - name: API-Key in: header value: $inputs.apiKey - name: siteId in: header value: $inputs.siteId - name: authorization in: header value: $inputs.authorization - name: request.searchText in: query value: $inputs.searchText - name: request.limit in: query value: 1 successCriteria: - condition: $statusCode == 200 outputs: clientId: $response.body#/Clients/0/Id onSuccess: - name: clientFound type: goto stepId: addContactLog criteria: - context: $response.body condition: $.Clients.length > 0 type: jsonpath - name: clientMissing type: end criteria: - context: $response.body condition: $.Clients.length == 0 type: jsonpath - stepId: addContactLog description: >- Add a contact log entry recording the outreach interaction against the matched client. operationId: addContactLog parameters: - name: version in: path value: '6' - name: API-Key in: header value: $inputs.apiKey - name: siteId in: header value: $inputs.siteId - name: authorization in: header value: $inputs.authorization requestBody: contentType: application/json payload: ClientId: $steps.findClient.outputs.clientId Text: $inputs.text ContactMethod: $inputs.contactMethod AssignedToStaffId: $inputs.assignedToStaffId successCriteria: - condition: $statusCode == 200 outputs: contactLogId: $response.body#/Id outputs: clientId: $steps.findClient.outputs.clientId contactLogId: $steps.addContactLog.outputs.contactLogId