@trygvis ok, could make it with the update operation. It seems like a cast seems to be needed which is yet not supported. However, I did make it work with the executeQuery operation. Check the example below.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "=update \"public\".testing set started_at = '{{$node[\"Date & Time\"].json[\"started_at\"]}}' where id = 1"
},
"name": "Postgres",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
980,
300
],
"credentials": {
"postgres": "asasasasasas"
}
},
{
"parameters": {
"functionCode": "const date = new Date();\n\n\nreturn [{\n\n json: {\n id: 1,\n started_at: date.toUTCString(),\n }\n}] "
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
480,
300
]
},
{
"parameters": {
"value": "={{$node[\"Function\"].json[\"started_at\"]}}",
"dataPropertyName": "started_at",
"custom": true,
"toFormat": "=YYYY-MM-DDTHH:MM:SS",
"options": {
"toTimezone": "UTC"
}
},
"name": "Date & Time",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
710,
300
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Date & Time",
"type": "main",
"index": 0
}
]
]
},
"Date & Time": {
"main": [
[
{
"node": "Postgres",
"type": "main",
"index": 0
}
]
]
}
}
}