It seems like the Postgres-Node is one of the ones which has currently still some issues to execute multiple items. For that reason do you have to use the SplitInBatches-Node.
Here an example workflow:
{
"nodes": [
{
"parameters": {
"operation": "executeQuery",
"query": "=SELECT * FROM product WHERE id = {{$json[\"id\"]}}"
},
"name": "Postgres8",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
900,
50
],
"credentials": {
"postgres": ""
}
},
{
"parameters": {
"batchSize": 1,
"options": {}
},
"name": "SplitInBatches",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 1,
"position": [
700,
50
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$node[\"SplitInBatches\"].context[\"noItemsLeft\"]}}",
"value2": true
}
]
}
},
"name": "IF1",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1100,
150
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1300,
100
]
},
{
"parameters": {
"functionCode": "return [\n {\n json: {\n id: 400\n }\n },\n {\n json: {\n id: 401\n }\n }\n]"
},
"name": "Mock-Data",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
500,
50
]
}
],
"connections": {
"Postgres8": {
"main": [
[
{
"node": "IF1",
"type": "main",
"index": 0
}
]
]
},
"SplitInBatches": {
"main": [
[
{
"node": "Postgres8",
"type": "main",
"index": 0
}
]
]
},
"IF1": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
],
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"Mock-Data": {
"main": [
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
}
}
}