๐Ÿ”ฌ Bulk import local PDF and text files into an Open Notebook notebook

โšก 53 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

Quick overview

This self-hosted n8n workflow scans a local folder for PDF and TXT files and bulk imports them into an Open Notebook notebook via its API, uploading PDFs as files and sending text files as JSON content.

How it works

  1. Runs manually when you start the workflow.
  2. Calls the Open Notebook API to list available notebooks and finds the notebook ID that matches the configured notebook name.
  3. Uses a shell command to scan the configured local folder for .pdf and .txt files.
  4. Creates one item per file with its path, title, and extension for processing.
  5. Processes files one at a time, uploading PDFs to the Open Notebook /sources endpoint as multipart form data.
  6. Sends TXT file contents to the Open Notebook /sources/json endpoint using a Python requests call.

Setup

  1. Use a self-hosted n8n instance with the Execute Command node enabled and local filesystem access.
  2. Ensure the n8n host has curl and python3 installed, and install the Python requests package.
  3. Set the folder path to scan, the exact Open Notebook notebook name, and the Open Notebook API base URL in the configuration step.
  4. Make sure Open Notebook is running and reachable from n8n at the configured API base URL.

Requirements

Customization

Additional info

Tested on a self-hosted n8n instance against a live Open Notebook API. File names containing quotes, backticks, dollar signs and non-ASCII characters are shell-quoted before being passed to the Execute Command node, so they do not break the run.

๐Ÿ”— Nodes Used

HTTP Request

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup