If I understood correctly, you might want t use a merge node. Check the example below.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
290,
570
]
},
{
"parameters": {
"mode": "keepKeyMatches",
"propertyName1": "quote",
"propertyName2": "quote"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
1190,
570
]
},
{
"parameters": {
"functionCode": "return [\n {\n json: {\n user: 1,\n quotes: ['1','2']\n } \n },\n {\n json: {\n user: 2,\n quotes: ['3','4']\n } \n }\n]"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
600,
560
],
"notesInFlow": true,
"notes": "User Data"
},
{
"parameters": {
"functionCode": "const results = []\n\nfor (const item of items) {\n const json = item.json;\n for (const quote of json.quotes) {\n results.push({ json: { quote, user: json.user } })\n }\n}\n\nreturn results;"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
860,
560
],
"notesInFlow": true,
"notes": "Map data"
},
{
"parameters": {
"values": {
"string": [
{
"name": "quote",
"value": "1"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
610,
800
],
"notesInFlow": true,
"notes": "Webhook mockup"
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
},
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
},
"Function1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
}
}
}