Templates / Convert PDFs and Office documents to RAG-ready Markdown with Apify and OpenAI

Convert PDFs and Office documents to RAG-ready Markdown with Apify and OpenAI

Ready for 3.0

by Salih · 3 views · created 2026-10-11 · Internal Wiki, AI RAG

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 13 nodes and runs when someone submits an n8n form (“Add documents to the knowledge base”) (plus 1 other trigger). Along the way it connects Embeddings OpenAI and OpenAI Chat Model. It also calls api.apify.com over HTTP.

How it runs

Trigger: When someone submits an n8n form (“Add documents to the knowledge base”) (plus 1 other trigger).

  1. Configure (Edit Fields (Set)): sets 3 fields: fileUrls, chunkSize, chunkOverlap
  2. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Search documents); memory: Conversation memory
  3. Convert to Markdown (HTTP Request): calls api.apify.com (POST)
  4. One item per chunk (Code): runs custom JavaScript code
  5. Store chunks (Simple Vector Store): stores documents in the Simple vector store, with embeddings: Embeddings for storing; document loader: Chunk text and metadata

Services it uses

Embeddings OpenAIOpenAI Chat Model

HTTP calls to: api.apify.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (11)

From the author

Quick overview Paste document links into a form, convert them into Markdown chunks with page numbers using the Apify Document to Markdown Actor, store them with OpenAI embeddings, and chat with an AI agent that answers only from your files and cites the title…

Excerpt from Salih's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.