Using the embedded n8n chat @n8n/chat - npm, I send some metadata, e.g.
metadata: {
‘user_id’: ‘etc’,
‘session_user_id’: ‘etc’
},
this works fine, it is sent correctly as a payload and processed fine in n8n.
The problem becomes if in addition I allow to send files by adding “allowFileUploads: true” inside the createChat script.
When a file is sent, the metadata is not serialized correctly to JSON, and it simply becomes [object Object]. This is an example Payload sent to n8n
action: sendMessage
sessionId: 68046e32-137b-418d-9486-b0e0ad0da9d3
chatInput: helo
metadata: [object Object]
files: (binary)
Information on your n8n setup
- n8n version: 1.85.4
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: ubuntu