Resources · n8n integration

n8n OpenAI nodeConfigure OpenAI in n8n.

The OpenAI node turns a model call into a workflow step, with one credential behind it. It carries 16 operations spread over 6 resources: text, image, audio, file, conversation and video. The n8n OpenAI node runs on each incoming item, like any other action node, so it fits a pipeline rather than a chat.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n OpenAI node actually do?

The n8n OpenAI node is the action node that calls OpenAI from inside a workflow. Pick a resource (Text, Image, Audio, File, Conversation, Video), pick one of its 16 operations, and n8n sends the request with your stored credential and hands the answer to the next node. It executes once per incoming item, which means a batch of 40 rows produces 40 calls.

Three shapes of work cover most of what the node gets used for. The first is text on a schedule: a row arrives from Google Sheets, text.response drafts a summary, the result goes back into the sheet. The second is media production: image.generate builds a visual from a prompt, audio.generate reads a script out loud, video.generate renders a short clip, and each one returns a binary file the rest of the workflow can store or send. The third is inbound processing: audio.transcribe turns a voicemail into text, image.analyze answers a question about an attachment, text.classify flags content that breaks usage policies before a human reads it.

A conversation is the piece people miss. conversation.create opens a thread, and a model response can be attached to it through the Conversation ID option, so a second call knows what the first one said. Without it, every run starts from nothing, which is fine for classification and wrong for a support thread that spans several messages.

Pick a different tool when the job is not a single call. If the model has to decide which action to take next, the AI Agent node is the root node for that, with sub-nodes plugged into its ports. Sub-nodes are the small nodes you attach to a root node, one type per port. The OpenAI node has no such port: it runs on its own, on each item. If you need a search-and-answer step against the live web, Perplexity has its own node. And for an OpenAI endpoint this node does not expose, the HTTP Request node reuses the same credential.

Two limits are worth knowing before you build. Assistant operations are deprecated in OpenAI node V2, which arrived in n8n 1.117.0, because the node moved to the Responses API. And the model provider bills its own API calls under its own terms, whatever your n8n plan is. The node adds nothing on top, but it does not shield you from the provider's meter either.

Output goes wherever the workflow goes next: a draft into Gmail, a transcript into a sheet, a generated image into a storage node. If you want the wider picture of the platform before committing, the n8n review covers what it does well and where it hurts.

Connect

What do you connect before the node runs?

  1. 01

    Create the OpenAI credential

    Open the Credentials menu in n8n and create an OpenAI credential, or select one that already exists. Every operation of the node uses the same Credential to connect with field, so you set this up once and reuse it in every workflow, on n8n Cloud or on a self-hosted instance. A credential in n8n is a stored set of secrets, kept apart from the workflow itself.

  2. 02

    Or switch to Gateway credits on Cloud

    On n8n Cloud there is a second route: select Use Gateway credits in the node's credential field and the node runs without an OpenAI account of your own. That option belongs to n8n Cloud, so a self-hosted instance stays on the credential route. Pick one before you build, because switching later means touching every node that calls OpenAI.

  3. 03

    Test on one operation, then build

    Before wiring the rest of the workflow, run a cheap operation on its own. file.list needs no input and returns the files that belong to the organization, which proves the credential answers. Then move to the operation you actually want. The node has no Authentication selector: the credential field is the only thing standing between the workflow and the API.

Actions

Which operation does what?

The OpenAI node exposes 16 operations across 6 resources. For each one: the node as you configure it in n8n, the required fields, and our field notes.

Resources × operations matrix
ResourceCreateGetUpdateRemoveAnalyze ImageClassify Text for ViolationsDelete a FileEdit ImageGenerate an ImageList FilesMessage a ModelTranscribe a RecordingTranslate a RecordingUpload a File
Text✓✓
Image✓✓✓
Audio✓✓✓
File✓✓✓
Conversation✓✓✓✓
Video✓

Text

2 operations
01

Message a model

text.response

What you see in n8n

Notes & use cases

Sends one or more messages to a model through the Responses API and returns its answer.

Key parameters

  • Model: required, picked from the list or given by expression, such as {{ $json.model }}.
  • Messages: each entry carries a Role (user, assistant or system) and a Prompt, and can hold an image or a file instead of text through Type.
  • Conversation ID: attaches the response to an existing thread. It cannot be combined with Previous Response ID.
  • Simplify Output: on, you get the answer alone; off, the raw payload.
Use cases
drafting a reply to each new ticket, with a system message that fixes the tone once and for all.
02

Classify text for violations

text.classify

What you see in n8n

Notes & use cases

Checks whether a piece of content complies with usage policies. The answer carries flagged, a list of categories and the matching category_scores.

Key parameters

  • Text Input: the text to check, usually {{ $json.message }} straight from the trigger.
  • Use Stable Model: on, the stable version of the model is used instead of the latest one, with accuracy that may be slightly lower.
  • Simplify Output: returns a simplified response rather than the raw data.
Use cases
gating user-generated comments before they reach a moderation queue, and routing anything with flagged set to true to a human.

