Overview
The LlamaExtract node is designed to extract structured content from files using external extraction agents called LlamaExtract agents. It is particularly useful when you need to process documents such as PDFs or other file types and obtain elegant, organized data from them without manual parsing.
Common scenarios include:
- Automating data extraction from invoices, reports, or contracts.
- Converting unstructured file content into structured JSON for further processing.
- Integrating document data extraction into workflows without custom coding.
For example, you can provide a PDF file path and an agent ID to extract key information like tables, text blocks, or metadata in a structured format.
Properties
| Name | Meaning |
|---|---|
| Agent ID | The identifier of the extraction agent that will process the file. |
| File Path | The local path to the file from which data should be extracted (e.g., /User/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.
If the extraction involves binary data (e.g., images or embedded files), it would typically be included in the output as base64 encoded strings or referenced separately, but this node's code does not explicitly handle binary output.
Dependencies
- Requires an API key credential for authenticating with the LlamaCloud extraction service.
- The node depends on an external utility function (
extractDataFromFile) which handles the actual communication with the extraction service. - The file to be processed must be accessible at the specified local file path.
Troubleshooting
- Missing or invalid API key: Ensure the API key credential is correctly configured and valid.
- File not found or inaccessible: Verify the file path is correct and the file is accessible by n8n.
- Invalid Agent ID: Confirm the agent ID corresponds to a valid extraction agent configured in the external service.
- Network or service errors: Check connectivity to the extraction service and ensure the service is operational.
Error messages typically originate from the external extraction utility and may indicate issues with authentication, file access, or agent configuration.
Links and References
- LlamaCloud Extraction Service Documentation (example placeholder)
- n8n documentation on Creating Custom Nodes