Back to Nodes

Mega S4

Last updated Dec 5, 2025

n8n community node for Mega.nz S4 object storage (S3-compatible)

15 Weekly Downloads
261 Monthly Downloads

Included Nodes

Mega S4

Description

![n8n.io – Workflow Automation](https://youtu.be/eJNwNlH1Xoc)

Mega n8n Node

![CI](https://github.com/Automations-Project/n8n-nodes-mega/actions/workflows/ci.yml)

![n8n community node](https://docs.n8n.io/integrations/community-nodes/)
![S3 compatible](https://docs.aws.amazon.com/AmazonS3/latest/API/)
![Mega S4](https://mega.io/s4)
![n8n Nodes API](#contributing)
![PRs Welcome](#contributing)
![npm version](https://www.npmjs.com/package/@nskha/n8n-nodes-mega)
![npm downloads](https://www.npmjs.com/package/@nskha/n8n-nodes-mega)
![n8n Node version](https://github.com/Automations-Project/n8n-nodes-mega)
![n8n compatibility](https://n8n.io)
![Node.js compatibility](https://nodejs.org)
![TypeScript](https://www.typescriptlang.org)
![Dependencies](https://libraries.io/npm/@nskha/n8n-nodes-mega)
![License](LICENSE.md)

![GitHub stars](https://github.com/Automations-Project/n8n-nodes-mega/stargazers)
![GitHub forks](https://github.com/Automations-Project/n8n-nodes-mega/network)
![GitHub issues](https://github.com/Automations-Project/n8n-nodes-mega/issues)
![Last commit](https://github.com/Automations-Project/n8n-nodes-mega/commits)

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
  • đŸ“Ļ Object Operations

  • 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
  • ✨ Advanced Features

  • ✅ 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)
  • 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 delete
  • Note: 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 check
  • Returns: 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 bucket
  • Returns: region (e.g., eu-central-1)

    Object Operations

    #### List
    Lists objects in a bucket with pagination support.

    Parameters:

  • bucketName (required): Name of the bucket
  • returnAll (optional): Return all objects or limit results
  • limit (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 key
  • Returns: Array of objects with key, size, lastModified, etag, etc.

    #### Upload
    Uploads a file or text data to a bucket.

    Parameters:

  • bucketName (required): Destination bucket
  • objectKey (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 data
  • textData (required if not binary): Text content to upload
  • contentType (optional): MIME type (e.g., image/png)
  • metadata (optional): Custom key-value metadata
  • Returns: 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 bucket
  • objectKey (required): Path/name of the object
  • binaryPropertyName (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 object
  • objectKey (required): Path/name of the object to delete
  • Returns: success, deleteMarker, versionId

    #### Delete Multiple
    Deletes multiple objects in one operation (batch delete).

    Parameters:

  • bucketName (required): Bucket containing the objects
  • objectKeys (required): Comma-separated list of object keys
  • quiet (optional): Only return errors, not successful deletions
  • Returns: Arrays of deleted and errors with counts.

    #### Head
    Gets object metadata without downloading the object.

    Parameters:

  • bucketName (required): Bucket containing the object
  • objectKey (required): Path/name of the object
  • Returns: contentType, size, etag, lastModified, metadata, etc.

    #### Copy
    Copies an object to a new location.

    Parameters:

  • sourceBucket (required): Source bucket
  • sourceKey (required): Source object path/name
  • destinationBucket (required): Destination bucket (can be same as source)
  • destinationKey (required): Destination path/name
  • metadataDirective (optional): COPY (keep source metadata) or REPLACE
  • Returns: 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

  • GetBucketAcl, GetObjectAcl (read-only)
  • Bucket policies: GetBucketPolicy, PutBucketPolicy, DeleteBucketPolicy
  • See the full list: MIT

    Resources

  • n8n community nodes documentation
  • Mega S4 Documentation
  • AWS S3 API Reference
  • Support

  • n8n Community Forum: community.n8n.io
  • Issues: GitHub Issues
  • Mega Support: mega.io/help

VibeCoded with â¤ī¸ for the n8n & Mega community