Automate OpenAI DALL-E image editing using a custom n8n workflow. Trigger edits with a prompt and source image, then convert the Base64 output back to a file using an n8n node.
Download this n8n workflow template and start using it instantly.
This specialized n8n workflow addresses the challenge of integrating complex, multi-part form data API calls, specifically for the OpenAI Image Generation 1 Edits endpoint. By utilizing the flexible HTTP Request n8n node, this n8n template demonstrates how to successfully upload a source image, pass a text prompt, and handle the resulting Base64 file output from the AI service. This n8n automation is crucial for developers looking to build scalable image editing tools or SaaS products where user interaction (via the When chat message received n8n trigger) dictates the image transformation. The output of this robust n8n workflow is a ready-to-use image file.
The n8n workflow initiates using the specialized When chat message received n8n trigger. This powerful n8n trigger captures both the source image (uploaded as binary data) and the user's text instruction (the prompt).
API KEY n8n node immediately follows, securely setting the user's OpenAI secret key into the data stream, preparing it for authentication.HTTP Request n8n node executes a POST call to the OpenAI Edits API (/v1/images/edits). This n8n node is configured specifically for multipart-form-data, ensuring that the uploaded image binary data (data0) and the dynamic prompt ({{ $...chatInput }}) are correctly packaged and sent, along with necessary headers containing the bearer token.Convert to File n8n node. This essential n8n node decodes the Base64 string property (data[0].b64_json) back into a standard binary file, completing the n8n workflow and making the edited image accessible for subsequent actions.To deploy this n8n workflow template:
API KEY n8n node. Edit the placeholder value (sk-proj-...) to include your actual OpenAI secret API key. Note that while this n8n node uses a Set function, for production n8n workflows, it is best practice to use an n8n credential.When chat message received n8n trigger is active. You may need to expose the webhook URL associated with this n8n trigger if integrating with an external chat interface. When chat message received (n8n trigger)
Function: Acts as the starting n8n trigger for the automation, capturing the text prompt and allowing file uploads (the source image) which are then passed to the next n8n node.
Key Configuration: allowFileUploads: true ensures the source image is captured.
API KEY (Set n8n node)
Function: Inserts the OpenAI API key into the workflow data structure (openAIKey) for authorization in the subsequent HTTP Request n8n node.
Key Configuration: Sets the openAIKey variable.
HTTP Request (n8n node)
Function: Performs the core task: sending the image and prompt to the OpenAI Image Edits API via a POST request.
Key Configuration: URL: https://api.openai.com/v1/images/edits. contentType: multipart-form-data. Sends binary data from the trigger (data0) as the image parameter and the chat input as the prompt parameter.
Convert to File (n8n node)
Function: Transforms the Base64 encoded image data received in the API response into a usable binary file within the n8n context.
Key Configuration: operation: toBinary. sourceProperty: data[0].b64_json (the location of the Base64 string in the OpenAI response).
Automate company profile enrichment. This n8n workflow scrapes website content, uses the OpenAI n8n node for data classification (B2B, industry, value prop), and updates Google Sheets automatically. Find more n8n templates.

Use this comprehensive n8n workflow to deploy a high-fidelity RAG chatbot. It connects Google Drive files directly to the OpenAI Assistants API, serving responses via an interactive n8n trigger.

Create a powerful n8n workflow for autonomous AI research using OpenRouter, SerpAPI, and Jina AI. Generate comprehensive, structured reports from any user query.

Deploy a powerful n8n workflow featuring an AI Agent powered by GPT-4 and DALL-E. Use this n8n automation to generate custom logos, style guides, and gradient backgrounds on demand via a chat interface.









































