Automate OpenAI Image Editing with n8n Workflow

Discover how this n8n workflow automates OpenAI ImageGen v1 image editing via chat triggers, saving you hours with seamless integration and instant image conversion.
chatTrigger
httpRequest
convertToFile
+2
Workflow Identifier: 1618
NODES in Use: chatTrigger, set, httpRequest, convertToFile, stickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This n8n workflow edits images automatically by using text instructions from chat messages and OpenAI’s ImageGen API.

It removes slow manual work, saving hours by sending images and text prompts to the API, getting edited images back, and making them ready for download or upload without extra steps.

You can use the edited images right away in emails, cloud storage, or social media posts.


Who Should Use This Workflow

This workflow suits people who need fast image editing from text instructions and want to stop spending many hours editing manually.

Freelancers, small business owners, and creative workers can benefit by cutting tedious back-and-forth steps.

No deep technical skills are needed if you follow the guide and have basic n8n knowledge.


Tools and Services Used

  • n8n: Automation platform to run the workflow.
  • OpenAI API: Specifically ImageGen v1 for editing images via API calls.
  • Chat Trigger node: Captures chat messages with text and image attachments.
  • HTTP Request node: Sends the image and prompt to OpenAI API.
  • Convert to File node: Changes base64 image data to binary file format.

This setup can connect with email or cloud file service nodes after conversion for more automation.


Inputs, Processing Steps, and Output

Inputs

  • User chat messages that have text prompts and an image file uploaded.

Processing Steps

  • Chat Trigger node listens and captures the prompt and image file.
  • HTTP Request node sends prompt and image binary to OpenAI images/edits endpoint.
  • OpenAI returns edited image as base64 string in JSON response.
  • Convert to File node turns base64 string into a binary image file.

Output

  • A ready-to-use binary image file that can be downloaded, uploaded, emailed, or shared automatically.

Beginner Step-by-Step: How to Use This Workflow in n8n

Import the Workflow

  1. Inside the n8n editor, use the “Download” button on this page to get the workflow file.
  2. Click “Import from File” in n8n and upload the downloaded workflow file.

Configure Credentials and Settings

  1. Add your OpenAI API key in the provided credential node named “API KEY” exactly as given in your OpenAI account.
  2. Check the When chat message received node and ensure file uploads are enabled and MIME types set to accept images.
  3. Update any IDs, emails, channels, or storage folder settings if connected to downstream nodes.
  4. Verify that the HTTP Request node dynamically receives prompt text from chat input and image binary from the correct field (data0).

Test and Activate

  1. Run a test by sending a chat message with a text prompt and an image to confirm the workflow processes and returns an edited image file.
  2. If everything works, turn the workflow on to activate it for production use.
  3. Note: If you want to use self-host n8n, import and configure the workflow the same way.


Customizations

  • Change image size by editing the size parameter in the HTTP Request node (e.g., 512×512) for faster results.
  • Add more images per prompt by increasing the n parameter.
  • Include cloud storage nodes like Supabase or AWS S3 after Convert to File to save images automatically.
  • Connect an email node to send edited images directly to clients once converted.

Troubleshooting

Problem: “401 Unauthorized” or API Key Rejected

The API key could be wrong or expired.

Check your OpenAI API key in the “API KEY” node and update it if needed.

Problem: Image Upload Fails at Chat Trigger Node

File uploads may not be turned on or allowed MIME types are missing.

Enable file uploads and set MIME types to * in the When chat message received node.


Pre-Production Checklist

  • Test chat messages uploading different image files.
  • Confirm OpenAI API key works and includes image edit access.
  • Make sure prompt text and images send correctly to the HTTP Request node.
  • Check the Convert to File node produces a usable image binary output.
  • Do a full run: chat message to final edited image file.

Deployment Guide

Turn on the workflow in n8n and use the webhook URL from the When chat message received node.

Watch executions in n8n to see chat input and API results live.

Add alerts like emails inside n8n workflows to catch any errors early.

The workflow only needs n8n and OpenAI API, no extra tools.


Summary

✓ Saves user 2-3 hours by automating text-driven image editing.

✓ Automatically converts base64 API images to download-ready files.

✓ Works inside n8n with OpenAI ImageGen and chat input nodes.

→ Outputs edited images ready for cloud upload, email, or sharing.


Frequently Asked Questions

The ‘When chat message received’ node captures chat messages with text and image files.
Check and update the API key in the ‘API KEY’ node to solve authorization errors.
The ‘Convert to File’ node changes base64 string from OpenAI into a binary image file.
Add OpenAI API key and check configurations, test a chat prompt with an image, then activate the workflow.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free