Skip to main content

List Files

Lists files that have been uploaded to Google's Gemini API with pagination support.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The connection ID obtained from the Connect node.

Options

  • Page Size - Number of files per page (1-100, default: 10).
  • Page Token - Token for pagination from a previous List Files operation.
  • Max Results - Maximum total files to return (default: all).
  • Include Expired - Whether to include expired files in results. Default is false.

Output

  • Files - List of files with detailed information.
  • Next Page Token - Token for retrieving the next page of results.

How It Works

The List Files node retrieves a list of files that have been uploaded to Google's Gemini API with support for pagination. When executed, the node:

  1. Validates the provided connection ID
  2. Configures pagination parameters including page size and page token
  3. Sends a request to the Gemini API to list files
  4. Processes the results, filtering expired files if requested
  5. Returns detailed information about each file including:
    • URI and name
    • Display name
    • MIME type
    • Size in bytes
    • Creation and update times
    • Expiration time (if applicable)
    • Processing state
    • Expiration status
  6. Provides pagination support with next page token
  7. Includes statistics about the files such as total size and counts by state

Requirements

  • A valid Google Gemini API key
  • Connection ID from a successful Connect node execution

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection ID
  • Invalid page size value (must be between 1 and 100)
  • Invalid max results value (must be at least 1)
  • API errors from Google's Gemini service

Usage Notes

  • The default page size is 10 files per page
  • Files are filtered to exclude expired ones by default
  • The node provides statistics including total file size and counts by processing state
  • Pagination is supported through the Next Page Token output
  • File processing states include:
    • Active: File is ready for use
    • Processing: File is being processed
    • Failed: File processing failed
  • Expired files can be included by enabling the Include Expired option
  • The maximum page size is 100 files
  • Time until expiration is included in file metadata when available
  • The SHA256 hash of each file is included in the metadata