Hi everyone,
I’m facing a strange issue with my n8n setup (self-hosted on Railway).
I have two workflows. In the first workflow, I generate a long text output (thousands of characters of Markdown from an LLM) and successfully process it inside a Code node.
However, when I pass these data to another workflow to save it into a PostgreSQL database, the text arriving at the Postgres node becomes truncated, broken, and messed up. The data seems to get corrupted or cut off during the transfer between workflows or during the SQL parameter mapping.
The PostgreSQL column is already set to TEXT, but the result is still broken. Has anyone experienced this, or is there a specific way to handle and pass long multi-line text strings between workflows safely?
Hi @Lorenzo_Fabiccio Welcome!
Nothing is getting corrupted in transit between the workflows. The Postgres node splits the Query Parameters string on every comma, so a long Markdown block is cut at its first comma and everything after it shifts into $2, $3 and so on. Pass the parameters as a JS array instead of a comma-separated expression, keeping $1 and $2 in the query:
{{ [ $json.title, $json.markdown ] }}
Values inside the array keep their own commas and are still sanitized.
See this: