n8n/docs/workflows/update-postgres-rows.json
2019-08-21 22:47:27 +02:00

56 lines
1.1 KiB
JSON

{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"functionCode": "const newItems = [];\nfor (let i=1;i < 6; i++) {\n newItems.push({\n json: {\n id: i,\n name: `New name ${i}`,\n ean: `New EAN ${i}`,\n }\n });\n}\nreturn newItems;"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"operation": "update",
"table": "product",
"columns": "name,ean"
},
"name": "Update Rows",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
610,
300
],
"credentials": {
"postgres": "postgres"
}
}
],
"connections": {
"Function1": {
"main": [
[
{
"node": "Update Rows",
"type": "main",
"index": 0
}
]
]
}
}
}