Actions2
Overview
This node integrates with the OneAI API to query file chunks from a specified file stored in the OneAI workspace. It allows users to retrieve paginated chunks of content from a file, which can be useful for processing or analyzing large documents in smaller parts.
Common scenarios include:
- Extracting and reviewing segments of large files for further processing.
- Displaying file content in manageable pages within workflows.
- Converting image data within file chunks into Markdown or HTML format for embedding in reports or web pages.
For example, you might use this node to fetch the first 10 chunks of a document by its File ID and display images in Markdown format for easy preview in downstream nodes.
Properties
Name | Meaning |
---|---|
File ID | The unique identifier of the file to query chunks from. |
Image Format | The output format for images within the chunks. Options: Markdown , HTML . |
Page Number | The page number of chunks to retrieve (pagination). Minimum is 1. Defaults to 1. |
Page Size | The number of chunks to return per page. Minimum is 1. Defaults to 10. |
Output
The node outputs JSON data containing the queried file chunks. Each chunk represents a segment of the file's content. The structure typically includes text and may contain embedded images formatted according to the selected image format (Markdown or HTML).
If the file chunks include images, these are represented in the chosen format to facilitate rendering or further processing.
No binary data output is indicated by the source code.
Dependencies
- Requires an API key credential for authenticating with the OneAI service.
- The node sends HTTP POST requests to the OneAI API endpoint
/v1/openapi/workspace/file/chunk
. - The base URL for the API is derived from the credential configuration, with
/openapi
removed from the end.
Troubleshooting
- Missing or invalid File ID: The File ID property is required. Ensure it is correctly provided; otherwise, the API will reject the request.
- Pagination errors: Providing a page number less than 1 or page size less than 1 may cause errors or unexpected results. Use valid positive integers.
- API authentication failures: Verify that the API key credential is correctly configured and has necessary permissions.
- Unsupported image format: Only "markdown" and "html" are supported for image formatting. Using other values may cause errors.
- Empty response or no chunks returned: This could indicate the file is empty, the File ID is incorrect, or the requested page exceeds available chunks.
Links and References
- OneAI API Documentation (general reference for API endpoints and usage)
- n8n Documentation on Creating Custom Nodes