arazzo: 1.0.1 info: title: Mindbody Book Appointment summary: Find bookable appointment availabilities and book an appointment into an open slot. description: >- A core scheduling flow for appointment-based wellness services. The workflow queries the bookable availabilities for a session type and date range, branches on whether any open slots were returned, and only when an availability exists does it create the appointment for the client. 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: book-appointment summary: Check availability for a session type and book an appointment when a slot is open. description: >- Looks up bookable availabilities, and if one or more open slots are returned, books an appointment for the client with the chosen staff member and session type. inputs: type: object required: - apiKey - siteId - authorization - sessionTypeId - clientId - locationId - staffId - startDateTime 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. sessionTypeId: type: integer description: The session type to search availabilities for. clientId: type: string description: The RSSID of the client the appointment is being made for. locationId: type: integer description: The ID of the location where the appointment takes place. staffId: type: integer description: The ID of the staff member providing the appointment. startDateTime: type: string description: The start date and time of the appointment / availability search. endDate: type: string description: The end date for the availability search. steps: - stepId: findAvailabilities description: >- Retrieve the bookable availabilities for the requested session type and date range. operationId: getBookableItems 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.sessionTypeIds in: query value: $inputs.sessionTypeId - name: request.startDate in: query value: $inputs.startDateTime - name: request.endDate in: query value: $inputs.endDate successCriteria: - condition: $statusCode == 200 outputs: availabilities: $response.body#/Availabilities onSuccess: - name: hasAvailability type: goto stepId: createAppointment criteria: - context: $response.body condition: $.Availabilities.length > 0 type: jsonpath - name: noAvailability type: end criteria: - context: $response.body condition: $.Availabilities.length == 0 type: jsonpath - stepId: createAppointment description: >- Book the appointment for the client into the open slot using the chosen location, staff member, and session type. operationId: addAppointment 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: $inputs.clientId LocationId: $inputs.locationId SessionTypeId: $inputs.sessionTypeId StaffId: $inputs.staffId StartDateTime: $inputs.startDateTime ApplyPayment: true successCriteria: - condition: $statusCode == 200 outputs: appointmentId: $response.body#/Appointment/Id appointmentStatus: $response.body#/Appointment/Status outputs: availabilities: $steps.findAvailabilities.outputs.availabilities appointmentId: $steps.createAppointment.outputs.appointmentId