This repository contains custom n8n nodes for integrating with LlamaCloud, providing powerful document processing and retrieval capabilities within your n8n workflows.
This package includes three custom nodes:
π LlamaParse
- Parse PDF files and extract their content in markdown format
- Uses LlamaCloud's document parsing capabilities
- Perfect for document preprocessing workflows
π LlamaExtract
- Extract structured data from files using LlamaCloud extraction agents
- Get elegant, structured information from documents
- Ideal for data extraction and analysis workflows
π¬ LlamaCloud
- Retrieve context from your LlamaCloud indexes
- Chat with your indexed documents
- Great for building RAG (Retrieval-Augmented Generation) applications
Before using these nodes, you need:
- Node.js and npm (Minimum version Node 20)
You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
-
n8n installed globally
npm install n8n -g
-
LlamaCloud API Key
- Sign up at cloud.llamaindex.ai
- Get your API key from the dashboard
-
Clone this repository
git clone https://github.com/run-llama/n8n-llamacloud.git cd n8n-llamacloud
-
Install dependencies
npm install
-
Build the nodes and publish locally
npm run build npm link
-
Link to n8n custom nodes directory
# Create custom nodes directory if it doesn't exist mkdir -p ~/.n8n/custom npm link n8n-llamacloud
-
Restart n8n
n8n stop n8n start
-
Install globally
npm install -g n8n-llamacloud npm link
-
Restart n8n
n8n stop n8n start
- Open n8n in your browser (usually
http://localhost:5678
) - Go to Settings β Credentials
- Click Add Credential
- Search for "LlamaCloud API Key"
- Enter your LlamaCloud API key
- Test the connection and save
- Go to cloud.llamaindex.ai
- Create a new project
- Upload documents to create an index
- Note the index name for use in the LlamaCloud node
graph LR
A[PDF File] --> B[LlamaParse]
B --> C[LlamaExtract]
C --> D[Structured Data]
Workflow:
- LlamaParse node: Parse a PDF file to markdown
- LlamaExtract node: Extract structured data using an extraction agent
- Use the structured data in subsequent nodes
graph LR
A[User Query] --> B[LlamaCloud]
B --> C[Retrieved Context]
C --> D[AI Response]
Workflow:
- HTTP Request node: Receive user query
- LlamaCloud node: Retrieve relevant context from your index
- OpenAI node: Generate response using the retrieved context
graph LR
A[Document] --> B[LlamaParse]
B --> C[LlamaExtract]
C --> D[Analysis Results]
Workflow:
- LlamaParse node: Convert document to markdown
- LlamaExtract node: Extract specific information (e.g., dates, amounts, entities)
- Code node: Process and analyze the extracted data
Purpose: Parse PDF files and extract content in markdown format
Parameters:
- File Path (required): Path to the PDF file to parse
- Example:
/Users/username/Documents/document.pdf
- Example:
Output: Markdown content of the parsed document
Purpose: Extract structured data from files using LlamaCloud extraction agents
Parameters:
- Agent ID (required): The ID of your LlamaCloud extraction agent
- File Path (required): Path to the file to extract data from
Output: Structured data based on your extraction agent's configuration
Purpose: Retrieve context from your LlamaCloud indexes
Parameters:
- Index Name (required): Name of your LlamaCloud index
- Chat Input (from previous node): The query to search for in your index
Output: Retrieved context from your index