n8n

How to Automate OpenAI T Shirt Design Creation?

Turn a simple chat message into fresh product art. Send a mockup image link, and the flow studies it, writes a stronger prompt, and renders a new T shirt design. It helps merch teams and store owners move faster on visual updates.

An in app chat event starts the sequence. A check routes valid messages into OpenAI image analysis, which reads the mockup and pulls key details. An AI agent then rewrites the prompt for clarity and style using a chat model. A small code step cleans the text, and a direct call to the OpenAI Images API produces a high quality 1024x1536 render. The image is converted from base64 into a file that you can download or share.

You will need an OpenAI API key and access to the n8n chat interface. Replace the sample image link with your own or map it from the incoming chat text. Expect design turnaround to drop from about 60 minutes to under 5 minutes for each variant. It fits sellers testing styles, marketers refreshing product images, and teams previewing ideas before full design work.

What are the key features?

  • Chat event trigger captures a user message with an image link and starts the sequence
  • If check routes only valid messages into the design path
  • OpenAI image analysis reads the mockup link and extracts useful details
  • AI agent specializes in T shirt prompt refinement to create a stronger prompt
  • OpenAI chat model powers the agent for clear and styled language
  • Code step cleans line breaks and escapes text for safe API use
  • HTTP Request calls the OpenAI Images API to render a 1024x1536 image
  • Split Out and Convert to File turn base64 data into a downloadable image file
  • OpenAI credentials are stored once and reused across nodes

What are the benefits?

  • Reduce manual work from 60 minutes to about 5 minutes per design
  • Automate prompt writing and image rendering in one flow
  • Improve prompt quality and consistency across requests
  • Handle many design requests in a day without extra staff
  • Connect chat input and OpenAI output in one place

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. In n8n Cloud, open Credentials and create a new OpenAI credential. Copy your API key from your OpenAI account and paste it into the credential. Give it a clear name such as OpenAI Prod.
  4. Open the OpenAI Image Analyze node. In the Credential field, select your OpenAI credential. Replace the sample image URL with your own product mockup link or plan to map it from the chat message.
  5. Open the OpenAI Chat Model node and choose the same OpenAI credential. Keep the default model or pick the one that fits your budget.
  6. Open the AI Agent node. Review the system message that guides prompt style. Adjust tone and brand style to match your store.
  7. Open the Code node and leave the cleaning logic as is. It removes line breaks and trims spaces so the prompt works well with the image API.
  8. Open the HTTP Request node. In the credential dropdown, pick your OpenAI credential so the request is authorized. Keep the JSON body fields unless you want to change image size.
  9. Open the When chat message received node. Enable the workflow so the chat event can start runs. Send a message with a public image link to test.
  10. If you want the analyze step to use the chat text, click the expression editor in the OpenAI analyze node and select the field that holds the message content or URL.
  11. Activate the workflow and run a live test. After it finishes, open the Convert to File node output and download the binary image to confirm the render.
  12. Troubleshoot common issues: If you see an auth error, check the OpenAI key. If the image is empty, confirm the link is public and reachable. If text breaks the request, make sure the Code node output looks clean.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.