arazzo: 1.0.1 info: title: Webflow Apply Custom Code and Publish summary: List a site's registered scripts, apply one to the site, then publish the site. description: >- Activates a registered custom-code script across a Webflow site. The workflow lists the scripts registered to the site, applies the first registered script to the site header, and publishes the site so the script runs on the live pages. Each 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: webflowDataApi url: ../openapi/webflow-data-api-openapi.yml type: openapi workflows: - workflowId: apply-custom-code summary: Apply a registered script to a site and publish it. description: >- Lists the registered scripts for a site, applies the first one to the site header, and publishes the site so the script goes live. inputs: type: object required: - accessToken - siteId - scriptVersion properties: accessToken: type: string description: Webflow OAuth bearer token with custom_code:read, custom_code:write, and sites:write scopes. siteId: type: string description: Unique identifier for the Site to apply the script to. scriptVersion: type: string description: Semantic version string of the registered script to apply (e.g. 1.0.0). steps: - stepId: listScripts description: List the scripts registered to the site. operationId: get-scripts parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: site_id in: path value: $inputs.siteId successCriteria: - condition: $statusCode == 200 outputs: firstScriptId: $response.body#/registeredScripts/0/id - stepId: applyCustomCode description: Apply the first registered script to the site header. operationId: add-custom-code-tosite parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: site_id in: path value: $inputs.siteId requestBody: contentType: application/json payload: scripts: - id: $steps.listScripts.outputs.firstScriptId location: header version: $inputs.scriptVersion successCriteria: - condition: $statusCode == 200 outputs: scripts: $response.body#/scripts - stepId: publishSite description: Publish the site so the applied script runs on the live pages. operationId: site-publish parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: site_id in: path value: $inputs.siteId requestBody: contentType: application/json payload: publishToWebflowSubdomain: true successCriteria: - condition: $statusCode == 202 outputs: publishToWebflowSubdomain: $response.body#/publishToWebflowSubdomain outputs: siteId: $inputs.siteId scripts: $steps.applyCustomCode.outputs.scripts