HTTP Request to Stirling-PDF: 400 Bad Request on File Upload (multipart/form-data)

Hi community, I’m struggling to send a PDF file from n8n to a self-hosted Stirling-PDF container via a `multipart/form-data` request. I always get a `400 Bad Request` error. **My Setup:** * **n8n Version:** 1.106.3 (Self-hosted via Docker) * **Stirling-PDF Image:** `frooodle/s-pdf:latest` (in the same Docker stack) * **API Endpoint (confirmed via Swagger):** `POST http://stirling-pdf:8080/api/v1/misc/ocr-pdf\` **What Works:** A `Code` node successfully isolates the PDF from an email trigger and creates a binary object named `pdfData`. This part is confirmed to be working. **The Problem: HTTP Request Node** My node is configured as follows: * **Body Content Type:** `Form-Data` * **Body Parameters:** * **Parameter 1:** * `Name`: `fileInput` * `Value` (Expression): `{{ $item.binary.pdfData }}` * `Data Type`: `Binary Data` * **Parameter 2:** * `Name`: `ocrType` * `Value` (Fixed): `force-ocr` * **Parameter 3:** * `Name`: `ocrRenderType` * `Value` (Fixed): `hocr` The key issue seems to be that the expression `{{ $item.binary.pdfData }}` resolves to `[undefined]` in the UI, even though the input data clearly contains the binary object `pdfData`. This causes Stirling-PDF to receive a string instead of a file. **My Question:** What is the correct way in n8n v1.106.3 to reference a binary property from the input (`pdfData`) and send it as a file in a `Form-Data` request? Am I using the wrong expression? Here is my docker-compose for the two services: ```yaml services: n8n: container_name: n8n image: n8nio/n8n:latest ports: - “5678:5678” volumes: - ./n8n_data:/home/node/.n8n # … other settings … restart: unless-stopped stirling-pdf: image: frooodle/s-pdf:latest container_name: stirling-pdf ports: - “8090:8080” # … other settings … restart: unless-stopped

Hi,

are you able to identify whether the stirling pdf instance works for different kind of input data
Also have you verified if any other stirling endpoint is able to get triggered from n8n and other locations?

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