arazzo: 1.0.1 info: title: Confluence Archive or Delete a Blog Post summary: Find a blog post by title, archive it to preserve the record, and optionally delete it. description: >- Retiring an announcement is a two-speed decision: archiving keeps the post and its history addressable while removing it from circulation, and deleting removes it. This flow finds the post by title, reads it for the version that an archive write must supersede, sets its status to archived, and then branches on the caller's intent, only issuing the delete when it is explicitly requested. Archiving is the reversible default. 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: retire-blog-post summary: Archive a Confluence blog post and optionally delete it. description: >- Locates a blog post by title, archives it with a version-incremented update, and deletes it only when the caller asks for deletion rather than archival. inputs: type: object required: - title - newVersionNumber - deleteAfterArchive properties: title: type: string description: The exact title of the blog post to retire. newVersionNumber: type: integer description: >- The version number to write when archiving, 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. deleteAfterArchive: type: boolean description: >- When true the post is deleted after archiving. When false the flow stops at archived, which is the reversible outcome. versionMessage: type: string description: Changelog message explaining the retirement, recorded on the new version. steps: - stepId: findBlogPost description: >- Filter current blog posts by exact title so the retirement cannot be applied to the wrong post. operationId: getBlogPosts parameters: - name: title in: query value: $inputs.title - name: status in: query value: current - 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 post in storage format to capture the body to carry forward and the current version the archive write must supersede. operationId: getBlogPostById parameters: - name: id in: path value: $steps.findBlogPost.outputs.blogPostId - name: body-format in: query value: storage successCriteria: - condition: $statusCode == 200 outputs: currentVersion: $response.body#/version/number body: $response.body#/body authorId: $response.body#/authorId createdAt: $response.body#/createdAt - stepId: archiveBlogPost description: >- Set the post's status to archived, preserving its content and history while taking it out of circulation. operationId: updateBlogPost parameters: - name: id in: path value: $steps.findBlogPost.outputs.blogPostId requestBody: contentType: application/json payload: id: $steps.findBlogPost.outputs.blogPostId status: archived title: $inputs.title body: representation: storage value: $steps.readBlogPost.outputs.body version: number: $inputs.newVersionNumber message: $inputs.versionMessage successCriteria: - condition: $statusCode == 200 outputs: blogPostId: $response.body#/id blogPostStatus: $response.body#/status versionNumber: $response.body#/version/number onSuccess: - name: deleteRequested type: goto stepId: deleteBlogPost criteria: - condition: $inputs.deleteAfterArchive == true - name: archiveOnly type: end criteria: - condition: $inputs.deleteAfterArchive == false - stepId: deleteBlogPost description: >- Delete the archived blog post. Only reached when the caller explicitly asked for deletion rather than archival. operationId: deleteBlogPost parameters: - name: id in: path value: $steps.findBlogPost.outputs.blogPostId successCriteria: - condition: $statusCode == 204 outputs: deletedBlogPostId: $steps.findBlogPost.outputs.blogPostId outputs: blogPostId: $steps.findBlogPost.outputs.blogPostId archivedStatus: $steps.archiveBlogPost.outputs.blogPostStatus deletedBlogPostId: $steps.deleteBlogPost.outputs.deletedBlogPostId