Overview
The LlamaExtract node enables users to extract structured content from files using external extraction agents called "LlamaExtract agents." It is designed to process files by sending them to a specified extraction agent, which returns elegant and organized data extracted from the file's contents. This node is useful in scenarios where you need to automate data extraction from documents such as PDFs, images, or other file types without manual parsing.
Practical examples include:
- Extracting invoice details (e.g., totals, dates) from PDF invoices.
- Pulling key information from contracts or reports.
- Automating data entry workflows by extracting structured data from uploaded files.
Properties
| Name | Meaning |
|---|---|
| Agent ID | The identifier of the extraction agent that will process the file and extract the data. |
| File Path | The local path to the file from which data should be extracted (e.g., /User/user/Desktop/file.pdf). |
Output
The node outputs an array of JSON objects under the json field. Each object contains the structured data extracted from the corresponding input file by the specified extraction agent. The exact structure of this JSON depends on the agent's extraction capabilities and the file content.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the external LlamaExtract service.
- The node depends on an external utility function (
extractDataFromFile) that handles communication with the extraction service. - The file to be processed must be accessible at the specified local file path.
Troubleshooting
Common issues:
- Invalid or missing API key credential will cause authentication failures.
- Incorrect or inaccessible file paths will result in file read errors.
- Providing an invalid or non-existent Agent ID may lead to extraction failures or empty results.
Error messages and resolutions:
- Authentication errors: Verify that the API key credential is correctly configured and valid.
- File not found or access denied: Ensure the file path is correct and the n8n instance has permission to read the file.
- Extraction failure: Confirm the Agent ID is correct and that the agent supports the file type being processed.
Links and References
- No direct links are provided in the source code. For more information, consult the documentation of the external LlamaExtract service or your organization's internal resources regarding extraction agents.