Webflow API and Documentation · Arazzo Workflow

Webflow Apply Custom Code and Publish

Version 1.0.0

List a site's registered scripts, apply one to the site, then publish the site.

1 workflow 1 source API 1 provider
View Spec View on GitHub CMSContent ManagementEcommerceNo-CodePublishingWeb DevelopmentArazzoWorkflows

Provider

webflow-api-and-documentation-webflow

Workflows

apply-custom-code
Apply a registered script to a site and publish it.
Lists the registered scripts for a site, applies the first one to the site header, and publishes the site so the script goes live.
3 steps inputs: accessToken, scriptVersion, siteId outputs: scripts, siteId
1
listScripts
get-scripts
List the scripts registered to the site.
2
applyCustomCode
add-custom-code-tosite
Apply the first registered script to the site header.
3
publishSite
site-publish
Publish the site so the applied script runs on the live pages.

Source API Descriptions

Arazzo Workflow Specification

webflow-api-and-documentation-webflow-apply-custom-code-workflow.yml Raw ↑
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