Resources · n8n integration

n8n Basic LLM Chain nodeConfigure Basic LLM Chain in n8n.

One prompt in, one model answer out, and nothing else to wire. The n8n Basic LLM Chain node sends your text to a chat model and hands the reply back to the workflow. It exposes 10 parameters and 2 ports, and it suits anyone who needs an answer rather than an agent that picks its own tools.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Basic LLM Chain node actually do?

The Basic LLM Chain node is a root node: it takes the items arriving on its main input, builds a prompt from them, sends that prompt to the chat model plugged into its port, and returns the model's text. A root node is one that runs inside the workflow itself, while a sub-node is a small node you drag onto one of its ports and that never runs on its own. No tool calling, no loop, no decision.

Think of a support inbox where every message has to be labeled before it reaches a human. One chain, a system message that names the categories, and the reply lands in the item. The model does not need to browse anything, so a chain is enough and the run stays predictable.

Second scenario: product photos that arrive as binary files from a previous step. Set Message Type to imageBinary, point Image Data Field Name at the binary field, and the model returns a description you can push straight into Google Sheets. Third scenario: a daily digest where each item holds a raw note and the chain rewrites it before a Slack message goes out.

Pick the chain over the AI Agent node when the job has one shape and one answer. An agent earns its cost when the model has to choose between several tools or run several turns; a chain does one pass and stops, which makes it cheaper to debug and easier to read six months later. If the answer has to be typed, turn on Require Specific Output Format and attach an output parser rather than reaching for an agent.

The limits are worth knowing before you build on it. The chain holds no memory, so nothing carries over between items or executions. It cannot call a tool, and it will not fetch a page for you. The prompt itself is plain text, so anything dynamic goes in through an expression such as {{ $json.chatInput }}. And the model provider behind the sub-node, whether that is OpenAI or another vendor, bills its own API calls under its own terms; n8n adds nothing on top.

Version 2 of the node is what this page describes. An older workflow may show an earlier version with fewer options, so compare the panel in front of you before hunting for a setting that is not there. If you want the wider picture on the platform first, the n8n review covers where it fits.

Connections

What do you plug into the chain?

The chain is the root node; the model and the parser are sub-nodes you drag onto its ports, one type of sub-node per port.

Ports (what plugs in)

  • Chat Modelai_languageModelrequired
  • Output Parserai_outputParseroptional
01Chat ModelThis port carries the model that answers the prompt. The chain has no model of its own, so an empty port stops the execution before anything is sent.

This port carries the model that answers the prompt. The chain has no model of its own, so an empty port stops the execution before anything is sent.

Key parameters

  • Required: leave it empty and the node cannot run.
  • OpenAI Chat Model: the usual starting point when you already hold a key from that provider.
  • Ollama Chat Model: for a model running on your own machine, with no call leaving the network.
  • Anthropic Chat Model: another hosted option, wired exactly the same way.
Use cases
a classification chain usually starts on a hosted model, then moves to a local one once the prompt is stable and volume climbs.
02Output ParserThis port shapes the answer instead of letting it come back as loose prose. An output parser is a sub-node that reads the model reply and returns structured fields the rest of the workflow can address.

This port shapes the answer instead of letting it come back as loose prose. An output parser is a sub-node that reads the model reply and returns structured fields the rest of the workflow can address.

Key parameters

  • Optional: skip it and the chain returns plain text.
  • Structured Output Parser: you describe the shape you expect, and the reply comes back in it.
  • Auto-fixing Output Parser: wraps another parser and asks the model again when the first answer does not fit.
Use cases
extracting a name, a date and an amount from a free-text note, so the next node can map each one to a column.
Parameters

Which parameters matter in the Basic LLM Chain panel?

The Basic LLM Chain node has 10 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.

01

Source for Prompt (User Message)

promptType

What you see in n8n

Notes & use cases

This selector decides where the prompt text comes from, and it is the first thing to set on a fresh node.

Key parameters

  • Connected Chat Trigger Node (auto): looks for an input field called chatInput coming from a directly connected Chat Trigger.
  • Define below (define): use an expression to reference data in previous nodes, or type static text.
  • Prompt (User Message) (text): the required field that appears with the second option and holds the prompt itself.
Use cases
a chain fed by an HTTP step runs on define, with {{ $json.body }} in the text field. The no prompt specified error on auto means the incoming data has no chatInput field; an Edit Fields (Set) node renaming it solves the case.
02

Require Specific Output Format

hasOutputParser

What you see in n8n

Notes & use cases

Flip this switch and the node exposes the output parser port, so the reply comes back shaped rather than as a paragraph.

Key parameters

  • Require Specific Output Format (hasOutputParser): a boolean, off until you need typed output.
Use cases
a chain that reads an incoming email and has to return a category, a priority and a short summary, each one feeding a different branch. Left off, the same chain hands back one block of text and every downstream node has to parse it by hand.
03

Enable Fallback Model

needsFallback

What you see in n8n

Notes & use cases

Turning this on tells the chain to keep a second model in reserve instead of failing on the first refusal.

Key parameters

  • Enable Fallback Model (needsFallback): a boolean, off by default.
Use cases
a nightly batch that has to finish before the office opens, where an unavailable provider would otherwise leave the rest of the run with nothing. Keep it off while you are still shaping the prompt, since two models make it harder to tell which one produced the answer you are reading.
04

Type Name or ID

messages.type

What you see in n8n

Notes & use cases

Inside Chat Messages, this selector says whose voice a message speaks in. n8n ignores these options when no chat model is connected.

