❗️Issue with 'Edit Fields' node and JSON structure in 'HTTP Request' (payload expects object)

:exclamation:Issue with Edit Fields node and JSON structure in HTTP Request (payload expects object)

Hi n8n community :wave:

I’m building a workflow to upload multiple PDF documents into a vector database using Qdrant. My flow is as follows:

  • Read PDFs from disk
  • Extract text
  • Generate embeddings
  • Use Edit Fields to build the structure { id, vector, payload }
  • Send a POST request to Qdrant via an HTTP Request node

:x: The problem

The issue occurs in the Edit Fields and/or HTTP Request node.
The payload field expects an object, but it throws an error like:

rust

CopiarEditar

'payload' expects an object but got '{ "nombre_documento": "{{ $json["text"].slice(0,50) }}", "contenido": "{{ $json["text"] }}" }'

I tried using JSON.stringify and other expressions but still got the same issue.


:question:What I need help with

What is the correct way to structure the payload field as a valid JSON object so that the HTTP Request sends it correctly to Qdrant?


:wrench: Versions

  • n8n: 1.90.2
  • Qdrant: v1.7.0 (self-hosted)

:camera_flash: Screenshots


:test_tube: Optional: Sample Workflow

Thanks in advance for your help! :pray:

Seems like you missed to set the field to Expression.
I additionally removed the " and used toJsonString() for the values.