Confluence · Arazzo Workflow

Confluence Move a Page to a New Parent

Version 1.0.0

Verify a page and a target parent, inspect the destination subtree, then reparent the page.

1 workflow 1 source API 1 provider
View Spec View on GitHub CollaborationContent ManagementDocumentationKnowledge BaseWikiArazzoWorkflows

Provider

confluence

Workflows

move-page-to-new-parent
Reparent a Confluence page under a different page in the tree.
Reads the source page and the target parent, lists the target's children to expose collisions, and updates the source page with the new parentId.
4 steps inputs: newParentId, newVersionNumber, pageId, versionMessage outputs: newParentId, pageId, previousParentId, versionNumber
1
readSourcePage
getPageById
Read the page being moved to capture its title, space, status, and the current version number that the update must supersede.
2
readTargetParent
getPageById
Read the intended parent to confirm it exists and to compare its space against the source page's space; Confluence will not accept a move that crosses spaces via parentId alone.
3
listTargetChildren
getChildPages
List the pages already sitting under the target parent so a duplicate title at the destination is visible before the move is committed.
4
reparentPage
updatePage
Commit the move by updating the page with the new parentId, preserving its existing title, space, and status.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Confluence Move a Page to a New Parent
  summary: Verify a page and a target parent, inspect the destination subtree, then reparent the page.
  description: >-
    Reorganising a page tree is a routine but destructive-feeling operation, so
    this flow checks before it moves. It reads the page being moved to capture
    its current version and space, reads the target parent to confirm it exists
    and lives in the same space, lists the destination's existing children so a
    title collision is visible before the write, and then issues the update that
    sets the new parentId. 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: confluenceCloudV2
  url: ../openapi/confluence-cloud-v2.yml
  type: openapi
workflows:
- workflowId: move-page-to-new-parent
  summary: Reparent a Confluence page under a different page in the tree.
  description: >-
    Reads the source page and the target parent, lists the target's children to
    expose collisions, and updates the source page with the new parentId.
  inputs:
    type: object
    required:
    - pageId
    - newParentId
    - newVersionNumber
    properties:
      pageId:
        type: string
        description: The id of the page to move.
      newParentId:
        type: string
        description: The id of the page that should become the new parent.
      newVersionNumber:
        type: integer
        description: >-
          The version number to write, which Confluence requires to be the
          current version plus one. Arazzo runtime expressions have no
          arithmetic, so the caller supplies this value; readSourcePage returns
          currentVersion to compute it from.
      versionMessage:
        type: string
        description: Optional changelog message recorded on the new version.
  steps:
  - stepId: readSourcePage
    description: >-
      Read the page being moved to capture its title, space, status, and the
      current version number that the update must supersede.
    operationId: getPageById
    parameters:
    - name: id
      in: path
      value: $inputs.pageId
    - name: body-format
      in: query
      value: storage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      title: $response.body#/title
      spaceId: $response.body#/spaceId
      status: $response.body#/status
      currentParentId: $response.body#/parentId
      currentVersion: $response.body#/version/number
      bodyValue: $response.body#/body
  - stepId: readTargetParent
    description: >-
      Read the intended parent to confirm it exists and to compare its space
      against the source page's space; Confluence will not accept a move that
      crosses spaces via parentId alone.
    operationId: getPageById
    parameters:
    - name: id
      in: path
      value: $inputs.newParentId
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.status == 'current'
      type: jsonpath
    outputs:
      targetSpaceId: $response.body#/spaceId
      targetTitle: $response.body#/title
  - stepId: listTargetChildren
    description: >-
      List the pages already sitting under the target parent so a duplicate
      title at the destination is visible before the move is committed.
    operationId: getChildPages
    parameters:
    - name: id
      in: path
      value: $inputs.newParentId
    - name: limit
      in: query
      value: 250
    - name: sort
      in: query
      value: title
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      existingChildren: $response.body#/results
  - stepId: reparentPage
    description: >-
      Commit the move by updating the page with the new parentId, preserving its
      existing title, space, and status.
    operationId: updatePage
    parameters:
    - name: id
      in: path
      value: $inputs.pageId
    requestBody:
      contentType: application/json
      payload:
        id: $inputs.pageId
        status: $steps.readSourcePage.outputs.status
        title: $steps.readSourcePage.outputs.title
        spaceId: $steps.readSourcePage.outputs.spaceId
        parentId: $inputs.newParentId
        body:
          representation: storage
          value: $steps.readSourcePage.outputs.bodyValue
        version:
          number: $inputs.newVersionNumber
          message: $inputs.versionMessage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      pageId: $response.body#/id
      parentId: $response.body#/parentId
      versionNumber: $response.body#/version/number
      webui: $response.body#/_links/webui
  outputs:
    pageId: $steps.reparentPage.outputs.pageId
    previousParentId: $steps.readSourcePage.outputs.currentParentId
    newParentId: $steps.reparentPage.outputs.parentId
    versionNumber: $steps.reparentPage.outputs.versionNumber