N8N Tools - S3 Enhanced icon

N8N Tools - S3 Enhanced

Enhanced S3 operations with presigned URLs, multipart upload, and advanced features

Overview

This node provides enhanced integration with S3-compatible object storage services, enabling a wide range of bucket and object operations. It supports advanced features such as generating presigned URLs for secure temporary access, multipart uploads for large files, and detailed bucket management capabilities.

Common scenarios where this node is beneficial include:

  • Securely sharing or uploading files without exposing credentials by generating presigned URLs or presigned POST forms.
  • Managing buckets and objects programmatically, including creating, deleting, copying, tagging, and setting access control lists (ACLs).
  • Handling large file uploads efficiently using multipart upload operations.
  • Configuring bucket policies, CORS, lifecycle rules, versioning, logging, notifications, encryption, and other advanced bucket settings.
  • Querying object content using SQL expressions to retrieve subsets of data.

Practical example:

  • Generate a presigned URL to allow a user to download a private file from an S3 bucket without requiring AWS credentials.
  • Upload a large video file in parts using multipart upload commands to ensure reliability and resume capability.
  • Automate bucket lifecycle management by applying JSON-configured lifecycle rules to archive or delete old objects.

Properties

Name Meaning
Bucket Name Name of the S3 bucket to operate on.
Object Key Complete path/key of the object within the bucket (e.g., folder/file.pdf).

Additional properties relevant to "Download Object" operation:

Name Meaning
Bucket Name Name of the S3 bucket containing the object to download.
Object Key Full key/path of the object to download from the bucket.

(Note: The provided properties JSON only includes "Bucket Name" and "Object Key" for this operation.)

Output

The output JSON structure for the "Download Object" operation includes:

  • bucket: The name of the bucket from which the object was downloaded.
  • key: The key/path of the downloaded object.
  • data: The content of the object encoded as a base64 string.
  • contentType: The MIME type of the object.
  • contentLength: Size of the object in bytes.
  • lastModified: Timestamp of the last modification date of the object.
  • etag: Entity tag (ETag) of the object, useful for cache validation.

If the node outputs binary data, it encodes the file content in base64 within the data field, allowing downstream nodes to decode or process it accordingly.

Example output snippet (JSON):

{
  "bucket": "my-bucket-name",
  "key": "folder/file.pdf",
  "data": "base64-encoded-content",
  "contentType": "application/pdf",
  "contentLength": 123456,
  "lastModified": "2024-06-01T12:34:56.000Z",
  "etag": "\"abcdef1234567890\""
}

Dependencies

  • Requires an S3-compatible object storage service endpoint.
  • Needs valid API credentials with appropriate permissions to perform the requested operations.
  • Uses AWS SDK v3 libraries internally for communication with the S3 service.
  • Requires configuration of credentials in n8n that provide access key ID, secret access key, optional session token, region, and optionally custom endpoint and path style settings.

Troubleshooting

Common Issues

  • Invalid Credentials: Errors related to access key ID or secret access key being incorrect will prevent connection.
  • Access Denied: Insufficient permissions on the bucket or object can cause authorization failures.
  • Network/Endpoint Issues: Incorrect endpoint URLs or network connectivity problems may cause connection errors.
  • Invalid Input Data: For upload operations, invalid base64 or UTF-8 encoding in file data can cause failures.
  • Malformed JSON: Operations requiring JSON input (e.g., lifecycle rules, tags) will fail if the JSON is invalid.

Error Messages and Resolutions

  • "Invalid Access Key ID. Please check your credentials."
    Verify the access key ID is correct and active.

  • "Invalid Secret Access Key. Please check your credentials."
    Confirm the secret access key matches the access key ID.

  • "Access denied. Check your credentials and permissions."
    Ensure the IAM user or role has sufficient permissions for the bucket/object.

  • "Cannot connect to endpoint. Check your endpoint URL and network connection."
    Validate the endpoint URL and network accessibility.

  • "Invalid file data format"
    Make sure the file data is correctly base64 encoded or UTF-8 text.

  • "Invalid JSON format" (for various configurations)
    Use a JSON validator to confirm the syntax before inputting.

Links and References


This summary covers the "Download Object" operation of the node, describing its inputs, outputs, dependencies, and common troubleshooting tips based on static analysis of the source code and provided property definitions.

Discussion