arazzo: 1.0.1 info: title: WhatsApp Find and Update Message Template summary: Locate a template by name and edit its body, when it is in an editable state. description: >- Only APPROVED or PAUSED templates can be edited, and edits re-trigger Meta's approval process. This workflow lists templates on a WhatsApp Business Account filtered by name, branches on whether the matched template is in an editable status, and when it is submits an update to its BODY component against the template ID. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: whatsappBusinessManagementApi url: ../openapi/whatsapp-business-management-api-openapi.yml type: openapi workflows: - workflowId: update-template summary: Resolve an editable template by name and update its body text. description: >- Lists templates filtered by name to find a matching template ID, and only when the matched template is APPROVED submits an update to its BODY component. inputs: type: object required: - accessToken - wabaId - templateName - newBodyText properties: accessToken: type: string description: Access token with whatsapp_business_management permission. wabaId: type: string description: The WhatsApp Business Account ID that owns the template. templateName: type: string description: The template name to look up and update. newBodyText: type: string description: The new BODY component text for the template. steps: - stepId: findTemplate description: >- List templates filtered by name to resolve the template ID and current status. operationId: listMessageTemplates parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: waba-id in: path value: $inputs.wabaId - name: name in: query value: $inputs.templateName successCriteria: - condition: $statusCode == 200 outputs: templateId: $response.body#/data/0/id templateStatus: $response.body#/data/0/status onSuccess: - name: templateEditable type: goto stepId: editTemplate criteria: - context: $response.body condition: $.data[0].status == "APPROVED" type: jsonpath - name: templateNotEditable type: end criteria: - context: $response.body condition: $.data[0].status != "APPROVED" type: jsonpath - stepId: editTemplate description: >- Submit an update to the matched template's BODY component; the edit re-triggers Meta's approval process. operationId: updateMessageTemplate parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: message-template-id in: path value: $steps.findTemplate.outputs.templateId requestBody: contentType: application/json payload: components: - type: BODY text: $inputs.newBodyText successCriteria: - condition: $statusCode == 200 outputs: success: $response.body#/success outputs: templateId: $steps.findTemplate.outputs.templateId updated: $steps.editTemplate.outputs.success