h2oGPTe icon

h2oGPTe

h2oGPTe is an AI-powered search assistant for your internal teams to answer questions gleaned from large volumes of documents, websites and workplace content.

Actions198

Overview

This node operation counts the number of documents within a specified collection. It is useful when you want to quickly retrieve how many documents are stored in a particular collection without fetching all document details. For example, it can be used to monitor collection sizes, enforce limits, or display summary statistics in dashboards.

Properties

Name Meaning
Collection ID ID of the collection to filter by

Output

The output JSON contains the count of documents in the specified collection. The exact structure typically includes a numeric field representing the total number of documents. No binary data is involved in this operation.

Example output JSON:

{
  "count": 123
}

Dependencies

  • Requires an API key credential for authentication with the external service.
  • The node makes an HTTP GET request to the endpoint /collections/{collection_id}/documents/count on the configured base URL.
  • The base URL and credentials must be properly configured in n8n for successful API communication.

Troubleshooting

  • Common issues:
    • Invalid or missing Collection ID: Ensure the Collection ID is correctly provided and exists.
    • Authentication errors: Verify that the API key credential is valid and has permissions to access the collection.
    • Network or connectivity problems: Check network access to the API endpoint.
  • Error messages:
    • Unauthorized or 401 errors indicate invalid credentials.
    • 404 errors may mean the collection does not exist.
    • Timeout errors suggest network issues or slow server response; consider increasing timeout settings if available.

Links and References

  • Refer to the API documentation of the service managing collections for detailed information about the /collections/{collection_id}/documents/count endpoint.
  • Consult n8n documentation on setting up API key credentials and HTTP request nodes for integration details.

Discussion