Backup n8n Workflows to Bitbucket

Backup n8n Workflows to Bitbucket

Scheduled
High
9
Nodes
Scheduled
Trigger
High
Complexity
7/22/2025
Added

Workflow Overview

Total Nodes
9
Node Types
8

Node Types

code
Calculate Wait Time
1 node
schedule Trigger
Run Daily at 2 AM
1 node
n8n
Get All Workflows
1 node
split In Batches
Loop Workflows
1 node
http Request
Get Existing Worfklow from Bitbucket, Upload Workflow to Bitbucket
2 nodes
if
New or Changed?
1 node
wait
Wait to Avoid Rate Limiting
1 node
set
Set Bitbucket Workspace & Repository
1 node

Workflow JSON

9.93 KB
{
  "id": "23GPrqZjHnIVvTEa",
  "meta": {
    "instanceId": "[instance id auto generated]",
    "templateCredsSetupCompleted": true
  },
  "name": "Backup n8n Workflows to Bitbucket",
  "tags": [],
  "nodes": [
    {
      "id": "b3363b9d-ea6e-47b7-99f9-f48a21805886",
      "name": "Calculate Wait Time",
      "type": "n8n-nodes-base.code",
      "position": [
        1400,
        -260
      ],
      "parameters": {
        "jsCode": "// Get all input items and ensure we have data\nif ($input.all().length === 0 || !$input.all()[0].headers) {\n  // If no headers available, return default wait time\n  return { waitTime: 1 };\n}\n\n// Check rate limit headers from previous request\nconst headers = $input.all()[0].headers;\nlet waitTime = 1; // Default 1 second\n\n// Check if we have rate limit information (safely)\nconst remaining = parseInt(headers['x-ratelimit-remaining']) || null;\nconst reset = parseInt(headers['x-ratelimit-reset']) || null;\n\n// Only adjust wait time if we have val...

Showing first 1000 characters. Click "Expand" to view the full JSON.