Describe the problem/error/question
Merge node data passing through but cannot read it, says ‘undefined’. What is causing this?
My set up: Open AI node → Set Node → Merge node → Sheet node
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste t{
"nodes": [
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "bbd80a63-31ed-4f84-ba3d-58f0168c1f7d",
"name": "Introduction",
"value": "={{ $json.message.content }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2440,
-340
],
"id": "5d3a2dc7-d104-4bea-a415-b0ca6b1ea85e",
"name": "Edit Fields"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "06025843-fb07-4548-8fe0-f78b337e8068",
"name": "Second Part",
"value": "={{ $json.message.content }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2460,
-80
],
"id": "54ce809e-40e6-46c6-9e0e-ba666d3595d9",
"name": "Edit Fields1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "171b6d0a-782a-407a-a10a-d8b2ac1f6618",
"name": "Part 3",
"value": "={{ $json.message.content }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2460,
200
],
"id": "02645837-79d2-4927-83e6-b169c4e32f96",
"name": "Edit Fields2"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "1cb1cd67-3dcc-4602-a6f8-e6c93b697247",
"name": "Part 4",
"value": "={{ $json.message.content }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2440,
480
],
"id": "06adb384-dd74-47d8-95ce-69cff3db09b0",
"name": "Edit Fields3"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "324fd521-8e74-4de6-aabf-5058f84d5ed3",
"name": "Part 5",
"value": "={{ $json.message.content }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2440,
760
],
"id": "ecd7efc0-6846-4d3f-88e1-aae618245a90",
"name": "Edit Fields4"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "chatgpt-4o-latest",
"mode": "list",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"messages": {
"values": [
{
"content": "=Based on the page titled: {{ $json.name }}\n\nWrite an introduction section telling the user what they can expect from this article and if they want automation services they can consult The Kranes (keep this one in a small separate paragraph)\n\nThe vocabulary should be plain simple, the readability score should be very low so that anyone can read\n\nJust give me the intro as the output, nothing else "
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2080,
-340
],
"id": "e2ecb161-f0a6-4cb9-b5dc-f10ebcf0edbc",
"name": "Intro",
"credentials": {
"openAiApi": {
"id": "HIKBWjUjcycw5pnA",
"name": "OpenAi account 2"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "chatgpt-4o-latest",
"mode": "list",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"messages": {
"values": [
{
"content": "=Based on the page titled: {{ $json.name }}\n\nWrite a 'How to' section\n\nThis will be the second part of the article\n\nThe vocabulary should be plain simple, the readability score should be very low so that anyone can read\n\nJust give me the paragraphs as the output, nothing else"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2080,
-80
],
"id": "950c9a93-4c89-4e64-aef5-5d088c05cee9",
"name": "Part two",
"credentials": {
"openAiApi": {
"id": "HIKBWjUjcycw5pnA",
"name": "OpenAi account 2"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "chatgpt-4o-latest",
"mode": "list",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"messages": {
"values": [
{
"content": "=Based on the page titled: {{ $json.name }}\n\nWrite how one can start learning to build AI agents for their day to day tasks\n\nThe vocabulary should be plain simple, the readability score should be very low and clean so that anyone can read\n\nJust give me the paragraphs as the output, nothing else"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2080,
200
],
"id": "5ff0a97a-f690-4229-bff9-c99a1343e0c3",
"name": "Part 3",
"credentials": {
"openAiApi": {
"id": "HIKBWjUjcycw5pnA",
"name": "OpenAi account 2"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "chatgpt-4o-latest",
"mode": "list",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"messages": {
"values": [
{
"content": "=Based on the page titled: {{ $json.name }}\n\nGive a list of AI Agent building tools or platforms one can use to build AI Agents, their reviews, learning curve etc.\n\nJust give the text output nothing else"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2080,
480
],
"id": "55a2a29f-57f8-4f48-a4a9-f7d4ca500f84",
"name": "Part 4",
"credentials": {
"openAiApi": {
"id": "HIKBWjUjcycw5pnA",
"name": "OpenAi account 2"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "chatgpt-4o-latest",
"mode": "list",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"messages": {
"values": [
{
"content": "=Based on the page titled: {{ $json.name }}\n\nWrite a 'Conclusion' section telling the article\n\nAlso tell them, if they want automation services they can consult The Kranes (keep this one in a small separate paragraph)\n\nThe vocabulary should be plain simple, the readability score should be very low so that anyone can read\n\nJust give me the paragraph as the output, nothing else"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2080,
780
],
"id": "095086e7-d4d3-4806-b151-a2b0b57efe00",
"name": "Conclusion",
"credentials": {
"openAiApi": {
"id": "HIKBWjUjcycw5pnA",
"name": "OpenAi account 2"
}
}
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1veCXzHF7a_oOypKXm2R8W2ExRmz8nx4OSI3zHp7l1lI",
"mode": "list",
"cachedResultName": "Kranes Blog",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1veCXzHF7a_oOypKXm2R8W2ExRmz8nx4OSI3zHp7l1lI/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 1694586883,
"mode": "list",
"cachedResultName": "Content",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1veCXzHF7a_oOypKXm2R8W2ExRmz8nx4OSI3zHp7l1lI/edit#gid=1694586883"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"1": "={{ $json.Introduction }}",
"2": "={{ $json['Second Part'] }}",
"3": "={{ $json[\"Part 3\"] }}",
"4": "={{ $json[\"Part 4\"] }}",
"5": "={{ $json[\"Part 5\"] }}",
"Content Name": "={{ $('Append or update row in sheet').item.json.name }}"
},
"matchingColumns": [
"Content Name"
],
"schema": [
{
"id": "Content Name",
"displayName": "Content Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "1",
"displayName": "1",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "2",
"displayName": "2",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "3",
"displayName": "3",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "4",
"displayName": "4",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "5",
"displayName": "5",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
2880,
120
],
"id": "3f6a67a1-d7c6-44cb-b088-2e3c6a9c5ce7",
"name": "Append or update row in sheet3",
"credentials": {
"googleSheetsOAuth2Api": {
"id": "gPEEiziU0kLV5lvj",
"name": "Google Sheets account 3"
}
}
},
{
"parameters": {
"numberInputs": 6
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
2700,
60
],
"id": "5292fe40-8ce1-4c3c-9042-8de8182adc6c",
"name": "Merge"
}
],
"connections": {
"Edit Fields": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 2
}
]
]
},
"Edit Fields3": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 3
}
]
]
},
"Edit Fields4": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 4
}
]
]
},
"Intro": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Part two": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Part 3": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Part 4": {
"main": [
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
]
]
},
"Conclusion": {
"main": [
[
{
"node": "Edit Fields4",
"type": "main",
"index": 0
}
]
]
},
"Append or update row in sheet3": {
"main": [
[]
]
},
"Merge": {
"main": [
[
{
"node": "Append or update row in sheet3",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "c87a766eb8ed4a39121cf119a5038250a8ca0a11ed90cdd244f6beb7336758b3"
}
}he workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:


