Google Cloud Storage Enhanced icon

Google Cloud Storage Enhanced

Use the Google Cloud Storage API

Object → Get

AI-generated

Overview

This node integrates with Google Cloud Storage, specifically enhancing operations on buckets and objects. For the Object - Get operation, it retrieves metadata or actual data of a specified object stored in a Google Cloud Storage bucket.

Common scenarios where this node is useful include:

  • Fetching metadata details (like size, content type, creation date) of a file stored in a cloud bucket.
  • Downloading the actual file content from Google Cloud Storage to use or process further in an n8n workflow.
  • Accessing specific revisions or encrypted objects by specifying additional parameters.

Practical example:

  • A workflow that triggers when a new file is uploaded to a bucket, then uses this node to fetch the file's metadata or download the file for processing or backup.

Properties

Name Meaning
Authentication Choose between "Service Account" or "OAuth2" authentication methods to connect to Google Cloud Storage.
Bucket Name The name of the Google Cloud Storage bucket containing the object.
Object Name The name (key) of the object/file within the bucket to retrieve.
Projection Determines which properties to return:
- All Properties: Full metadata including ACLs.
- No ACL: Metadata excluding access control lists.
Return Data Type of data to return:
- Metadata: Returns JSON metadata about the object.
- Object Data: Returns the actual file content (media).
Put Output File in Field When returning object data (media), specifies the name of the binary output field where the file content will be placed. Default is data.
Additional Parameters Optional parameters to refine the get request:
- Generation: Specific revision number of the object.
- Generation Match / Exclude: Conditional retrieval based on generation.
- Metageneration Match / Exclude: Conditional retrieval based on metageneration.
Encryption Headers Headers to specify customer-supplied encryption keys:
- Encryption Algorithm (must be AES256)
- Base64 encoded encryption key
- Base64 encoded SHA256 hash of the encryption key.

Output

The node outputs an array of JSON objects corresponding to each input item processed.

  • If Return Data is set to Metadata, the output JSON contains the object's metadata as returned by the Google Cloud Storage API. This includes fields like name, bucket, contentType, size, updated, and other metadata properties depending on the projection selected.

  • If Return Data is set to Object Data, the node outputs the actual file content in a binary property named as per the Put Output File in Field setting (default data). The binary data represents the downloaded file content from the storage bucket.

Dependencies

  • Requires valid Google Cloud Storage credentials configured in n8n, either via a service account or OAuth2 authentication.
  • The node depends on the Google Cloud Storage API being accessible and the user having appropriate permissions to read objects from the specified bucket.
  • No additional external dependencies beyond standard n8n credential setup and network access to Google Cloud Storage.

Troubleshooting

  • Common issues:

    • Incorrect bucket or object names leading to "Not Found" errors.
    • Insufficient permissions causing authorization errors.
    • Using encryption headers incorrectly may cause decryption failures.
    • Requesting object data for very large files might lead to timeouts or memory issues.
  • Error messages and resolutions:

    • "404 Not Found": Verify the bucket and object names are correct and exist.
    • "403 Forbidden" or "Unauthorized": Check that the credentials have read access to the bucket and object.
    • "Bad Request" related to encryption headers: Ensure the encryption key and its SHA256 hash are correctly base64 encoded and match.
    • Timeouts or memory errors: Consider retrieving metadata only or using pagination for large datasets.

Links and References

Discussion