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 repo:push events on a Bitbucket repository. Configured parameters:
    • events: ["repo:push"] — Only triggers on push events (other event types like pull requests can be added).
    • resource: "repository" — Monitors changes at the repository level.
    • repository: "test" — 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 stopAndError. If any node during execution fails, this handler stops the workflow and logs the error message "Workflow execution error". 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

  1. Bitbucket Account & Repository – Ensure you have a Bitbucket account and a repository (public or private) that you want to monitor.
  2. 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).
  3. Configure the Trigger – Open the Bitbucket Trigger node and update the repository field to your actual repository slug (e.g., my-project). Leave other parameters as default unless you need different events.
  4. 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., {{ $json.push.changes[0].new.name }} for the branch name). You can also change the events parameter to listen for pull request creation, branch deletion, or other Bitbucket webhook events.

2 nodesmanual triggerDevOps
Stop And Error

Workflow JSON

{
  "nodes": [
    {
      "name": "Bitbucket Trigger",
      "type": "n8n-nodes-base.bitbucketTrigger",
      "position": [
        880,
        390
      ],
      "webhookId": "97ca8044-5835-4547-801d-c27dd7f10c2d",
      "parameters": {
        "events": [
          "repo:push"
        ],
        "resource": "repository",
        "repository": "test"
      },
      "credentials": {
        "bitbucketApi": "bitbucket_creds"
      },
      "typeVersion": 1,
      "id": "8712679c-947e-4360-970b-e7aebff77c83",
      "notes": "This bitbucketTrigger node performs automated tasks as part of the workflow."
    },
    {
      "id": "error-c568f4ba",
      "name": "Error Handler",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1000,
        400
      ],
      "parameters": {
        "message": "Workflow execution error",
        "options": {}
      }
    }
  ],
  "connections": {},
  "name": "Bitbuckettrigger Workflow",
  "description": "Automated workflow: Bitbuckettrigger Workflow. This workflow processes data and performs automated tasks.",
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": null,
    "timezone": "UTC",
    "executionTimeout": 3600,
    "maxExecutions": 1000,
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

Manual Trigger with Error Handler - Production Template

Overview This is a foundational n8n workflow template designed to demonstrate a robust, production-ready pattern for manual workflow execution with integrated error handling. It provides a clean starting point for building more complex automations by establishing best practices for error management and workflow structure from the outset. The workflow is intentionally minimal but includes critical production features: a manual trigger for on-demand execution, a dedicated error handler node that gracefully stops execution on failure, and comprehensive workflow settings configured for reliability (retry logic, timeout limits, and execution tracking). This makes it ideal for users who want to learn n8n's error handling capabilities or need a reliable skeleton for mission-critical automations. Workflow Steps Manual Trigger (No auth) — This is the starting point of the workflow. It allows you to run the workflow manually by clicking the "Execute Workflow" button in the n8n editor. No authentication is required for this trigger node itself. The node has no additional parameters configured, meaning it simply fires when manually activated. Error Handler (No auth) — Connected as an error workflow handler (though in this JSON it is not wired via connections, it is placed as a standalone error-catching node). This node uses the "Stop and Error" type, which means if any error occurs during workflow execution, this node will catch it and stop the workflow with a custom error message: "Workflow execution error". The parameter is empty, so no additional error handling behavior (like sending notifications) is configured. No authentication is required. Setup Instructions No external accounts required — This workflow uses only built-in n8n nodes (Manual Trigger and Stop & Error). You do not need any third-party service accounts or API keys. Import the workflow — Copy the JSON and paste it into your n8n instance via "Workflows > Add Workflow > Import from JSON". Customize the error message — If desired, edit the Error Handler node's "Message" parameter to provide a more specific error description relevant to your use case. Add your logic — Connect additional nodes after the Manual Trigger to perform your actual automation tasks. The Error Handler will automatically catch any errors from those nodes. Configure workflow settings — Review the existing settings (retry on fail, timeout, etc.) and adjust them to match your production requirements. Use Cases and Variations Learning template — Use this as a teaching tool to understand how error handling works in n8n workflows. Production skeleton — Start every new automation by duplicating this workflow, then add your business logic nodes between the trigger and error handler. Error notification system — Extend the Error Handler by adding a Slack, email, or webhook node after it to send alerts when errors occur. Multi-trigger adaptation — Replace the Manual Trigger with a Schedule Trigger, Webhook Trigger, or Event Trigger to make the workflow run automatically. Conditional error handling — Add an IF node before the Error Handler to route different error types to different handling logic (e.g., retry vs. notify vs. log).

2 nodes

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.

11 nodes

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 path. The parameter is enabled to retrieve every file without pagination. The bucket name is set via the expression , 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 parameter is currently a placeholder (); in a working setup, it should reference the key from the list node using an expression (e.g., ). The bucket name is again . All into one Item (include Binary) (Aggregate) — No auth – Combines all binary file data from the download step into a single item. The option 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 . The expression 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 and on 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 to your bucket name and to the folder prefix (e.g., ). In the "Download ALL Files from Folder" node, change the parameter to an expression like 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 ( and ). These must be replaced with actual credentials and resource identifiers for the workflow to function.

7 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.