Image

3 operations
03

Analyze image

image.analyze

What you see in n8n

Notes & use cases

Feeds one or several images to a model and answers a question about them, in text.

Key parameters

  • Model: required, the model doing the reading.
  • Input Type: url to pass URL(s) separated by commas, or base64 to read the binary from Input Data Field Name.
  • Detail: low answers faster and consumes fewer tokens, high goes into detail, auto lets the model decide from the image size.
  • Length of Description (Max Tokens): fewer tokens, shorter description. A token is the unit a model counts text in.
Use cases
reading a scanned delivery note attached to an email and pulling out the order reference.
04

Generate an image

image.generate

What you see in n8n

Notes & use cases

Creates an image from a text prompt and returns it as a binary file, or as a link when you ask for one.

Key parameters

  • Model: dall-e-2, dall-e-3 or gpt-image-1.
  • Prompt: up to 1000 characters for dall-e-2 and 4000 for dall-e-3.
  • Number of Images, Resolution and Style: natural stays closer to a photograph, vivid pushes towards dramatic results.
  • Respond with Image URL(s): on, you get links instead of binary files; off, Put Output in Field names the output field.
Use cases
producing a header visual for each blog post drafted earlier in the same workflow.
05

Edit image

image.edit

What you see in n8n

Notes & use cases

Reworks an image you supply, following the instruction in the prompt, instead of starting from a blank canvas.

Key parameters

  • Prompt: required, up to 1000 characters for dall-e-2 and 32000 for gpt-image-1.
  • Images: one or more binary fields, each a png, webp or jpg under 50MB, up to 16 images.
  • Image Mask: a png whose fully transparent areas mark what to repaint, same dimensions as the image, under 4MB. With several images, it applies to the first one.
  • Background and Input Fidelity: transparency and how closely the model matches the input style, both for gpt-image-1 only.
Use cases
clearing the background of a product photo before it goes into a catalogue.

Audio

3 operations
06

Generate audio

audio.generate

What you see in n8n

Notes & use cases

Reads a text out loud and returns the audio as a binary file.

Key parameters

  • Model: tts-1 or tts-1-hd.
  • Text Input: the text to voice, 4096 characters maximum.
  • Voice: alloy, echo, fable, nova, onyx or shimmer.
  • Response Format and Audio Speed: the container (mp3, opus, aac, flac) and the pace of the reading.
Use cases
turning a weekly written digest into an audio version dropped in a shared folder.
07

Transcribe a recording

audio.transcribe

What you see in n8n

Notes & use cases

Takes an audio file from the incoming item and writes out what it says, in the language it was spoken.

Key parameters

  • Input Data Field Name: defaults to data, and points at the binary property holding the file in flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav or webm.
  • Language of the Audio File: an ISO-639-1 code, which improves accuracy and latency when you already know it.
  • Output Randomness (Temperature): lower values keep the transcript closer to the audio.
Use cases
a sales call recording lands in a folder, the text goes to the CRM note. The OpenAI API caps the audio file at 25 MB, and uses whisper-1 by default.
08

Translate a recording

audio.translate

What you see in n8n

Notes & use cases

Same input, different output: the audio comes back as English text, whatever language was spoken in it.

Key parameters

  • Input Data Field Name: defaults to data, and accepts the same formats as a transcription, flac through webm.
  • Output Randomness (Temperature): defaults to 1.0, and the range runs from 0.0 for deterministic to 1.0 for maximum randomness.
Use cases
a support team that works in English receives voice messages from several countries and reads them all in one language. The 25 MB cap and the whisper-1 default apply here too.

File

3 operations
09

Delete a file

file.deleteFile

What you see in n8n

Notes & use cases

Removes a file from the server, permanently. Nothing else in the workflow gets touched.

Key parameters

  • File: required, either picked by name from the dropdown or given as an ID, often {{ $json.id }} coming out of a listing step.
Use cases
a cleanup workflow that runs once a week, lists what was uploaded for fine-tuning, and clears whatever is older than the retention rule you set in the sheet driving it.
10

List files

file.list

What you see in n8n

Notes & use cases

Returns the files that belong to the organization, one item per file.

Key parameters

  • Purpose: narrows the result to one intent, assistants, fine-tune, vision or user_data. Left on any, everything comes back.
Use cases
building an inventory of what has been uploaded over time, feeding it into a sheet, and spotting the leftovers nobody remembers creating. It also works as a first test after setting up the credential, since it needs no input at all.
11

Upload a file

file.upload

What you see in n8n

Notes & use cases

Pushes a file from the workflow to OpenAI so later operations can point at it by ID.

Key parameters

  • Input Data Field Name: defaults to data, and names the binary property holding the file. Individual files go up to 512 MB, or 2 million tokens for Assistants.
  • Purpose: assistants, fine-tune, vision or user_data. Fine-tuning only accepts .jsonl files.
Use cases
uploading a reference PDF so a later model response can read it through the File ID path instead of a URL.

Conversation

