Describe the problem/error/question
I have a set of google sheet rows to update. One field is a , delimited list of image urls.
each google sheet row needs to loop through this field, upload images, and then the whole row gets uploaded to wordpress (the list of images as image gallery). Its all working amazing EXCEPT if I send multiple rows through. then when I aggragate the images uploaded, the rest of the rows dont run. The aggragate seems to collapse it all.
the loop in the screen shot is the loop that uploads each image to wordpress. the aggrate takes the 5 images and put them into a list, but also seems to clear out the larger rows/items going through the routine…
What is the error message (if any)?
no error, only 1 of the multiples rows make it through.
Please share your workflow
{
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"documentId": {
"__rl": true,
"value": "1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c",
"mode": "list",
"cachedResultName": "Registered Booths - Start Automation",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 1698920634,
"mode": "list",
"cachedResultName": "Approved - to Post",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit#gid=1698920634"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheetsTrigger",
"typeVersion": 1,
"position": [
-160,
0
],
"id": "c241d03d-4e48-4923-ae1a-0d7cc3d34eae",
"name": "Google Sheets Trigger",
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"id": "EhLkcCT1hclQNL1G",
"name": "GoodHumans"
}
}
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c",
"mode": "list",
"cachedResultName": "Registered Booths - Start Automation",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 1698920634,
"mode": "list",
"cachedResultName": "pre-application-tattoo",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit#gid=1698920634"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Legal Name": "{{ $('Loop Over Items').last().json.Artist_Name }}",
"Cover_Image": "{{ $json.image_url }}",
"ADDED-WP": "YES"
},
"matchingColumns": [
"Legal Name"
],
"schema": [
{
"id": "Legal Name",
"displayName": "Legal Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Links (Website and Social Media) 1",
"displayName": "Links (Website and Social Media) 1",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Links (Website and Social Media) 2",
"displayName": "Links (Website and Social Media) 2",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Confirm Email Address",
"displayName": "Confirm Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Shop Name",
"displayName": "Shop Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Shop Links (Website and Social Media) 1",
"displayName": "Shop Links (Website and Social Media) 1",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Shop Links (Website and Social Media) 2",
"displayName": "Shop Links (Website and Social Media) 2",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Shop Email Address",
"displayName": "Shop Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Confirm Shop Email Address",
"displayName": "Confirm Shop Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Are You CPR, First Aid, BBP Certified?",
"displayName": "Are You CPR, First Aid, BBP Certified?",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Do You Have a Current DPOR License?",
"displayName": "Do You Have a Current DPOR License?",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Will You Get a Temporary DPOR for Permanent License",
"displayName": "Will You Get a Temporary DPOR for Permanent License",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Have You Attended the VB Festival Before?",
"displayName": "Have You Attended the VB Festival Before?",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "What Years",
"displayName": "What Years",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Attach 5 of your best tattoos",
"displayName": "Attach 5 of your best tattoos",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Upload your Headshot",
"displayName": "Upload your Headshot",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Your Bio",
"displayName": "Your Bio",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Created By (User Id)",
"displayName": "Created By (User Id)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Entry Id",
"displayName": "Entry Id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Entry Date",
"displayName": "Entry Date",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Cover_Image",
"displayName": "Cover_Image",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "gallery",
"displayName": "gallery",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "ADDED-WP",
"displayName": "ADDED-WP",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
2760,
220
],
"id": "7e64fda3-7335-4c20-856d-51930224ea64",
"name": "Google Sheets",
"credentials": {
"googleSheetsOAuth2Api": {
"id": "3aySnlhMZZIzXbE7",
"name": "goodhumans"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://wordpress-220562-5408258.cloudwaysapps.com/wp-json/wp/v2/media",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "wordpressApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Disposition",
"value": "attachment; filename=image.jpg"
}
]
},
"sendBody": true,
"contentType": "binaryData",
"inputDataFieldName": "data",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
820,
20
],
"id": "5b716689-6718-4833-97cd-96185ca685fc",
"name": "upload headshot",
"credentials": {
"wordpressApi": {
"id": "EfwAwyZuXU7m5ETL",
"name": "Wordpress account"
}
}
},
{
"parameters": {
"url": "={{ $json.image_url }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
700,
220
],
"id": "d0963ee3-cb85-447f-9b31-3a74e598c387",
"name": "download headshot"
},
{
"parameters": {
"method": "POST",
"url": "=https://wordpress-220562-5408258.cloudwaysapps.com/wp-json/wp/v2/artist/{{ $json.id }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "wordpressApi",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"acf\": { \n\t\t\t\"shop_name\" : \"{{ $('Artist Info').item.json.shop_name }}\",\n\"artist_gallery_link\" : \"{{ $('Artist Info').item.json.social_media }}\",\n\"shop_website\" : \"{{ $('Artist Info').item.json.shop_website }}\",\n\"artist_photos\" : [{{ $('Aggregate').item.json.id }}]\n \n\n\t}\n} \n",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2500,
0
],
"id": "a02e17e5-0719-49d6-9062-890a5a14e277",
"name": "Update Artist Info",
"credentials": {
"wordpressApi": {
"id": "EfwAwyZuXU7m5ETL",
"name": "Wordpress account"
}
}
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
1620,
20
],
"id": "dd52a6c8-7550-49a6-bd79-76b204cd0b36",
"name": "Loop Over Items1",
"retryOnFail": true
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "b904ba40-943f-4743-a264-f5fc587d5597",
"name": "tattoos",
"value": "={{ $('Artist Info').last().json.tattoos }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1060,
20
],
"id": "6e09723c-62f3-4d54-93d8-e4e6c4f2e3b8",
"name": "Get 5 Tattoos"
},
{
"parameters": {
"url": "={{ $json.tattoo }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2020,
120
],
"id": "d82e3cb5-6fc3-4838-99e1-8bbd476ffee4",
"name": "download tattoo",
"retryOnFail": true
},
{
"parameters": {
"method": "POST",
"url": "https://wordpress-220562-5408258.cloudwaysapps.com/wp-json/wp/v2/media",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "wordpressApi",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Disposition",
"value": "attachment; filename=image.jpg"
}
]
},
"sendBody": true,
"contentType": "binaryData",
"inputDataFieldName": "data",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2180,
120
],
"id": "8a34cb18-fc83-49fe-83c2-d05ee2cbba5a",
"name": "upload tattoo",
"alwaysOutputData": true,
"retryOnFail": true,
"credentials": {
"wordpressApi": {
"id": "EfwAwyZuXU7m5ETL",
"name": "Wordpress account"
}
},
"onError": "continueErrorOutput"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
300,
0
],
"id": "dc35ba74-bb1c-43bb-b945-6284492cb0e4",
"name": "Loop Over Items"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "cd60f988-579f-4898-830a-2e0f92699803",
"name": "Artist_Name",
"value": "={{ $json['Artist Name'] }}",
"type": "string"
},
{
"id": "a9a5822c-df27-425a-8be2-41b52acb72f7",
"name": "Studio_Name",
"value": "={{ $json['Shop Name'] }}",
"type": "string"
},
{
"id": "208c7460-4ba2-4747-87d1-fbddfab2f2ae",
"name": "social_media",
"value": "={{ $json['Links (Website and Social Media) 1'] }}",
"type": "string"
},
{
"id": "e8f0cfc6-783d-4c69-b3ca-277727ff5f73",
"name": "shop_name",
"value": "={{ $json['Shop Name'] }}",
"type": "string"
},
{
"id": "493965bb-caf8-451c-a253-84441d9c8738",
"name": "shop_website",
"value": "={{ $json['Shop Links (Website and Social Media) 1'] }}",
"type": "string"
},
{
"id": "b1483989-5e84-4680-b7aa-a5f9925029fe",
"name": "tattoos",
"value": "={{ $json['Attach 5 of your best tattoos'] }}",
"type": "string"
},
{
"id": "928ce4da-5ff6-4b00-b52e-cb77c2709f1a",
"name": "bio",
"value": "={{ $json['Short Bio'] }}",
"type": "string"
},
{
"id": "fe4f7286-24a9-40b1-b266-914539edac56",
"name": "headshot",
"value": "={{ $json[\"Upload your Headshot\"] }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
540,
20
],
"id": "15d2378d-cf7e-4476-ace0-3a18865b94e2",
"name": "Artist Info"
},
{
"parameters": {
"method": "POST",
"url": "https://api.placid.app/api/rest/xlzzlg6blsndu",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer placid-jazfrn7lgnyftyfc-osar1h626xespfye"
}
]
},
"sendBody": true,
"specifyBody": "=json",
"bodyParameters": {
"parameters": [
{}
]
},
"jsonBody": "={\n \"template_uuid\": \"8surzq5vkfpv7\",\n \"layers\": {\n \"feature\": {\n \"image\": \"{{ $json.headshot }}\"\n },\n \"artist\": {\n \"text\": \"{{ $json.Artist_Name }}\"\n }\n },\n \"create_now\": true\n}",
"options": {
"proxy": "",
"timeout": 300000
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
540,
220
],
"id": "b62ba65d-6a01-428c-a9b7-f0e01863c16b",
"name": "artist-headshot"
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c",
"mode": "list",
"cachedResultName": "Registered Booths - Start Automation",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 1698920634,
"mode": "list",
"cachedResultName": "Approved - to Post",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bsT9tRtXO0LXt4aV-dCIVR971wRLxDd2mMeUk5e1t5c/edit#gid=1698920634"
},
"filtersUI": {
"values": [
{
"lookupColumn": "ADDED-WP"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
20,
0
],
"id": "1fe85551-b276-468a-a81d-6f19cbf01407",
"name": "New Artists",
"credentials": {
"googleSheetsOAuth2Api": {
"id": "3aySnlhMZZIzXbE7",
"name": "goodhumans"
}
}
},
{
"parameters": {
"instructions": "the tattoos contains a list of images with escape characters. please remove the escape characters. output needs to be seperate array's for each tattoo image for a loop node",
"codeGeneratedForPrompt": "the tattoos contains a list of images with escape characters. please remove the escape characters. output needs to be seperate array's for each tattoo image for a loop node",
"jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n const tattoos = JSON.parse(item?.json?.tattoos);\n const cleanedTattoos = tattoos.map((tattoo) => tattoo.replace(/\\\\/g, \"\"));\n return cleanedTattoos;\n});\nreturn updatedItems.flat().map((tattoo) => ({ tattoo }));\n"
},
"type": "n8n-nodes-base.aiTransform",
"typeVersion": 1,
"position": [
1240,
20
],
"id": "255ec339-b6ab-44ee-89b2-646b792b24fd",
"name": "AI Transform2"
},
{
"parameters": {
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "id"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1920,
-40
],
"id": "de77f4f8-35b1-4999-9dea-76519ade86d2",
"name": "Aggregate"
},
{
"parameters": {
"method": "POST",
"url": "https://wordpress-220562-5408258.cloudwaysapps.com/wp-json/wp/v2/artist/",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "wordpressApi",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "title",
"value": "={{ $('Artist Info').last().json.Artist_Name }}"
},
{
"name": "featured_media",
"value": "={{ $('upload headshot').last().json.id }}"
},
{
"name": "content",
"value": "={{ $('Artist Info').last().json.bio }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2240,
-100
],
"id": "ac70c8de-38ee-48d9-a930-21d7f68240f7",
"name": "Create Draft Blog1",
"credentials": {
"wordpressApi": {
"id": "EfwAwyZuXU7m5ETL",
"name": "Wordpress account"
}
}
}
],
"connections": {
"Google Sheets Trigger": {
"main": [
[
{
"node": "New Artists",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"upload headshot": {
"main": [
[
{
"node": "Get 5 Tattoos",
"type": "main",
"index": 0
}
]
]
},
"download headshot": {
"main": [
[
{
"node": "upload headshot",
"type": "main",
"index": 0
}
]
]
},
"Update Artist Info": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "download tattoo",
"type": "main",
"index": 0
}
]
]
},
"Get 5 Tattoos": {
"main": [
[
{
"node": "AI Transform2",
"type": "main",
"index": 0
}
]
]
},
"download tattoo": {
"main": [
[
{
"node": "upload tattoo",
"type": "main",
"index": 0
}
]
]
},
"upload tattoo": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
],
[]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Artist Info",
"type": "main",
"index": 0
}
]
]
},
"Artist Info": {
"main": [
[
{
"node": "artist-headshot",
"type": "main",
"index": 0
}
]
]
},
"artist-headshot": {
"main": [
[
{
"node": "download headshot",
"type": "main",
"index": 0
}
]
]
},
"New Artists": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"AI Transform2": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Create Draft Blog1",
"type": "main",
"index": 0
}
]
]
},
"Create Draft Blog1": {
"main": [
[
{
"node": "Update Artist Info",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "d50ae9164ab3b3fbd3a4986b8409f1d4cf3572c019e3a46f2953720743860f6a"
}
}```
## Share the output returned by the last node
<!-- If you need help with data transformations, please also share your expected output. -->
## Information on your n8n setup
- **n8n version:**
[email protected]
- **Database (default: SQLite):**
SQLite
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
own,main
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
n8ncloud
- **Operating system:**
Mac
thanks in advance!