Key parameters

  • System (SystemMessagePromptTemplate): the instruction that guides what the model should do, tone included.
  • User (HumanMessagePromptTemplate): a sample user input.
  • AI (AIMessagePromptTemplate): a sample expected response the model tries to imitate.
Use cases
pairing a User sample with an AI sample gives the model one worked example, which is often enough to lock a format down without any parser at all.
05

Message Type

messages.messageType

What you see in n8n

Notes & use cases

This one appears on a User message and says what the model receives: words, or an image to look at.

Key parameters

  • Text (text): a simple text message.
  • Image (Binary) (imageBinary): processes the binary input coming from the previous node.
  • Image (URL) (imageUrl): processes the image at the address you give.
Use cases
a chain reading scanned delivery notes runs on imageBinary right after the node that downloaded the file, with no storage step in between.
06

Image Data Field Name

messages.binaryImageDataKey

What you see in n8n

Notes & use cases

When the image arrives as a binary file, the chain needs to know which field holds it, and this is where you say so.

Key parameters

  • Image Data Field Name (binaryImageDataKey): required, the name of the field in the chain's input that contains the binary image file to be processed.
Use cases
a photo pulled from a message and passed straight to the model. The value is a binary property name, not a JSON path, so the usual mistake is writing an expression here when the plain field name is what the node expects.
07

Image URL

messages.imageUrl

What you see in n8n

Notes & use cases

The other way to hand an image over: give the address and let the model fetch what it needs.

Key parameters

  • Image URL (imageUrl): required, the URL to the image to be processed.
Use cases
product shots already hosted on a public bucket, where the link travels through the workflow as {{ $json.imageUrl }} and no file is ever downloaded into n8n. If the address is private or expires, the binary route is the safer one.
08

Image Details

messages.imageDetail

What you see in n8n

Notes & use cases

This setting controls how the model processes the image and generates its textual understanding, and it moves the token budget with it. A token is the unit a model counts its input in.

Key parameters

  • Auto (auto): looks at the image input size and decides between the low and high setting.
  • Low (low): a 512px x 512px version, a budget of 65 tokens, faster responses and fewer input tokens.
  • High (high): detailed 512px crops, each one twice the budget, for a total of 129 tokens.
Use cases
counting objects in a photo can stay on low; reading small print on a label is what high is for.
09

Message

messages.message

What you see in n8n

Notes & use cases

This is the text of the chat message itself, and what it means depends on the type you picked just above it.

Key parameters

  • Message (message): required, the content of that message.
Use cases
on a System message, something like Always respond talking like a pirate is enough to fix the tone for every item. On an AI message, the same field holds a sample expected response, and the model tries to answer the same way.
10

Batch Processing

batching

What you see in n8n

Notes & use cases

A collection of batch processing options for rate limiting, useful the day a workflow stops receiving answers because it asked for too many at once.

Key parameters

  • Batch Size (batchSize): how many items to process in parallel, which is useful for rate limiting but might impact the log output ordering.
  • Delay Between Batches (delayBetweenBatches): a delay in milliseconds between batches, also for rate limiting.
Use cases
a list of a few thousand rows pushed through the chain in one execution. Raise the delay before lowering the size when the provider pushes back, and remember the log order may no longer match the input order.
Need help

Need help automating Basic LLM Chain with n8n?

A person reads every message.

FAQ

Basic LLM Chain questions, answered

01Is the Basic LLM Chain node free in n8n?
Yes. It ships inside the n8n AI package, so there is nothing to install and nothing extra to pay on the n8n side, on n8n Cloud as well as on a self-hosted instance under the Community Edition and its Sustainable Use license. A workflow behaves the same in both places. The one cost that is real sits elsewhere: the provider of the chat model you connect bills its own API calls under its own terms, and n8n adds nothing on top of that. So the node itself is free, and what you spend depends entirely on which model sub-node you plug into the port and how often it runs.
02What credentials does the Basic LLM Chain node need?
None. The node has no credential and no authentication selector, so there is nothing to set up on the account side before you use it. The key lives one step away: the chat model sub-node you attach to the port carries the provider credential, and that is where you enter it. Set it once in n8n and every chain using the same model reuses it. In practice that means a fresh Basic LLM Chain node is ready as soon as you drag it in, and the only blocking step left is picking a model and giving that sub-node its key.
03What are the limits of the n8n Basic LLM Chain node?
It does one pass. The chain sends a prompt, reads the answer, and stops, which rules out tool calling and multi-turn reasoning. It holds no memory either, so nothing is remembered between items or between executions. Images go in only through a User message set to binary or URL, and the detail setting caps how finely the model looks at them. This page describes version 2 of the node; an older workflow may display an earlier version with fewer options, so check the panel before you go looking for a setting. Anything beyond that shape belongs to a different node.
04Basic LLM Chain or AI Agent: which one should you use?
Take the chain when the task has one shape and one answer, such as classifying, rewriting or summarizing. Take the agent when the model has to choose between tools or work through several turns before it can answer. At minimum, a chain needs two things: a chat model on its required port, and a prompt, either from a connected Chat Trigger or typed in below. To start out, an OpenAI Chat Model is the shortest path if you already hold a key, and an Ollama Chat Model keeps everything on your own machine. Add a Structured Output Parser only when the reply has to be typed.
05n8n or Make for running an LLM prompt?
It depends on where you want the workflow to live. Make is hosted, with no self-hosting option, and it bills per operation, so a chain running over a long list of items has a cost that grows with the list. n8n runs on n8n Cloud or on your own server through Docker or npm, which matters when the prompts carry data you would rather keep in-house. Both give you a visual canvas. Judge on hosting, data control, the cost model and how comfortable the canvas feels to the person who will maintain it, not on a feature checklist.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.