Postgres Node fails with "split is not a function" when using pgvector parameter

<!-Hello All,
I am having a persistent issue with the Postgres node when trying to perform a semantic search with pgvector. The node fails with a TypeError: properties.string.split is not a function.
My Goal:
I want to run a SELECT query to find the cosine similarity between a stored vector and a new vector passed as a parameter.
My Setup:

  • n8n Version: 1.113.3 (Self-hosted on Railway)
  • Database: PostgreSQL with pgvector extension
  • Embedding Model: OpenAI text-embedding-3-small (1536 dimensions)
    Node Configuration:
  • Node: Postgres
  • Query:
    SELECT summary, 1 - (embedding_vector <=> $1::vector) AS similarity 
    FROM learned_facts 
    ORDER BY similarity DESC 
    LIMIT 1;
    
  • Query Parameters (Expression):
    {{ [ $items("N2.2-Generar Embedding")[0].json.data[0].embedding ] }}
    

The Problem:
The execution fails on this Postgres node with the TypeError: properties.string.split is not a function. This happens on a clean, updated n8n instance. We have confirmed the database schema is correct (embedding_vector VECTOR(1536)), the extension is active, and the input data is a valid array of numbers.
It seems the Postgres node has a bug and cannot handle an array of numbers as a parameter for a vector type.
Is there a known workaround for this bug, or is this a confirmed issue?
Thank you.- Hey! The fastest way to find solutions is by using the :magnifying_glass_tilted_right: search function at the upper right.
If your question hasn’t been asked before, please follow the template below. Skip the questions that are not relevant to you. →

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.