Folder of PDFs to Markdown notes with n8n

An n8n workflow that converts every PDF in a folder to a Markdown note in your Obsidian vault, with tables as Markdown tables and OCR for scanned pages.

Last updated

Operations submit_conversion_job, get_job, get_conversion_result
Platform n8n (self-hosted), built from n8n's own nodes
Output One .md note per PDF; images are not extracted

What it does

You keep notes as PDFs and want them in Obsidian as text you can link and edit. Copying text out works, but tables and scanned pages do not survive it.

The workflow reads every PDF in an inbox folder, sends each one to the flatmark queue and writes the Markdown into your vault, named after the PDF. Tables arrive as Markdown tables, and scanned pages are read with OCR.

Steps

  1. In a self-hosted n8n, import workflow.json from the template folder below. Every node ships with n8n, so there is nothing to install.
  2. Create a Header Auth credential with the name X-API-Key and your API key as the value. Pick it in the three HTTP Request nodes: Queue the PDF, Check the job and Download Markdown.
  3. Make your PDF folder and your vault folder visible to n8n. The workflow uses /home/node/.n8n-files/pdf-inbox and /home/node/.n8n-files/vault.
  4. Click Execute workflow. notes.pdf becomes notes.md in the vault.

The PDFs go through the queue one at a time. The workflow checks each job every 5 seconds and skips a failed one, whose credits are refunded. Each run converts every PDF in the inbox, so move converted files out before the next run.

Get the template

The workflow and its README are on GitHub: templates/folder-to-markdown-notes.

Get your API key

Create an API key and paste it as the value of the Header Auth credential in n8n.

FAQ

Does the workflow keep the images from my PDFs?
No. flatmark returns text and tables. Put the PDF in your vault too and embed it in the note with ![[notes.pdf]] if you need the figures.
Does this work on n8n Cloud?
Not as it is. The flatmark steps are HTTP Request nodes, which n8n Cloud runs too. The two file nodes read and write files on the machine that runs n8n, which only a self-hosted n8n allows. On n8n Cloud, replace them with a storage node such as Google Drive.