arazzo: 1.0.1 info: title: Confluence Audit and Prune a Page Attachment summary: List a page's attachments, inspect one in full, and delete it when the caller confirms. description: >- Attachments are where Confluence spaces quietly accumulate stale files and storage cost, and a listing alone does not carry enough detail to justify a deletion. This flow lists the attachments on a page, reads one attachment in full to expose its media type, file size, version, and download link, and then deletes it only when the caller explicitly confirms. The inspect step is what makes the deletion defensible. 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: audit-page-attachment summary: Inspect an attachment on a Confluence page and optionally remove it. description: >- Lists a page's attachments, reads the target attachment's full record, and deletes it when deletion is confirmed. inputs: type: object required: - pageId - attachmentId - confirmDelete properties: pageId: type: string description: The id of the page whose attachments are being audited. attachmentId: type: string description: The id of the attachment to inspect and possibly remove. confirmDelete: type: boolean description: >- When true the inspected attachment is deleted. When false the flow is a read-only audit and stops after the inspection. steps: - stepId: listPageAttachments description: >- List the attachments on the page to establish the audit context and show what else is stored against this page. operationId: getPageAttachments parameters: - name: id in: path value: $inputs.pageId - name: limit in: query value: 250 successCriteria: - condition: $statusCode == 200 outputs: attachments: $response.body#/results nextCursor: $response.body#/_links/next - stepId: inspectAttachment description: >- Read the target attachment in full to expose the media type, file size, version, and download link that a listing does not fully carry. This is the evidence the deletion decision rests on. operationId: getAttachmentById parameters: - name: id in: path value: $inputs.attachmentId successCriteria: - condition: $statusCode == 200 outputs: title: $response.body#/title mediaType: $response.body#/mediaType fileSize: $response.body#/fileSize attachmentStatus: $response.body#/status downloadLink: $response.body#/downloadLink parentPageId: $response.body#/pageId versionNumber: $response.body#/version/number onSuccess: - name: deleteConfirmed type: goto stepId: deleteAttachment criteria: - condition: $inputs.confirmDelete == true - name: auditOnly type: end criteria: - condition: $inputs.confirmDelete == false - stepId: deleteAttachment description: >- Delete the inspected attachment. Only reached once the caller has confirmed, and after the full record has been captured above. operationId: deleteAttachment parameters: - name: id in: path value: $inputs.attachmentId successCriteria: - condition: $statusCode == 204 outputs: deletedAttachmentId: $inputs.attachmentId outputs: attachments: $steps.listPageAttachments.outputs.attachments inspectedTitle: $steps.inspectAttachment.outputs.title inspectedFileSize: $steps.inspectAttachment.outputs.fileSize deletedAttachmentId: $steps.deleteAttachment.outputs.deletedAttachmentId