Google Tag Manager · Arazzo Workflow

Google Tag Manager Audit Container Versions

Version 1.0.0

List a container's version headers, then fetch the newest one in full.

1 workflow 1 source API 1 provider
View Spec View on GitHub AnalyticsConversion TrackingMarketingTag ManagementTrackingArazzoWorkflows

Provider

google-tag-manager

Workflows

audit-container-versions
List container version headers and get the newest version in detail.
Lists the container version headers for the supplied container and, when at least one is present, fetches the first version document for inspection.
2 steps inputs: accessToken, containerPath, includeDeleted outputs: firstVersionPath, versionName
1
listVersionHeaders
listContainerVersionHeaders
List all container version headers for the container.
2
getVersion
getContainerVersion
Fetch the first container version document returned by the list.

Source API Descriptions

Arazzo Workflow Specification

google-tag-manager-audit-container-versions-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Google Tag Manager Audit Container Versions
  summary: List a container's version headers, then fetch the newest one in full.
  description: >-
    A version-history audit flow. The workflow lists the container version
    headers for a container and branches: when at least one version exists it
    fetches the first (most recent) version document in full, and when no
    versions exist it ends. Each step spells out its request inline, including
    the inline bearer authorization, so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: googleTagManagerApi
  url: ../openapi/google-tag-manager-api-v2-openapi.yml
  type: openapi
workflows:
- workflowId: audit-container-versions
  summary: List container version headers and get the newest version in detail.
  description: >-
    Lists the container version headers for the supplied container and, when at
    least one is present, fetches the first version document for inspection.
  inputs:
    type: object
    required:
    - accessToken
    - containerPath
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer access token for the Tag Manager API.
      containerPath:
        type: string
        description: >-
          The container API relative path, e.g.
          accounts/{accountId}/containers/{containerId}.
      includeDeleted:
        type: boolean
        description: Also retrieve deleted (archived) versions when true.
  steps:
  - stepId: listVersionHeaders
    description: >-
      List all container version headers for the container.
    operationId: listContainerVersionHeaders
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: parent
      in: path
      value: $inputs.containerPath
    - name: includeDeleted
      in: query
      value: $inputs.includeDeleted
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstVersionPath: $response.body#/containerVersionHeader/0/path
    onSuccess:
    - name: hasVersions
      type: goto
      stepId: getVersion
      criteria:
      - context: $response.body
        condition: $.containerVersionHeader.length > 0
        type: jsonpath
    - name: noVersions
      type: end
      criteria:
      - context: $response.body
        condition: $.containerVersionHeader.length == 0
        type: jsonpath
  - stepId: getVersion
    description: >-
      Fetch the first container version document returned by the list.
    operationId: getContainerVersion
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: versionPath
      in: path
      value: $steps.listVersionHeaders.outputs.firstVersionPath
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      versionPath: $response.body#/path
      versionName: $response.body#/name
      tags: $response.body#/tag
      triggers: $response.body#/trigger
      variables: $response.body#/variable
  outputs:
    firstVersionPath: $steps.listVersionHeaders.outputs.firstVersionPath
    versionName: $steps.getVersion.outputs.versionName