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 by specifying the file ID and pagination parameters. This is useful when working with large files that are split into smaller chunks for processing or analysis, enabling efficient retrieval of specific parts without loading the entire file.
Practical examples include:
- Retrieving text or data chunks from a large document for further processing or display.
- Paginating through file content in an application that processes documents in segments.
- Fetching image chunks in different formats (Markdown or HTML) for embedding in reports or web pages.
Properties
| Name | Meaning |
|---|---|
| File ID | The unique identifier of the file from which to query chunks. |
| Image Format | The output format for images within the chunks. Options: Markdown, HTML. |
| Page Number | The page number of chunks to retrieve, starting at 1. Defaults to the first page. |
| Page Size | The number of chunks to return per page. Defaults to 10. |
Output
The node outputs JSON data containing the queried file chunks. The structure typically includes chunk content and metadata related to each chunk. If the chunks contain images, they will be formatted according to the selected image format (Markdown or HTML).
If binary data is present (e.g., images), it is represented in the output according to the chosen image format, facilitating easy embedding or rendering in downstream nodes or applications.
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 configurable via credentials and defaults to the OneAI service endpoint.
Troubleshooting
- Missing or invalid File ID: The node requires a valid file ID to query chunks. Ensure the file ID is correct and accessible.
- Pagination errors: Providing a page number less than 1 or a page size less than 1 may cause errors. Use valid positive integers.
- API authentication failures: Verify that the API key credential is correctly configured and has necessary permissions.
- Empty or malformed response: Check network connectivity and API status; also verify that the file contains chunks to retrieve.
- Unsupported image format: Only "Markdown" and "HTML" are supported for image formatting. Using other values may cause unexpected results.
Links and References
- OneAI Official Documentation
- OneAI API Reference
- n8n Documentation on Creating Custom Nodes