Confluence · Arazzo Workflow

Confluence Find and Revise a Blog Post

Version 1.0.0

Find a blog post by title, read its current version, and publish a revised body.

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

Provider

confluence

Workflows

revise-blog-post
Locate a Confluence blog post by title and publish a corrected body.
Searches blog posts by exact title, reads the match for its version, and issues a version-incremented update carrying the revised body.
3 steps inputs: newVersionNumber, revisedBody, title, versionMessage outputs: blogPostId, previousVersion, versionNumber, webui
1
findBlogPost
getBlogPosts
Filter current blog posts by exact title, returning at most one match so the revision cannot be applied to the wrong post.
2
readBlogPost
getBlogPostById
Read the matched blog post in storage format to capture the current version number the update must supersede and the original body for comparison.
3
publishRevision
updateBlogPost
Write the revised body with an incremented version and a changelog message. A 400 here usually means the version number was not current + 1.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Confluence Find and Revise a Blog Post
  summary: Find a blog post by title, read its current version, and publish a revised body.
  description: >-
    Corrections to an announcement have to find the post again without the
    caller having stored its id, and Confluence rejects any update that does not
    carry the next sequential version number. The flow filters blog posts by
    title, reads the matched post to capture its current version and space, and
    writes the revised body with a changelog message so the edit is attributable
    in the post's version history. 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: revise-blog-post
  summary: Locate a Confluence blog post by title and publish a corrected body.
  description: >-
    Searches blog posts by exact title, reads the match for its version, and
    issues a version-incremented update carrying the revised body.
  inputs:
    type: object
    required:
    - title
    - revisedBody
    - newVersionNumber
    properties:
      title:
        type: string
        description: The exact title of the blog post to revise.
      revisedBody:
        type: string
        description: The corrected blog post body in Confluence storage format (XHTML).
      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; readBlogPost returns
          currentVersion to compute it from and to verify against.
      versionMessage:
        type: string
        description: Changelog message explaining the correction, recorded on the new version.
  steps:
  - stepId: findBlogPost
    description: >-
      Filter current blog posts by exact title, returning at most one match so
      the revision cannot be applied to the wrong post.
    operationId: getBlogPosts
    parameters:
    - name: title
      in: query
      value: $inputs.title
    - name: status
      in: query
      value: current
    - name: sort
      in: query
      value: -created-date
    - name: limit
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.results.length > 0
      type: jsonpath
    outputs:
      blogPostId: $response.body#/results/0/id
      spaceId: $response.body#/results/0/spaceId
  - stepId: readBlogPost
    description: >-
      Read the matched blog post in storage format to capture the current
      version number the update must supersede and the original body for
      comparison.
    operationId: getBlogPostById
    parameters:
    - name: id
      in: path
      value: $steps.findBlogPost.outputs.blogPostId
    - name: body-format
      in: query
      value: storage
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.status == 'current'
      type: jsonpath
    outputs:
      currentVersion: $response.body#/version/number
      originalBody: $response.body#/body
      authorId: $response.body#/authorId
  - stepId: publishRevision
    description: >-
      Write the revised body with an incremented version and a changelog
      message. A 400 here usually means the version number was not current + 1.
    operationId: updateBlogPost
    parameters:
    - name: id
      in: path
      value: $steps.findBlogPost.outputs.blogPostId
    requestBody:
      contentType: application/json
      payload:
        id: $steps.findBlogPost.outputs.blogPostId
        status: current
        title: $inputs.title
        body:
          representation: storage
          value: $inputs.revisedBody
        version:
          number: $inputs.newVersionNumber
          message: $inputs.versionMessage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      blogPostId: $response.body#/id
      versionNumber: $response.body#/version/number
      webui: $response.body#/_links/webui
  outputs:
    blogPostId: $steps.publishRevision.outputs.blogPostId
    previousVersion: $steps.readBlogPost.outputs.currentVersion
    versionNumber: $steps.publishRevision.outputs.versionNumber
    webui: $steps.publishRevision.outputs.webui