4 operations
12

Create a conversation

conversation.create

What you see in n8n

Notes & use cases

Opens a thread that later responses can attach themselves to, and returns its ID.

Key parameters

  • Messages: the opening content, each entry with a Role and a Prompt. A system message takes precedence over instructions given as user.
  • Metadata: up to 16 key-value pairs, keys of 64 characters maximum, values of 512, for anything you need to search on later.
Use cases
one conversation per customer ticket, created the moment the ticket opens, so every model response written afterwards shares the same history.
13

Get a conversation

conversation.get

What you see in n8n

Notes & use cases

Fetches an existing conversation so the workflow can read what it holds.

Key parameters

  • Conversation ID: required, in the conv_1234567890 form, typically stored earlier and pulled back with {{ $json.conversationId }}.
Use cases
when a customer replies three days later, the workflow looks up the thread tied to their ticket before deciding whether the reply needs a human or another model response.
14

Remove a conversation

conversation.remove

What you see in n8n

Notes & use cases

Deletes a conversation that is no longer needed. The thread and what it held go away.

Key parameters

  • Conversation ID: required, the conv_1234567890 identifier of the thread to remove.
Use cases
a ticket gets closed, and a branch of the workflow removes the matching conversation so retention stays tied to the ticket lifecycle rather than to whatever accumulates on its own.
15

Update a conversation

conversation.update

What you see in n8n

Notes & use cases

Changes the metadata carried by an existing conversation, without touching its messages.

Key parameters

  • Conversation ID: required, the thread to update.
  • Metadata: required here, a set of up to 16 key-value pairs, keys limited to 64 characters and values to 512.
Use cases
stamping a thread with the owner and the priority once a ticket is triaged, so the same fields can be queried from the dashboard later.

Video

1 operation
16

Generate a video

video.generate

What you see in n8n

Notes & use cases

Renders a short clip from a text prompt and puts the result in an output field as binary data.

Key parameters

  • Model, Prompt and Seconds: all three required, the last one being the clip duration.
  • Size: 720x1280, 1280x720, 1024x1792 or 1792x1024, the last two supported by Sora 2 Pro only.
  • Wait Timeout: how long n8n waits for the render, in seconds, default 300. Output Field Name names where the file lands.
Use cases
a vertical clip per product launch, generated from the copy written earlier in the run.
Need help

Need help automating OpenAI with n8n?

A person reads every message.

FAQ

Questions people ask next

01Is the OpenAI node included in n8n, on Cloud and self-hosted?
Yes. The node ships in n8n's AI package, @n8n/n8n-nodes-langchain, which comes with n8n. There is nothing to install and nothing extra to pay on the n8n side, whether you run n8n Cloud or self-host with Docker or npm under the Community Edition and its Sustainable Use licence. A workflow behaves the same in both cases. The one cost that exists sits with the model provider: OpenAI bills its own API calls under its own terms, and n8n adds nothing to that. On n8n Cloud, Gateway credits are the alternative route if you would rather not bring your own OpenAI account.
02What do you need to authenticate before it works?
An OpenAI credential, created once in the Credentials menu and then selected in the node's Credential to connect with field. Every one of the 16 operations uses that same credential, so a single setup covers text, image, audio, file, conversation and video work across all your workflows. There is no Authentication selector on the node itself, so nothing else to choose. On n8n Cloud you have a second option: select Use Gateway credits in the credential field and the node runs without an OpenAI account of your own. Self-hosted instances stay on the credential route.
03What are the limits of the n8n OpenAI node?
The node covers 16 operations across 6 resources, and the version documented here is version 2. Assistant operations are deprecated in that version, which arrived in n8n 1.117.0, because the node moved to the OpenAI Responses API. Size caps come from the API, not from n8n: 25 MB for an audio file to transcribe or translate, 512 MB for an uploaded file or 2 million tokens for Assistants, 4MB for an image mask. Some options only apply to one model, such as Background and Input Fidelity on gpt-image-1. For an endpoint the node does not expose, the HTTP Request node reuses the same credential.
04What is the minimum setup, and which operation should you start with?
A credential and one operation. Start with List files: it takes no input, returns what belongs to the organization, and tells you in one run whether the credential answers. Then move to Message a model, which is the operation most workflows end up using, with Model required and a single user message. Two habits help from day one: turn on Simplify Output while you are shaping the workflow so the data stays readable, and keep required fields filled, because an empty required field stops the node before any request leaves n8n.
05n8n or Make for calling OpenAI?
It depends on where you want the data to sit and how you want to pay. n8n self-hosts with Docker or npm, or runs on n8n Cloud, so you can keep prompts and generated files on your own infrastructure. Make is hosted only, with no self-hosting option, and bills per operation, which matters when a single workflow fires one model call per row across a large batch. On the visual side, both build flows by connecting blocks, and the reflex differs more than the result. If the work stays light and nobody wants to run a server, hosted-only is a fair answer. If it grows, or if the data is sensitive, the self-hosting option is the one that keeps doors open.