To create an n8n workflow that takes a set of items from a previous node and adds all of them in one execution into a Google Sheets document, follow the steps below.
✅ Goal:
Send multiple rows of data to Google Sheets in one execution (not one row per item).
🧰 Requirements:
- A working n8n instance
- Google Sheets credentials configured in n8n
- At least one node before the Google Sheets node that outputs multiple items
🔁 Input Format (Before Google Sheets Node)
Ensure your input is structured as an array of objects like this:
[
{
"name": "Alice",
"age": "30"
},
{
"name": "Bob",
"age": "25"
}
]
If not, you may need to use a Function Item or Set node to format it correctly.
📝 Steps to Create the Workflow
1. Start with a Trigger Node
Use any trigger that provides multiple items (e.g., Webhook, Cron, etc.).
2. Add a Node That Outputs Multiple Items
This could be a Manual Trigger, HTTP Request, or another node that returns an array of data.
3. (Optional) Use a Function Item Node to Format Data
If needed, reshape the incoming data using a Function Item node so each item contains the values for a single row.
Example function code:
return items.map(item => ({
json: {
name: item.json.name,
age: item.json.age
}
}));
4. Add a Google Sheets Node
Configure it like this:
⚙️ Google Sheets Node Settings:
- Operation:
Append Rows
- Spreadsheet ID: Your Google Sheet ID (from the URL)
- Sheet Name: The specific sheet tab where data should go
- Data Property:
={{$input.all().map(i => i.json)}}
This tells n8n to collect all items from the previous node and send them together as a batch.
💡 Append Rows operation supports appending multiple rows at once.
🧪 Example Workflow JSON
Here's a sample JSON export of such a workflow:
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [250, 300]
},
{
"parameters": {
"functionCode": "return [\n { json: { name: 'Alice', age: '30' } },\n { json: { name: 'Bob', age: '25' } }\n];"
},
"name": "FunctionItem",
"type": "n8n-nodes-base.functionItem",
"typeVersion": 1,
"position": [400, 300]
},
{
"parameters": {
"operation": "appendRows",
"spreadsheetId": "YOUR_SPREADSHEET_ID",
"sheetName": "Sheet1",
"dataPropertyName": "={{$input.all().map(i => i.json)}}"
},
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"credentials": {
"googleSheetsOAuth2": "Your Google Credentials"
},
"position": [600, 300]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "FunctionItem",
"type": "main",
"index": 0
}
]
]
},
"FunctionItem": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
}
}
}
✅ Result
All items will be appended as new rows in a single batch operation to your Google Sheet.
🛠 Tips
- If you're getting data from a node that splits data into multiple items (like HTTP requests), make sure to use
.all() to combine them.
- Always check column order in the sheet — the order of keys in the object (
{ name, age }) must match the columns in the sheet.
Let me know if you want to update existing rows, use headers, or create a new sheet dynamically!