To effectively work with parameters and variables in n8n, you must first understand their distinct roles. n8n parameters are the configurable fields and settings within a node, like the URL in an HTTP Request node or the Sheet ID in a Google Sheets node. Variables, on the other hand, are the dynamic pieces of data that flow between your nodes, such as a customer’s email address or a specific order number. The magic happens when you use n8n’s expressions to insert these variables into the parameters of subsequent nodes, creating truly dynamic and powerful workflows.
What’s the Real Difference? Parameters vs. Variables
Think of building an n8n workflow like baking a cake. The parameters are the instructions in your recipe: “Mix __ grams of flour with __ ml of milk.” They are the fixed settings on each node that tell it what to do. They define the shape of the action.
Now, the variables are your actual ingredients. You might get the flour amount from a Google Sheets
node and the milk volume from a Typeform
submission. This data is dynamic; it can change every time the workflow runs. You use expressions to pour these variable “ingredients” into the parameter “instructions.”
So, when you open an HTTP Request node, the fields for ‘URL’, ‘Query Parameters’, and ‘Body Parameters’ are all parameters. The actual data you feed into them from a previous node—say, a user ID to fetch a specific profile—is a variable.
Getting this distinction right is the first major step toward becoming an n8n pro. It moves you from building static, one-trick workflows to creating flexible automations that adapt to incoming data.
Using Expressions: The Glue of Your Workflow
So, how do you connect a variable to a parameter? With expressions. If you’ve ever seen syntax like {{ $json.email }}
, you’ve seen an n8n expression. This is the special language n8n uses to look back at data from previous nodes and pull it into the current node.
The Easy Way: Just Drag and Drop
Let’s be honest, nobody wants to memorize syntax if they don’t have to. Thankfully, n8n has a wonderfully intuitive way to create expressions.
- First, run the nodes that will produce the data you need. This makes their output visible.
- Open the node where you want to use the data.
- In the parameter field, you’ll see a small grid icon on the left. You can literally click and drag a variable from the input data panel on the left and drop it right into the field.
Voila! n8n automatically writes the correct expression for you. It’s a game-changer for speed and accuracy.
A Quick Look at the Syntax
Sometimes you’ll need to write or tweak expressions manually. The expression editor is your playground for this. The most common variable you’ll encounter is $json
. In any given node, $json
refers to the JSON data of the single item that node is currently processing.
For instance, if a Read from Airtable
node passes on an item with { "Name": "John Doe", "Status": "Active" }
, in the next node, you could access the name with {{ $json.Name }}
.
Real-World Case Study: Dynamic API Lookups
Let’s put this into practice. Imagine you have a Google Sheet with a list of usernames, and you need to enrich this data by looking up each user’s profile from an external API.
-
Step 1: Get the Data: Your workflow starts with a
Google Sheets
node that reads the ‘Username’ column. -
Step 2: The API Call: Next, you add an
HTTP Request
node. The API requires the username to be passed as a query parameter, something likehttps://api.example.com/users?username=testuser
. -
Step 3: Make the Connection: Here’s where n8n parameters shine. In the
HTTP Request
node, you’d go to the ‘Query Parameters’ section. You’d add a parameter namedusername
. For its value, you won’t type a name. Instead, you’ll add an expression that points to the data from the Google Sheet:{{ $json.Username }}
.
When you run this, n8n is smart. It sees that the Google Sheets node output, say, 100 items (usernames). The HTTP Request node will then automatically run 100 times, each time inserting the next username from the list into the URL. That’s the power of n8n’s data looping.
The Common “Gotcha”: Data Structure Matters!
What happens if your previous node gives you one single item that contains an array of usernames? The HTTP Request node might get confused, because it’s designed to process one item at a time. I’ve seen this trip up many new users.
The solution? You need to normalize the data first. You can use a node like Split Out (or the older Item Lists node) to take that single item with an array and break it into multiple, individual items. Once each username is its own item, the HTTP Request node can process them perfectly.
Advanced Techniques for Parameters
Once you’ve got the basics, you can start using parameters in more sophisticated ways.
Passing Data to Sub-Workflows
Modularizing your work with sub-workflows (using the Execute Sub-Workflow
node) is a fantastic practice for keeping things clean. To pass data into one, you don’t define explicit n8n parameters
in the sub-workflow itself. Instead, whatever data you feed into the Execute Sub-Workflow
node automatically becomes the output of the Start
node inside that sub-workflow.
So, in your sub-workflow, you can access the passed-in customer ID with a simple expression like {{ $json.customerId }}
in any node connected to the Start
node. It’s seamless.
Creating Your Own Variables
Sometimes, you need to create a new piece of data mid-workflow. The Edit Fields (Set) node is your best friend here. It lets you add, change, or format data fields. For example, you can use it to create a static ‘ProcessDate’ field by setting its value to {{ new Date().toISOString() }}
. Every node after that can then access this new ProcessDate
variable.
Technique | Node Used | Common Use Case |
---|---|---|
Dynamic Inputs | Most Nodes | Using a customer ID from a webhook to query a database. |
Sub-Workflow Data | Execute Sub-Workflow |
Passing an order object to a separate workflow for processing. |
Variable Creation | Edit Fields (Set) |
Creating a standardized status message or calculating a total. |
Data Normalization | Split Out / Code |
Breaking an array into individual items before an HTTP request. |
Mastering the flow of variables into parameters is fundamental to unlocking the true potential of n8n. It’s the skill that separates basic, linear automations from complex, intelligent systems that can truly transform your business processes.