fbpx
Ynteractive logo

n8n + OpenAI: what you can automate

n8n integrations · By Robert Breen

OpenAI’s models are good at reading messy text and turning it into something a workflow can use: a summary, a category, a set of fields or a first draft. n8n supplies everything around the model, including the trigger, the data, the checks and the place the answer goes.

Where OpenAI earns its place in a workflow

The best fit is any team buried in unstructured text: long customer threads, inbound leads of mixed quality, receipts to retype. The expensive part of those jobs is a skilled person reading. A model reads in seconds for a small per-item cost.

The catch is that models are sometimes confidently wrong. So the design question is never just “can AI do this?” It’s “what happens when the AI gets it wrong, and who catches it?”

Two ways n8n connects to OpenAI

The OpenAI node runs one action per step. Its Text resource can Generate a Chat Completion or Generate a Model Response. Image can Analyze, Generate or Edit an image, and Audio can transcribe recordings or generate speech. Use it when the step is predictable: summarize this, extract that.

The OpenAI Chat Model node is a sub-node. It doesn’t run on its own. It plugs a model into n8n’s AI nodes, such as the AI Agent, Text Classifier, Information Extractor and Basic LLM Chain. Use it when the model needs tools or fixed categories.

There’s no OpenAI trigger. A Gmail Trigger, Webhook, Schedule Trigger, form or chat message starts the workflow, and OpenAI is a step in the middle.

The five OpenAI workflows side by side

AutomationStarts withOpenAI pieceWhat the business gets
Summarize long emails and ticketsGmail Trigger (Message Received) or a helpdesk webhook into the Webhook nodeOpenAI node, Text: Generate a Model Response, with a short output limitA three-line summary posted to Slack or the ticket, so whoever picks it up doesn’t read twenty replies
Classify and score leadsn8n Form Trigger or a website form posting to a WebhookGenerate a Model Response with a JSON schema, or a Text Classifier using the OpenAI Chat ModelStrong leads routed to sales within minutes and junk filtered out before anyone spends time on it
Extract fields from invoices and receiptsGmail Trigger with attachments, or Google Drive Trigger (File Created)Image: Analyze Image for photos, or Extract from File plus an Information Extractor for PDFsVendor, date, total and tax land in a sheet or accounting system without retyping
Draft replies and follow-upsGmail Trigger, or a CRM event such as a new dealGenerate a Model Response, saved with the Gmail node’s Draft: CreateFirst drafts in seconds. A person still reads and sends every one
An AI agent that uses your sheets and calendarChat Trigger, or a Slack messageAI Agent plus OpenAI Chat Model, with Google Sheets Tool and Google Calendar Tool attachedStaff ask “do we have stock?” or “book Tuesday at 2” and the agent looks it up or books it

If you want to try the first row today, my free lesson on summarizing emails with n8n and OpenAI builds it click by click. The AI receipt extractor lesson covers the third.

Example flow: lead scoring with a structured answer

  1. Webhook. Your website form posts the name, email, company and message.
  2. Edit Fields (Set). Keep only those four fields and trim the message to a sensible length, so one long paste can’t run up the token bill.
  3. OpenAI (Text: Generate a Model Response). The prompt spells out your scoring rules in plain language. Under Output Format, choose JSON Schema and turn Strict on, with three fields: score (1 to 5), category and reason.
  4. IF. Score of 4 or higher goes down the true branch.
  5. True branch: Slack’s Send Message posts the lead and the model’s one-line reason to your sales channel. False branch: Google Sheets Append Row adds it to a nurture list.
  6. Error output. Set the OpenAI node’s On Error setting to continue using the error output, and send failures to a review sheet so no lead is dropped silently.

The schema makes this reliable. Without it, the model might answer “probably a 4” one time and “4” the next, and the IF node can’t handle both.

OpenAI pitfalls, and how to design around them

  • Token cost. You pay per token, for both what you send and what comes back. Long threads and attachments add up at volume. Strip signatures and old replies, cap the output length in the node’s options, use a smaller model for simple classification, and set a usage limit or alert in your OpenAI account.
  • Hallucination. Models fill gaps with plausible values, like an invoice number that isn’t on the page or a meeting time nobody agreed to. Tell the prompt to return null when a value is missing, and check the output with IF nodes (is the amount a number, does the date parse) before writing it anywhere.
  • Unstructured output. Free text breaks the nodes downstream. Use the JSON Schema output format on the OpenAI node, or attach a Structured Output Parser to agents and chains.
  • Rate limits. Bursts of work can hit OpenAI’s rate limits and fail. Turn on Retry On Fail with a wait between tries, and use Loop Over Items to process large backlogs in batches.
  • Data you send out. Customer text leaves your systems when it goes to the API. Check OpenAI’s current data terms and your own client contracts before you send anything sensitive.

Which of these to build yourself

Summaries, internal labels and drafts are good do-it-yourself projects. If the output is wrong, someone notices and nothing breaks. Get help when an agent has tools that change real data, when extracted fields feed your accounting, or when you need to test prompts against a set of real examples before trusting them.

As a verified n8n creator, I build every AI workflow with three things: a schema on the output, a validation step before anything is written, and a person on anything customer-facing. My services page lists the AI and automation work I take on.

Frequently asked questions

Do I need an OpenAI API key, or does a ChatGPT subscription work?

You need an API key from the OpenAI platform, with billing set up. A ChatGPT subscription doesn’t include API access. You add the key once as an n8n credential, and every OpenAI node can use it.

What is the difference between the OpenAI node and the OpenAI Chat Model node?

The OpenAI node runs a single action, such as a text response, an image analysis or a transcription. The OpenAI Chat Model is a sub-node that supplies the model to AI Agent, Text Classifier, Information Extractor and other AI nodes.

How do I stop the model from making things up?

You can’t stop it completely, so design around it. Give the model the source text, ask it to return null when it isn’t sure, force a JSON schema, check the output with IF nodes, and have a person review anything customer-facing.

Want this built?

Send me one example of the text your team reads all day, such as an email, a form or a receipt. I’ll tell you what an OpenAI step can reliably do with it, and quote in writing before any work starts.