Description

Mega n8n Node


















This is an n8n community node for Mega.nz S4 object storage service. It provides S3-compatible operations for managing buckets and objects in your Mega S4 account.
n8n is a fair-code licensed workflow automation platform where you can host and automate your workflows locally or on cloud.
Features
đĒŖ Bucket Operations
- List Buckets – Get all buckets in your account
- Create Bucket – Create new storage buckets
- Delete Bucket – Remove empty buckets
- Head Bucket – Check if bucket exists and is accessible
- Get Location – Retrieve the region where a bucket is located
- List Objects – Browse objects in a bucket with pagination support
- Upload Object – Upload files or text data to buckets
- Download Object – Retrieve objects as binary data
- Delete Object – Remove single objects
- Delete Multiple – Batch delete multiple objects
- Head Object – Get object metadata without downloading
- Copy Object – Copy objects between buckets or within the same bucket
- â Native HTTP client with AWS Signature V4 (n8n Cloud compatible)
- â Multiple region support (Amsterdam, Luxembourg, Montreal, Vancouver)
- â Binary data handling for file uploads/downloads
- â Pagination for large object lists
- â Input validation (bucket names, object keys)
- â Custom metadata support
- â Read-only ACL operations (GetBucketAcl, GetObjectAcl)
- â Bucket policy management for access control
- âšī¸ All objects use STANDARD storage class (Mega S4 default)
đĻ Object Operations
⨠Advanced Features
Installation
> đē Prefer video? Watch our step-by-step installation tutorial
Follow the installation guide in the n8n community nodes documentation.
npm
npm install @nskha/n8n-nodes-mega
n8n Cloud & Self-Hosted
You can install community nodes directly in n8n Cloud through the Settings â Community Nodes menu.
Credentials
To use this node, you need Mega S4 API credentials:
1. Log in to your Mega account
2. Navigate to S4 settings (FM â Object storage â Keys)
3. Generate or locate your:
– Access Key ID
– Secret Access Key
4. Select your preferred region:
– eu-central-1 – Amsterdam (default)
– eu-central-2 – Luxembourg
– ca-central-1 – Montreal
– ca-west-1 – Vancouver
Configuration
In n8n, go to Credentials â New â Mega S4 API and enter:
| Field | Required | Description |
|——-|———-|—————————————————–|
| Access Key ID | Yes | Your Mega S4 access key |
| Secret Access Key | Yes | Your Mega S4 secret key |
| Region | Yes | The region for your S4 service |
| Custom S3 Endpoint | No | Override default endpoint (advanced) |
| Force Path Style | No | Use path-style URLs (default: true, for mega users) |
Usage
Example 1: List All Buckets
1. Add the Mega S4 node to your workflow
2. Connect your credentials
3. Select:
– Resource: Bucket
– Operation: List
4. Execute the node
Returns an array of all buckets with names and creation dates.
Example 2: Upload a File
1. Add the Mega S4 node after a node that outputs binary data (e.g., HTTP Request, Read Binary File)
2. Configure:
– Resource: Object
– Operation: Upload
– Bucket Name: my-bucket
– Object Key: folder/myfile.pdf
– Binary Data: true
– Binary Property: data (default)
3. Execute the node
The file will be uploaded to the specified bucket and path.
Example 3: Download a File
1. Add the Mega S4 node to your workflow
2. Configure:
– Resource: Object
– Operation: Download
– Bucket Name: my-bucket
– Object Key: folder/myfile.pdf
– Binary Property: data (output property name)
3. Execute the node
The file will be downloaded and available as binary data for the next node.
Example 4: List Objects with Prefix Filter
1. Add the Mega S4 node
2. Configure:
– Resource: Object
– Operation: List
– Bucket Name: my-bucket
– Return All: false
– Limit: 50
– Additional Fields â Prefix: documents/2024/
3. Execute the node
Returns up to 50 objects that start with documents/2024/.
Example 5: Copy Object Between Buckets
1. Add the Mega S4 node
2. Configure:
– Resource: Object
– Operation: Copy
– Source Bucket: source-bucket
– Source Object Key: old-location/file.txt
– Destination Bucket: destination-bucket
– Destination Object Key: new-location/file.txt
3. Execute the node
The object will be copied to the new location.
Operations Reference
Bucket Operations
#### List
Lists all buckets in your Mega S4 account. No parameters required.
Returns: Array of buckets with name and creationDate.
#### Create
Creates a new bucket.
Parameters:
bucketName (required): Unique bucket name (3-63 characters, lowercase, no spaces)Note: Access control is managed via bucket policies, not ACLs.
#### Delete
Deletes an empty bucket.
Parameters:
bucketName (required): Name of the bucket to deleteNote: Bucket must be empty. Use “Delete Multiple Objects” first if needed.
#### Head
Checks if a bucket exists and is accessible.
Parameters:
bucketName (required): Name of the bucket to checkReturns: exists: true if accessible, error if not found or no permission.
#### Get Location
Gets the region where a bucket is located.
Parameters:
bucketName (required): Name of the bucketReturns: region (e.g., eu-central-1)
Object Operations
#### List
Lists objects in a bucket with pagination support.
Parameters:
bucketName (required): Name of the bucketreturnAll (optional): Return all objects or limit resultslimit (optional): Max number of objects to return (default: 50)prefix (optional): Filter objects by prefix (e.g., folder/)delimiter (optional): Group keys (e.g., / for folder simulation)startAfter (optional): Start listing after this keyReturns: Array of objects with key, size, lastModified, etag, etc.
#### Upload
Uploads a file or text data to a bucket.
Parameters:
bucketName (required): Destination bucketobjectKey (required): Path/name for the object (e.g., folder/file.txt)binaryData (optional): Upload binary data (true) or text (false)binaryPropertyName (required if binary): Property containing file datatextData (required if not binary): Text content to uploadcontentType (optional): MIME type (e.g., image/png)metadata (optional): Custom key-value metadataReturns: success, etag, size, etc.
Note: All objects automatically use STANDARD storage class. Access control is managed via bucket policies.
#### Download
Downloads an object from a bucket.
Parameters:
bucketName (required): Source bucketobjectKey (required): Path/name of the objectbinaryPropertyName (optional): Output property name (default: data)Returns: Object metadata in JSON + binary data in specified property.
#### Delete
Deletes a single object.
Parameters:
bucketName (required): Bucket containing the objectobjectKey (required): Path/name of the object to deleteReturns: success, deleteMarker, versionId
#### Delete Multiple
Deletes multiple objects in one operation (batch delete).
Parameters:
bucketName (required): Bucket containing the objectsobjectKeys (required): Comma-separated list of object keysquiet (optional): Only return errors, not successful deletionsReturns: Arrays of deleted and errors with counts.
#### Head
Gets object metadata without downloading the object.
Parameters:
bucketName (required): Bucket containing the objectobjectKey (required): Path/name of the objectReturns: contentType, size, etag, lastModified, metadata, etc.
#### Copy
Copies an object to a new location.
Parameters:
sourceBucket (required): Source bucketsourceKey (required): Source object path/namedestinationBucket (required): Destination bucket (can be same as source)destinationKey (required): Destination path/namemetadataDirective (optional): COPY (keep source metadata) or REPLACEReturns: success, etag, lastModified
Mega S4 API Limitations
Mega S4 is S3-compatible but does not support all AWS S3 features. This node avoids unsupported features and provides alternatives where applicable.
| Feature | Status | Alternative |
|———|——–|————-|
| ACL (write operations) | Not supported | Use Bucket Policies |
| Storage class selection | Not supported | Automatic STANDARD |
| Server-side encryption | Not supported | Client-side encryption |
| Object lock/retention | Not supported | N/A |
| Versioning | Not supported | N/A |
| Location constraint | Not supported | Configure via endpoint/region |
| Checksum algorithm | Not supported | Use ETags |
| Presigned POST | Not supported | Use Presigned PUT |
| x-amz-grant-* headers | Not supported | Use Bucket Policies |
Supported access control
See the full list: MIT
Resources
Support
VibeCoded with â¤ī¸ for the n8n & Mega community