Download and Compress All Files from AWS S3 Folder to ZIP
This workflow automates the process of listing all files in a specific folder within an AWS S3 bucket, downloading each one, and compressing them into a single ZIP archive. It is especially useful for creating backups, migrating data between storage systems, or allowing users to download an entire folder as one compressed file without needing to handle each file individually.
Node-by-Node Breakdown
- When clicking 'Test workflow' (Manual Trigger) — No auth – Starts the workflow manually. Useful for testing or on-demand execution.
- List ALL Files* (AWS S3) — AWS IAM credentials – Lists all objects in the specified bucket under the
folderKeypath. ThereturnAllparameter is enabled to retrieve every file without pagination. The bucket name is set via the expression=yourBucket, and the folder key is provided in the options. - Download ALL Files from Folder* (AWS S3) — AWS IAM credentials – Downloads each file listed in the previous step. The
fileKeyparameter is currently a placeholder (YOUR_CREDENTIAL_HERE); in a working setup, it should reference the key from the list node using an expression (e.g.,{{ $json.key }}). The bucket name is again=yourBucket. - All into one Item (include Binary) (Aggregate) — No auth – Combines all binary file data from the download step into a single item. The
includeBinariesoption ensures binary content is preserved. - Compress all of them to a ZIP (Compression) — No auth – Compresses the aggregated binary data into a ZIP file named
s3-export.zip. ThebinaryPropertyNameexpression dynamically grabs all binary properties from the input. - Note3 (Sticky Note) — No auth – Displayed in the n8n editor with instructions on how to configure the workflow.
- Error Handler (Stop and Error) — No auth – Catches execution errors and stops the workflow with a custom error message.
Setup Instructions
- AWS Account – You need an active AWS account with an S3 bucket that contains the folder you want to export.
- IAM Credentials – Create an IAM user with policy permissions for
s3:ListBucketands3:GetObjecton the bucket/path. Generate an Access Key ID and Secret Access Key. - n8n AWS Credentials – In n8n, create an AWS credential using the IAM keys. Then, in the two S3 nodes, select that credential.
- Configure Nodes – In the "List ALL Files" node, set the
bucketNameto your bucket name andfolderKeyto the folder prefix (e.g.,my-folder/). In the "Download ALL Files from Folder" node, change thefileKeyparameter to an expression like{{ $json.key }}to use the key from the list output. Ensure the bucket name matches. - Test – Click "Test workflow" to fetch, download, aggregate, and compress the files. The ZIP will appear in the output of the compression node.
Use Cases & Variations
- Backup automation – Run on a schedule (replace manual trigger with a Cron or Schedule trigger) to regularly archive a project folder.
- File migration – Use this to pull data from one S3 bucket/folder and later upload the ZIP elsewhere.
- Client downloads – Expose the ZIP via a webhook or store it in another S3 bucket for easy sharing.
- Variations – Add a filter node to select only certain file types (e.g., images) before compression. Replace the manual trigger with a webhook to enable on-demand remote downloads. Use an HTTP Request node to send the ZIP to a third-party service.
Note: The provided JSON has placeholder values (YOUR_CREDENTIAL_HERE and =yourBucket). These must be replaced with actual credentials and resource identifiers for the workflow to function.
Workflow JSON
{
"meta": {
"instanceId": "workflow-c069b442",
"versionId": "1.0.0",
"createdAt": "2025-09-29T07:07:42.193467",
"updatedAt": "2025-09-29T07:07:42.193482",
"owner": "n8n-user",
"license": "MIT",
"category": "automation",
"status": "active",
"priority": "high",
"environment": "production"
},
"nodes": [
{
"id": "5dbcd30b-7f84-4932-9dff-b5e9865f9b07",
"name": "When clicking ‘Test workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
860,
680
],
"parameters": {},
"typeVersion": 1,
"notes": "This manualTrigger node performs automated tasks as part of the workflow."
},
{
"id": "639dd225-ae36-4d2b-b341-8662ffe39836",
"name": "List ALL Files*",
"type": "n8n-nodes-base.awsS3",
"position": [
1080,
680
],
"parameters": {
"options": {
"folderKey": "YOUR_CREDENTIAL_HERE"
},
"operation": "getAll",
"returnAll": true,
"bucketName": "=yourBucket"
},
"typeVersion": 2,
"notes": "This awsS3 node performs automated tasks as part of the workflow."
},
{
"id": "cb8b4b07-af86-45b0-9621-a02c22107741",
"name": "Download ALL Files from Folder*",
"type": "n8n-nodes-base.awsS3",
"position": [
// ... truncated (copy to see full JSON)How to Import This Workflow
- 1Copy the workflow JSON above using the Copy Workflow JSON button.
- 2Open your n8n instance and go to Workflows.
- 3Click Import from JSON and paste the copied workflow.
Don't have an n8n instance? Start your free trial at n8nautomation.cloud
Related Templates
Automated n8n Workflow Backup to GitHub Repository
Overview This workflow automatically backs up every workflow in your n8n instance to a dedicated GitHub repository. It runs on a configurable schedule (or manually) and ensures that all your workflow JSON files are version-controlled and safely stored in a structured folder. The backup process intelligently handles both new workflows (creates a file) and existing ones (updates the file), making it ideal for disaster recovery, collaboration, or tracking changes over time. Step-by-Step Node Breakdown Schedule Trigger (No additional auth) — Triggers the workflow on a recurring interval. By default it runs hourly, but you can customize the schedule (e.g., daily at midnight) to suit your needs. Also supports manual execution via the Manual Trigger node. Manual Trigger (No auth) — Provides a manual button to run the backup immediately, useful for testing or on-demand backups. Get many workflows (Internal n8n API, no external credentials) — Fetches a list of all workflows from your n8n instance using the built-in n8n node. No separate API key is required; it uses the same authentication as your n8n session. Loop Over Items (No auth) — Iterates over each workflow in the list one at a time. This node processes workflows sequentially, preventing race conditions. Getafile (GitHub, OAuth2 / Personal Access Token) — Attempts to retrieve the existing workflow file from your GitHub repository at the path . If the file does not exist (i.e., a new workflow), the node’s error output is triggered. The expression in sanitizes the workflow name by replacing invalid characters (), converting to , and normalizing spaces. Convert to File1 (No auth) — Converts the retrieved GitHub file’s binary data back to a JSON object so it can be compared or overwritten. Extract from File1 (No auth) — Extracts the JSON content from the binary file, preparing it for an update operation. Edit a file (GitHub, OAuth2 / Personal Access Token) — If the workflow already exists on GitHub, this node updates the file with the latest JSON from your n8n instance. The commit message is dynamically generated (e.g., ). Convert to File (No auth) — Converts the current n8n workflow JSON into a binary file () with the workflow’s name as the filename. Create a file (GitHub, OAuth2 / Personal Access Token) — If the workflow is new (i.e., error output), this node creates a new file in the folder. The commit message includes the workflow name and . The workflow loops back to the Loop Over Items node to process the next workflow. The Sticky Note at the top serves as a comment. Setup Instructions GitHub account — You need a GitHub account and a repository (e.g., ) to store the backups. Create an empty repository or use an existing one. GitHub credential in n8n — Add a GitHub OAuth2 or Personal Access Token credential in n8n under Credentials > GitHub. Ensure the token has scope (or at least and ). Configure the nodes — - In Get many workflows, no changes needed. - In Getafile, Create a file, and Edit a file, update the and fields to match your GitHub username and repo name. - Optionally adjust the Schedule Trigger interval (set hours/minutes as desired). Error handling — The workflow references an external error workflow (). If you don’t have that, you should either create a simple error handler or remove the setting in the workflow settings. Use Cases & Adaptations Disaster recovery — Restore all workflows by downloading the JSON files from GitHub and importing them back into n8n. Version history — Track changes to workflows over time via GitHub commits and diffs. Multi-instance sync — Modify the workflow to run on multiple n8n instances, pushing to the same repo (be cautious with conflicts). Selective backup — Add a filter node after to only backup workflows with a specific tag or name pattern. Notification — Insert a Slack or email node after the loop to notify you when a backup completes or if an error occurs.
n8n Upgrade: Detect Affected Workflows with Broken Connections
Summary This workflow helps n8n administrators identify workflows that may have been affected by a past upgrade (specifically n8n version ) where multi-output nodes (like , , ) could have their output connections accidentally re-wired. It provides a self-service webhook endpoint that returns an HTML report listing all workflows with potentially broken connections, making it easy to audit and fix them. Node-by-Node Walkthrough Webhook (No auth) — Listens for HTTP GET requests at the path . When a user visits this URL in their browser, the workflow is triggered. The response mode is set to "Response Node", meaning the final output will be sent back directly. Get all workflows (API Key auth) — Uses the n8n API to fetch all workflows from the instance. You must configure this node with an n8n API credential (a personal access token created under Settings > n8n API). The node has no filters, so it retrieves every workflow. Parse potentially affected workflows (Code node, no auth) — A JavaScript code node that loops through each workflow, inspects its connections, and checks if any multi-output node (defined in the array) has empty outputs. If a node has fewer connected outputs than expected, it is flagged as potentially affected. The node outputs a JSON object with an array of affected workflows, each containing , , , and . Generate Report (HTML node, no auth) — Creates a static HTML document with a styled container, a heading, and an empty list. This serves as the shell for the interactive report generated by the next node. Serve HTML Report (Respond to Webhook node, no auth) — Takes the HTML template from the previous node and injects JavaScript that parses the affected workflows data (from the code node) and dynamically builds a list of clickable links. Each link opens the workflow in a new tab so the admin can inspect and fix the connections. The response headers are set to . Setup Instructions Prerequisites: You must have admin access to the n8n instance (the workflow must be run by the instance owner). Create an n8n API key: Go to Settings > n8n API in your n8n instance and generate a personal access token. Copy the token. Configure the "Get all workflows" node: Add an n8n credential of type "API Key" and paste the token. Leave the filters empty. Customize multi-output nodes (if needed): The code node contains a list with the default nodes (, , ). If you have community nodes with multiple outputs, add them to this array with their correct output count. Activate the workflow: Toggle the workflow to active. Use the report: Open your browser and navigate to . The page will list all affected workflows. Click on a row to open the workflow in a new tab — inspect the connections and re-wire them if needed. Use Cases & Variations Post-upgrade audit: Run this workflow after every n8n upgrade to catch connection issues early. Customized detection: Extend the array in the code node to include any custom node type that has multiple outputs. Slack/Email notification: Instead of serving an HTML report, you could send the list of affected workflows to a Slack channel or email using additional nodes. Scheduled scanning: Replace the Webhook trigger with a Schedule trigger to run the check daily and automatically notify the admin.
Bitbucket Push Event Listener (Foundation Template)
Overview This workflow provides a minimal yet production-ready foundation for listening to Bitbucket repository push events. It triggers automatically whenever code is pushed to a specified repository, making it an ideal starting point for building CI/CD pipelines, deployment automation, notification systems, or any other custom workflow that reacts to code changes. An integrated error handler ensures the workflow fails gracefully and can be extended with additional error reporting. Workflow Nodes Bitbucket Trigger (OAuth2 auth) — Listens for events on a Bitbucket repository. Configured parameters: - : — Only triggers on push events (other event types like pull requests can be added). - : — Monitors changes at the repository level. - : — The Bitbucket repository slug to watch (should be updated to your actual repository name). This node acts as a webhook receiver. It requires authentication via n8n's built-in Bitbucket OAuth2 integration (or a personal access token) to register and manage the webhook automatically. Error Handler (No auth) — type . If any node during execution fails, this handler stops the workflow and logs the error message . It does not require external credentials and serves as a safety net to prevent silent failures. Note: As provided, the nodes are not connected (no data flows between them). The workflow is a structural template—you must add additional nodes (e.g., HTTP Request, Slack, Jira) after the trigger to actually process the event payload. Setup Instructions Bitbucket Account & Repository – Ensure you have a Bitbucket account and a repository (public or private) that you want to monitor. n8n Bitbucket Credentials – In n8n, go to Credentials > New > Bitbucket OAuth2. Follow the OAuth flow to authorize n8n to access your Bitbucket account. Alternatively, you can use a Bitbucket App Password with appropriate permissions (though OAuth2 is recommended). Configure the Trigger – Open the Bitbucket Trigger node and update the field to your actual repository slug (e.g., ). Leave other parameters as default unless you need different events. Deploy & Test – Activate the workflow. Push a commit to the repository; the trigger should fire. If no additional nodes are connected, the workflow will end immediately (which is expected). Use Cases & Adaptations Continuous Integration – Add an HTTP Request node to call a Jenkins or GitHub Actions API to trigger a build. Deployment Automation – Connect a Docker or SSH node to deploy the latest code to a staging or production server. Notifications – Use a Slack or email node to alert the team of new pushes with commit details. Issue Tracking – Post a comment to a Jira issue linked to the commit. Code Quality – Run a linter or test suite via a command node and report results. To adapt, simply append new nodes after the trigger and map fields from the Bitbucket event payload (e.g., for the branch name). You can also change the parameter to listen for pull request creation, branch deletion, or other Bitbucket webhook events.