arazzo: 1.0.1 info: title: Adobe Firefly Text-to-Image Generation summary: Submit a text-to-image Firefly job, poll until it finishes, and return the generated image URLs. description: >- Generates images from a natural-language prompt using the asynchronous Adobe Firefly generative model. The workflow submits the generation request, takes the returned job id, polls the status endpoint until the job reaches a terminal state, and then branches on the result: when the job succeeds it surfaces the temporary signed URLs of the generated outputs, and when it fails it surfaces the error details. 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: fireflyApi url: ../openapi/adobe-creative-suite-firefly-openapi.yml type: openapi workflows: - workflowId: firefly-text-to-image summary: Generate images from a text prompt and poll the async job to completion. description: >- Submits a text-to-image generation request to Adobe Firefly, polls the job status until it succeeds or fails, and returns the generated output image URLs on success. inputs: type: object required: - prompt properties: prompt: type: string description: Text description of the image to generate. negativePrompt: type: string description: Text description of elements to avoid in the generated image. contentClass: type: string description: Broad content category to guide generation (photo or art). numVariations: type: integer description: Number of image variations to generate (1 to 4). width: type: integer description: Output image width in pixels. height: type: integer description: Output image height in pixels. steps: - stepId: submitGeneration description: >- Submit the text-to-image generation request. The API accepts the job and returns a job id used for polling. operationId: generateImagesAsync requestBody: contentType: application/json payload: prompt: $inputs.prompt negativePrompt: $inputs.negativePrompt contentClass: $inputs.contentClass numVariations: $inputs.numVariations size: width: $inputs.width height: $inputs.height successCriteria: - condition: $statusCode == 202 outputs: jobId: $response.body#/jobId - stepId: pollStatus description: >- Poll the generation job status. Repeats until the job leaves the pending or running state, then branches on success or failure. operationId: getGenerationStatus parameters: - name: jobId in: path value: $steps.submitGeneration.outputs.jobId successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/status outputs: $response.body#/outputs errors: $response.body#/errors onSuccess: - name: jobSucceeded type: goto stepId: reportSuccess criteria: - context: $response.body condition: $.status == "succeeded" type: jsonpath - name: jobFailed type: goto stepId: reportFailure criteria: - context: $response.body condition: $.status == "failed" type: jsonpath - name: stillRunning type: retry stepId: pollStatus retryAfter: 5 retryLimit: 30 criteria: - context: $response.body condition: $.status == "pending" || $.status == "running" type: jsonpath - stepId: reportSuccess description: Surface the generated output images from the succeeded job. operationId: getGenerationStatus parameters: - name: jobId in: path value: $steps.submitGeneration.outputs.jobId successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.status == "succeeded" type: jsonpath outputs: firstImageUrl: $response.body#/outputs/0/image/url outputs: $response.body#/outputs onSuccess: - name: done type: end - stepId: reportFailure description: Surface the error details from the failed generation job. operationId: getGenerationStatus parameters: - name: jobId in: path value: $steps.submitGeneration.outputs.jobId successCriteria: - condition: $statusCode == 200 outputs: errors: $response.body#/errors outputs: jobId: $steps.submitGeneration.outputs.jobId firstImageUrl: $steps.reportSuccess.outputs.firstImageUrl outputs: $steps.reportSuccess.outputs.outputs errors: $steps.reportFailure.outputs.errors