Describe the problem/error/question
I’m trying to store some response data into a Postgres Table. I’ve got a few fields where some of the types are arrays (empty or not empty):
{"field_1" : [], "field_2": [] }
I was originally attempting to store these data using jsonb
, but it appears that when mapping the fields from the response JSON to the postgres insert node, I’m getting an error that an Object is expected and not an array.
I attempted to do a workaround I found here that says using JSON.stringify()
on the object is supposed to help, but that did not work.
I’ve also tried changing the postgres column datatype to jsonb[]
. Again, same issue.
I feel as though this is a valid means to set the data type into postgres jsonb, so I’m unsure why this is throwing an error. Any help would be much appreciated.
What is the error message (if any)?
Invalid input for ‘mentions’ [item 0]
‘mentions’ expects a object but we got array
Please share your workflow
I’m going to hold off until I figure how to keep some PII off this.
Share the output returned by the last node
Information on your n8n setup
- **n8n version:1.75.2
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
- Operating system: