Overview
This node integrates with S3-compatible storage services such as Amazon S3 or MinIO to perform file upload and presigned URL generation operations. It supports three main operations:
- Upload File: Upload a file (binary or text) to a specified bucket.
- Generate Presigned URL: Create a temporary, secure URL that grants access to an existing file in a bucket without requiring direct authentication.
- Upload and Get Presigned URL: Upload a file and immediately generate a presigned URL for it.
This node is beneficial when you want to programmatically manage files in cloud storage, especially when you need to share temporary access links to files without exposing credentials. For example, uploading user-generated content and then providing a time-limited download link.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform: upload, presignedUrl, or uploadAndPresign. |
| Bucket Name | Name of the target S3/MinIO bucket where files are stored or accessed. |
| File Name | Name of the file in the bucket (required for upload and uploadAndPresign). |
| Object Key | Key (path) of the object in the bucket (required for presignedUrl). |
| Binary File | Whether the file to upload is binary data (true) or text (false). |
| Input Binary Field | Name of the input binary field containing the file to be uploaded (used 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 (default: application/octet-stream). |
| Expiration Time (Seconds) | Duration in seconds until the presigned URL expires (used for presignedUrl and uploadAndPresign). |
Output
The node outputs JSON objects describing the result of the operation:
For Upload File:
{ "operation": "upload", "bucketName": "example-bucket", "fileName": "file.txt", "fileSize": 1234, "contentType": "text/plain", "uploadedAt": "2024-06-01T12:00:00.000Z", "url": "https://example-bucket.s3.region.amazonaws.com/file.txt" }For Generate Presigned URL:
{ "operation": "presignedUrl", "bucketName": "example-bucket", "objectKey": "file.txt", "presignedUrl": "https://signed-url...", "expiresAt": "2024-06-01T13:00:00.000Z", "generatedAt": "2024-06-01T12:00:00.000Z" }For Upload and Get Presigned URL:
{ "operation": "uploadAndPresign", "bucketName": "example-bucket", "fileName": "file.txt", "fileSize": 1234, "contentType": "text/plain", "uploadedAt": "2024-06-01T12:00:00.000Z", "url": "https://example-bucket.s3.region.amazonaws.com/file.txt", "presignedUrl": "https://signed-url...", "expiresAt": "2024-06-01T13:00:00.000Z" }
If the file is uploaded as binary data, the node reads the binary content from the specified input binary field and uploads it accordingly. The output does not include binary data itself but metadata and URLs related to the uploaded file.
Dependencies
- Requires valid credentials for an S3-compatible service (e.g., AWS S3 or MinIO), including access key, secret key, region, and optionally endpoint URL and path style configuration.
- Uses AWS SDK v3 clients for S3 operations and presigned URL generation.
- The node expects these credentials to be configured in n8n under a generic API key credential setup for S3/MinIO.
Troubleshooting
Common Issues:
- Incorrect bucket name or object key will cause errors indicating the resource was not found.
- Invalid or missing credentials will lead to authentication failures.
- Uploading binary files requires the correct input binary field name; otherwise, the node cannot find the file data.
- Setting expiration time too high or too low may cause unexpected behavior or errors from the S3 service.
Error Messages:
- Errors during upload or presigned URL generation will include messages from the underlying AWS SDK, such as permission denied, bucket not found, or invalid parameters.
- If the node is set to continue on fail, errors will be returned in the output JSON with an
errorfield describing the issue.
Resolution Tips:
- Verify bucket names and object keys exist and are accessible.
- Confirm credentials have sufficient permissions for the requested operations.
- Ensure the binary input field matches the actual binary data field name in the workflow.
- Adjust expiration times within allowed limits by the S3 provider.