arazzo: 1.0.1 info: title: Adobe Photoshop Create Document and Render summary: Create a new PSD from dimensions and layers, then render it to a flat image. description: >- Composes a document from nothing but a specification. A new PSD is created with explicit dimensions, resolution, color mode, and bit depth, carrying an image layer and a text layer, and the saved document is then rendered to a flat deliverable. Useful for generating banner sets, social crops, and other sized creative where the document itself is produced programmatically rather than sourced from a template. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI. version: 1.0.0 sourceDescriptions: - name: photoshopApi url: ../openapi/adobe-photoshop-api-openapi-original.yml type: openapi workflows: - workflowId: document-create-and-render summary: Create a PSD with layers and render a flat image from it. description: >- Submits a document creation job with a document specification and layers, polls until the PSD is written, then renders that PSD to a flat image and polls the rendition job to completion. inputs: type: object required: - psdOutputUrl - renditionOutputUrl - artworkUrl - headline properties: width: type: integer description: Document width in pixels. default: 1200 height: type: integer description: Document height in pixels. default: 628 resolution: type: integer description: Document resolution in PPI. default: 72 fill: type: string description: Background fill, white, transparent, or backgroundColor. default: white mode: type: string description: Color mode, rgb, cmyk, or grayscale. default: rgb depth: type: integer description: Bit depth per channel, 8, 16, or 32. default: 8 artworkUrl: type: string description: Pre-signed GET URL of the image placed on the artwork layer. headline: type: string description: Copy to set on the text layer. psdOutputUrl: type: string description: Pre-signed PUT URL where the new PSD is written. renditionOutputUrl: type: string description: Pre-signed PUT URL where the flat rendition is written. steps: - stepId: submitCreateDocument description: >- Create the PSD with the requested canvas specification, an image layer carrying the supplied artwork, and a text layer carrying the headline. operationId: createDocument requestBody: contentType: application/json payload: options: document: width: $inputs.width height: $inputs.height resolution: $inputs.resolution fill: $inputs.fill mode: $inputs.mode depth: $inputs.depth layers: - name: artwork type: layer visible: true input: href: $inputs.artworkUrl storage: external add: insertTop: true - name: headline type: textLayer visible: true text: content: $inputs.headline orientation: horizontal add: insertTop: true outputs: - href: $inputs.psdOutputUrl storage: external type: vnd.adobe.photoshop overwrite: true successCriteria: - condition: $statusCode == 202 outputs: statusHref: $response.body#/_links/self/href - stepId: awaitCreateDocument description: >- Poll the PSD service status endpoint until the document creation job completes. The submit call returns the absolute status URL in _links.self.href; the jobId this operation requires is the final path segment of that URL, so a runner takes that segment from statusHref before issuing the request. operationId: getPsdJobStatus parameters: - name: jobId in: path value: $steps.submitCreateDocument.outputs.statusHref successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.outputs[0].status == 'succeeded' type: jsonpath onFailure: - name: keepPolling type: retry retryAfter: 3 retryLimit: 20 criteria: - context: $response.body condition: $.outputs[0].status == 'pending' || $.outputs[0].status == 'running' type: jsonpath - name: createFailed type: end criteria: - context: $response.body condition: $.outputs[0].status == 'failed' type: jsonpath outputs: psdHref: $response.body#/outputs/0/_links/self/href - stepId: submitRendition description: >- Render the newly created PSD to a flat JPEG sized to the document width. operationId: createRendition requestBody: contentType: application/json payload: inputs: - href: $steps.awaitCreateDocument.outputs.psdHref storage: external outputs: - href: $inputs.renditionOutputUrl storage: external type: image/jpeg width: $inputs.width overwrite: true successCriteria: - condition: $statusCode == 202 outputs: statusHref: $response.body#/_links/self/href - stepId: awaitRendition description: >- Poll until the rendition job reports succeeded and the flat image has been written to the output URL. operationId: getPsdJobStatus parameters: - name: jobId in: path value: $steps.submitRendition.outputs.statusHref successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.outputs[0].status == 'succeeded' type: jsonpath onFailure: - name: keepPolling type: retry retryAfter: 3 retryLimit: 20 criteria: - context: $response.body condition: $.outputs[0].status == 'pending' || $.outputs[0].status == 'running' type: jsonpath - name: renditionFailed type: end criteria: - context: $response.body condition: $.outputs[0].status == 'failed' type: jsonpath outputs: status: $response.body#/outputs/0/status renditionHref: $response.body#/outputs/0/_links/self/href outputs: psdHref: $steps.awaitCreateDocument.outputs.psdHref renditionHref: $steps.awaitRendition.outputs.renditionHref status: $steps.awaitRendition.outputs.status