SmartGent MinIO icon

SmartGent MinIO

Upload files and generate presigned URLs for S3/MinIO

Overview

This node enables interaction with S3-compatible object storage services such as MinIO or AWS S3. It supports uploading files to a specified bucket and generating presigned URLs for accessing those files securely without requiring direct credentials.

Common scenarios include:

  • Uploading user-generated content or application data to cloud storage.
  • Generating temporary, secure download links for files stored in S3/MinIO buckets.
  • Combining upload and immediate URL generation to streamline workflows that require file sharing right after upload.

Practical example:

  • A workflow that receives an image from a user, uploads it to a MinIO bucket, and then generates a presigned URL so the image can be shared externally for a limited time.

Properties

Name Meaning
Bucket Name Name of the S3/MinIO bucket where the file will be uploaded.
File Name Name of the file in the bucket (used when uploading).
Binary File Whether the file to upload is binary data (true) or plain text content (false).
Input Binary Field Name of the input binary field containing the file data to be uploaded (required if Binary File is true).
File Content Content of the file as text (used if Binary File is false).
Content Type MIME type of the file being uploaded (e.g., application/octet-stream, image/png).

These properties are relevant for the Upload File operation.

Output

The node outputs JSON objects describing the result of the operation:

  • For Upload File:

    • operation: "upload"
    • bucketName: The target bucket name.
    • fileName: The name of the uploaded file.
    • fileSize: Size of the uploaded file in bytes.
    • contentType: MIME type of the uploaded file.
    • uploadedAt: ISO timestamp of when the upload occurred.
    • url: Public URL constructed based on endpoint and bucket/file names.
  • For Upload and Get Presigned URL (extends Upload File output):

    • Includes all upload fields plus:
    • presignedUrl: A temporary URL granting access to the uploaded file.
    • expiresAt: ISO timestamp indicating when the presigned URL expires.
    • operation: "uploadAndPresign"

If the node is configured to generate presigned URLs only (not uploading), the output includes:

  • operation: "presignedUrl"
  • bucketName: Target bucket.
  • objectKey: Key/path of the object in the bucket.
  • presignedUrl: Generated presigned URL.
  • expiresAt: Expiration timestamp of the URL.
  • generatedAt: Timestamp when the URL was generated.

The node does not output binary data directly; it handles binary input for uploads but returns metadata and URLs in JSON format.

Dependencies

  • Requires credentials for an S3-compatible service, including:

    • Access key ID
    • Secret access key
    • Region
    • Optional custom endpoint URL and path style flag (for MinIO or other compatible services)
  • Uses AWS SDK clients internally for S3 operations and presigned URL generation.

  • The node expects these credentials to be configured in n8n prior to use.

Troubleshooting

  • Common issues:

    • Incorrect bucket name or file name leading to failed uploads.
    • Invalid or missing credentials causing authentication errors.
    • Network connectivity problems to the S3/MinIO endpoint.
    • Mismatch between binary file setting and actual input data (e.g., binaryFile set to true but no binary data provided).
  • Error messages:

    • Authentication failures typically indicate invalid or missing API keys.
    • "NoSuchBucket" or similar errors mean the specified bucket does not exist or is inaccessible.
    • Errors related to binary data retrieval suggest incorrect binary property names or missing binary input.
  • Resolutions:

    • Verify bucket existence and permissions.
    • Double-check credential configuration and permissions.
    • Ensure the binary input field name matches the actual incoming binary data.
    • Confirm network access to the endpoint URL.

Links and References

Discussion