Hi @jurasseck,
Sorry but I am not able to reproduce the error.
Have you shared the exact workflow?
By the way, I have created a workflow that checks data array returned by ClienteCX against all items returned by Postgres faked data, using includes function.
Check it please:
{
"name": "test_n8n",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"functionCode": "var items = [\n {\n \"external_id_client\": 13579\n },\n {\n \"external_id_client\": 16536\n },\n {\n \"external_id_client\": 12504\n },\n {\n \"external_id_client\": 12011\n },\n {\n \"external_id_client\": 12011\n }\n]\n\n\nreturn items.map(function(item) {\n return {\n json: {\n external_id_client: item.external_id_client,\n found: $node['Map ClientesCX Ids'].json.data.includes( item.external_id_client)\n } \n }\n});"
},
"name": "Map Postgres Ids",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
640,
300
]
},
{
"parameters": {
"functionCode": "var ids = [ \"12877\", \"1337\", \"1338\", \"13553\", \"14113\", \"14315\", \"14541\", \"14973\", \"15139\", \"15718\", \"16806\", \"16987\", \"17170\", \"17202\", \"17223\", \"18635\", \"18660\", \"18824\", \"18903\", \"19239\" ]\n\n\nreturn [\n {\n json: {\n data: ids\n }\n }\n]"
},
"name": "Map ClientesCX Ids",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
450,
300
],
"executeOnce": false,
"alwaysOutputData": true
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Map ClientesCX Ids",
"type": "main",
"index": 0
}
]
]
},
"Map Postgres Ids": {
"main": [
[]
]
},
"Map ClientesCX Ids": {
"main": [
[
{
"node": "Map Postgres Ids",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"id": "179"
}
The most important thing is to understand how workflow execution works inside n8n.
Sometimes this is a bit cryptic.
Perhaps somebody knows it better but I am not sure if you can access to step data from future steps inside a SplitInBatches subprocess.
I usually change flow strategy in those cases and I prefer to recover ClientesCX data outside of SplitInBatches subprocess.
Another option could be using Method: getWorkflowStaticData(type)
It allows to save data globally in a first step, and recover variable to use it later in future steps. Perhaps this suits your needs doing minimal changes in your flow.