{
  "updatedAt": "2026-05-18T12:01:55.575Z",
  "createdAt": "2026-05-11T16:32:25.751Z",
  "id": "5bDUdKVV1nSwP3TW",
  "name": "github_fluxo",
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "={{ $json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $json.id }}.json"
        }
      },
      "id": "ee8fd575-97d7-4f95-90db-4fced117b3f6",
      "name": "Move JSON to binary",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        -192,
        336
      ]
    },
    {
      "parameters": {
        "content": "## Acionar\nVoc\u00ea pode alter\u00e1-lo para [gatilho \"Agendar\"](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/) para fazer backups regularmente.",
        "height": 380,
        "width": 182
      },
      "id": "26f65755-0a25-4227-8012-0e5bb57aea34",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1296,
        160
      ]
    },
    {
      "parameters": {
        "content": "## Definir e formatar data/hora\nEsses n\u00f3s s\u00e3o respons\u00e1veis \u200b\u200bpor definir a data e hora atuais no formato `dd/MM/yyyy Hh:mm`. Data e hora s\u00e3o usadas para compor mensagens de commit no GitLab, por exemplo: `backup-12/07/2023 14:18`.",
        "height": 379,
        "width": 585
      },
      "id": "8228ebe8-b5ee-4e5a-9b3f-c47819f40dc2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1056,
        160
      ]
    },
    {
      "parameters": {
        "content": "## Recupere os workflows\nObtenha todos os fluxos de trabalho da sua inst\u00e2ncia n8n. Lembre-se de que **suas credenciais precisam apontar para a inst\u00e2ncia da qual voc\u00ea deseja fazer backup.**",
        "height": 379,
        "width": 424
      },
      "id": "fec34a87-77c9-4c56-9829-4074f02cb45e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -448,
        176
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "commitDate",
              "value": "={{ $json.formattedDate }}"
            },
            {
              "name": "GRUPO",
              "value": "ckelysena"
            },
            {
              "name": "PROJETO",
              "value": "backup-n8n"
            },
            {
              "name": "BRANCH",
              "value": "main"
            },
            {
              "name": "PASTA_BACKUP",
              "value": "workflows/"
            }
          ]
        },
        "options": {}
      },
      "id": "a6c38f72-49c5-462a-a1d9-3210ed054c9e",
      "name": "Setar a data do Commit",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        -624,
        336
      ]
    },
    {
      "parameters": {
        "options": {
          "timezone": "America/Sao_Paulo"
        }
      },
      "id": "bfc33dc2-6291-4341-9e0c-08f3d54c2017",
      "name": "Sete a data",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        -1024,
        336
      ]
    },
    {
      "parameters": {
        "operation": "formatDate",
        "date": "={{ $json.currentDate }}",
        "format": "custom",
        "customFormat": "dd/MM/yyyy HH:mm",
        "options": {
          "timezone": true
        }
      },
      "id": "ff6101d4-0c38-4a46-ad58-963bdce73be7",
      "name": "Data formatada",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        -832,
        336
      ]
    },
    {
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "id": "01819c6e-77cc-44d9-935d-33ce81dcbd32",
      "name": "Recupere os workflows [N8N]",
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        -416,
        784
      ],
      "credentials": {
        "n8nApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        0,
        336
      ],
      "id": "ab628ed3-258a-49f4-8466-bf70458fe819",
      "name": "Loop Over Items"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "name": "Replace Me",
      "typeVersion": 1,
      "position": [
        1408,
        512
      ],
      "id": "a07a1d6a-2bb0-4c10-9013-0cb0a4ffc12b"
    },
    {
      "parameters": {
        "content": "## Carregar c\u00f3pia de seguran\u00e7a\nDivida os arquivos JSON em lotes de 1, verifique se eles foram carregados no reposit\u00f3rio antes. Se sim (true), carregue a nova vers\u00e3o do arquivo. Caso contr\u00e1rio (false) crie o arquivo no reposit\u00f3rio.",
        "height": 796,
        "width": 1616
      },
      "id": "c54aa4e0-98ba-4422-b901-8b2d15279665",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "31db09ad-455b-42bd-90b1-71c4533b6026",
              "name": "ARQUIVO",
              "value": "={{ $binary.data.fileName }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        352
      ],
      "id": "5f966f4d-63de-40af-893f-feeadd23a9b8",
      "name": "ARQUIVO"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "e4dd24f9-2bd2-4972-a222-becfcb95e2a1",
              "leftValue": "={{ $json.error }}",
              "rightValue": "could not be found",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        592,
        528
      ],
      "id": "e53ea3d2-bd6e-48a7-b237-79452376ecd8",
      "name": "If",
      "executeOnce": false
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        800,
        320
      ],
      "id": "588347b7-62f6-40bb-8888-006bf3064ff9",
      "name": "MERGE_CRIAR"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        912,
        512
      ],
      "id": "8c7e11f1-da03-4c40-b731-d1b553234915",
      "name": "MERGE_ATUALIZAR"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -1248,
        336
      ],
      "id": "78d9378e-5fc8-492a-aff2-94741947a339",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "resource": "file",
        "operation": "get",
        "owner": {
          "__rl": true,
          "value": "ckelysena",
          "mode": "name"
        },
        "repository": {
          "__rl": true,
          "value": "backup-n8n",
          "mode": "list",
          "cachedResultName": "backup-n8n",
          "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
        },
        "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $binary.data.fileName }}",
        "additionalParameters": {}
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        384,
        496
      ],
      "id": "f27f5105-e29d-4ad7-86d6-205485342863",
      "name": "Get a file",
      "alwaysOutputData": true,
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "resource": "file",
        "operation": "edit",
        "owner": {
          "__rl": true,
          "value": "ckelysena",
          "mode": "list",
          "cachedResultName": "ckelysena",
          "cachedResultUrl": "https://github.com/ckelysena"
        },
        "repository": {
          "__rl": true,
          "value": "backup-n8n",
          "mode": "list",
          "cachedResultName": "backup-n8n",
          "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
        },
        "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $binary.data.fileName }}",
        "binaryData": true,
        "commitMessage": "=update-{{ $('Setar a data do Commit').first().json.commitDate }}"
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        1136,
        528
      ],
      "id": "0c2804dd-89d5-4e25-9bba-6392bef60c87",
      "name": "atualizar",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "owner": {
          "__rl": true,
          "value": "ckelysena",
          "mode": "name"
        },
        "repository": {
          "__rl": true,
          "value": "backup-n8n",
          "mode": "list",
          "cachedResultName": "backup-n8n",
          "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
        },
        "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $('ARQUIVO').first().json.ARQUIVO }}",
        "fileContent": "={{ JSON.stringify($json, null, 2) }}",
        "commitMessage": "backup-{{ $('Setar a data do Commit').first().json.commitDate }}",
        "additionalParameters": {
          "branch": {
            "branch": "={{ $('Setar a data do Commit').first().json.BRANCH }}"
          }
        }
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        1072,
        304
      ],
      "id": "3e2d718a-e4fe-40c3-9477-8242e38fb730",
      "name": "criar",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "http://localhost:5678/api/v1/workflows?tags=fluxo_git",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "<redacted-credential>"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -416,
        336
      ],
      "id": "fcc399f0-c78f-421f-a3f6-03ab675f6e6b",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "jsCode": "const data = $json.data || [];\n\nreturn data.map(item => {\n  return {\n    json: item\n  };\n});;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -64,
        480
      ],
      "id": "63a588e4-95d7-4114-8e3c-b3d3a38838b5",
      "name": "Code in JavaScript"
    }
  ],
  "connections": {
    "Move JSON to binary": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setar a data do Commit": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sete a data": {
      "main": [
        [
          {
            "node": "Data formatada",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data formatada": {
      "main": [
        [
          {
            "node": "Setar a data do Commit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recupere os workflows [N8N]": {
      "main": [
        []
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "ARQUIVO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace Me": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ARQUIVO": {
      "main": [
        [
          {
            "node": "MERGE_CRIAR",
            "type": "main",
            "index": 0
          },
          {
            "node": "MERGE_ATUALIZAR",
            "type": "main",
            "index": 1
          },
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "MERGE_CRIAR",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "MERGE_ATUALIZAR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MERGE_CRIAR": {
      "main": [
        [
          {
            "node": "criar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MERGE_ATUALIZAR": {
      "main": [
        [
          {
            "node": "atualizar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Sete a data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "atualizar": {
      "main": [
        [
          {
            "node": "Replace Me",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "criar": {
      "main": [
        [
          {
            "node": "Replace Me",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Move JSON to binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "timeSavedMode": "fixed",
    "errorWorkflow": "1jxaj9raKLgo2JA5",
    "timezone": "America/Sao_Paulo",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": {
    "node:Schedule Trigger": {
      "recurrenceRules": []
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "dd54d001-4890-46e0-a1dd-2960dd2fefed",
  "activeVersionId": "dd54d001-4890-46e0-a1dd-2960dd2fefed",
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2026-05-11T16:32:25.754Z",
      "createdAt": "2026-05-11T16:32:25.754Z",
      "role": "workflow:owner",
      "workflowId": "5bDUdKVV1nSwP3TW",
      "projectId": "Jyy47ZlZaFawo1Ju"
    }
  ],
  "activeVersion": {
    "updatedAt": "2026-05-15T03:09:40.000Z",
    "createdAt": "2026-05-12T01:37:15.404Z",
    "versionId": "dd54d001-4890-46e0-a1dd-2960dd2fefed",
    "workflowId": "5bDUdKVV1nSwP3TW",
    "nodes": [
      {
        "parameters": {
          "mode": "jsonToBinary",
          "options": {
            "fileName": "={{ $json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $json.id }}.json"
          }
        },
        "id": "ee8fd575-97d7-4f95-90db-4fced117b3f6",
        "name": "Move JSON to binary",
        "type": "n8n-nodes-base.moveBinaryData",
        "typeVersion": 1,
        "position": [
          -192,
          336
        ]
      },
      {
        "parameters": {
          "content": "## Acionar\nVoc\u00ea pode alter\u00e1-lo para [gatilho \"Agendar\"](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/) para fazer backups regularmente.",
          "height": 380,
          "width": 182
        },
        "id": "26f65755-0a25-4227-8012-0e5bb57aea34",
        "name": "Sticky Note",
        "type": "n8n-nodes-base.stickyNote",
        "typeVersion": 1,
        "position": [
          -1296,
          160
        ]
      },
      {
        "parameters": {
          "content": "## Definir e formatar data/hora\nEsses n\u00f3s s\u00e3o respons\u00e1veis \u200b\u200bpor definir a data e hora atuais no formato `dd/MM/yyyy Hh:mm`. Data e hora s\u00e3o usadas para compor mensagens de commit no GitLab, por exemplo: `backup-12/07/2023 14:18`.",
          "height": 379,
          "width": 585
        },
        "id": "8228ebe8-b5ee-4e5a-9b3f-c47819f40dc2",
        "name": "Sticky Note1",
        "type": "n8n-nodes-base.stickyNote",
        "typeVersion": 1,
        "position": [
          -1056,
          160
        ]
      },
      {
        "parameters": {
          "content": "## Recupere os workflows\nObtenha todos os fluxos de trabalho da sua inst\u00e2ncia n8n. Lembre-se de que **suas credenciais precisam apontar para a inst\u00e2ncia da qual voc\u00ea deseja fazer backup.**",
          "height": 379,
          "width": 424
        },
        "id": "fec34a87-77c9-4c56-9829-4074f02cb45e",
        "name": "Sticky Note3",
        "type": "n8n-nodes-base.stickyNote",
        "typeVersion": 1,
        "position": [
          -448,
          176
        ]
      },
      {
        "parameters": {
          "keepOnlySet": true,
          "values": {
            "string": [
              {
                "name": "commitDate",
                "value": "={{ $json.formattedDate }}"
              },
              {
                "name": "GRUPO",
                "value": "ckelysena"
              },
              {
                "name": "PROJETO",
                "value": "backup-n8n"
              },
              {
                "name": "BRANCH",
                "value": "main"
              },
              {
                "name": "PASTA_BACKUP",
                "value": "workflows/"
              }
            ]
          },
          "options": {}
        },
        "id": "a6c38f72-49c5-462a-a1d9-3210ed054c9e",
        "name": "Setar a data do Commit",
        "type": "n8n-nodes-base.set",
        "typeVersion": 2,
        "position": [
          -624,
          336
        ]
      },
      {
        "parameters": {
          "options": {
            "timezone": "America/Sao_Paulo"
          }
        },
        "id": "bfc33dc2-6291-4341-9e0c-08f3d54c2017",
        "name": "Sete a data",
        "type": "n8n-nodes-base.dateTime",
        "typeVersion": 2,
        "position": [
          -1024,
          336
        ]
      },
      {
        "parameters": {
          "operation": "formatDate",
          "date": "={{ $json.currentDate }}",
          "format": "custom",
          "customFormat": "dd/MM/yyyy HH:mm",
          "options": {
            "timezone": true
          }
        },
        "id": "ff6101d4-0c38-4a46-ad58-963bdce73be7",
        "name": "Data formatada",
        "type": "n8n-nodes-base.dateTime",
        "typeVersion": 2,
        "position": [
          -832,
          336
        ]
      },
      {
        "parameters": {
          "filters": {},
          "requestOptions": {}
        },
        "id": "01819c6e-77cc-44d9-935d-33ce81dcbd32",
        "name": "Recupere os workflows [N8N]",
        "type": "n8n-nodes-base.n8n",
        "typeVersion": 1,
        "position": [
          -416,
          784
        ],
        "credentials": {
          "n8nApi": {
            "id": "CmHBALH7sdQqSqJq",
            "name": "n8n account"
          }
        }
      },
      {
        "parameters": {
          "options": {}
        },
        "type": "n8n-nodes-base.splitInBatches",
        "typeVersion": 3,
        "position": [
          0,
          336
        ],
        "id": "ab628ed3-258a-49f4-8466-bf70458fe819",
        "name": "Loop Over Items"
      },
      {
        "parameters": {},
        "type": "n8n-nodes-base.noOp",
        "name": "Replace Me",
        "typeVersion": 1,
        "position": [
          1408,
          512
        ],
        "id": "a07a1d6a-2bb0-4c10-9013-0cb0a4ffc12b"
      },
      {
        "parameters": {
          "content": "## Carregar c\u00f3pia de seguran\u00e7a\nDivida os arquivos JSON em lotes de 1, verifique se eles foram carregados no reposit\u00f3rio antes. Se sim (true), carregue a nova vers\u00e3o do arquivo. Caso contr\u00e1rio (false) crie o arquivo no reposit\u00f3rio.",
          "height": 796,
          "width": 1616
        },
        "id": "c54aa4e0-98ba-4422-b901-8b2d15279665",
        "name": "Sticky Note4",
        "type": "n8n-nodes-base.stickyNote",
        "typeVersion": 1,
        "position": [
          0,
          0
        ]
      },
      {
        "parameters": {
          "assignments": {
            "assignments": [
              {
                "id": "31db09ad-455b-42bd-90b1-71c4533b6026",
                "name": "ARQUIVO",
                "value": "={{ $binary.data.fileName }}",
                "type": "string"
              }
            ]
          },
          "includeOtherFields": true,
          "options": {}
        },
        "type": "n8n-nodes-base.set",
        "typeVersion": 3.4,
        "position": [
          240,
          352
        ],
        "id": "5f966f4d-63de-40af-893f-feeadd23a9b8",
        "name": "ARQUIVO"
      },
      {
        "parameters": {
          "conditions": {
            "options": {
              "caseSensitive": true,
              "leftValue": "",
              "typeValidation": "loose",
              "version": 2
            },
            "conditions": [
              {
                "id": "e4dd24f9-2bd2-4972-a222-becfcb95e2a1",
                "leftValue": "={{ $json.error }}",
                "rightValue": "could not be found",
                "operator": {
                  "type": "string",
                  "operation": "contains"
                }
              }
            ],
            "combinator": "and"
          },
          "looseTypeValidation": true,
          "options": {}
        },
        "type": "n8n-nodes-base.if",
        "typeVersion": 2.2,
        "position": [
          592,
          528
        ],
        "id": "e53ea3d2-bd6e-48a7-b237-79452376ecd8",
        "name": "If",
        "executeOnce": false
      },
      {
        "parameters": {
          "mode": "combine",
          "combineBy": "combineByPosition",
          "options": {}
        },
        "type": "n8n-nodes-base.merge",
        "typeVersion": 3.2,
        "position": [
          800,
          320
        ],
        "id": "588347b7-62f6-40bb-8888-006bf3064ff9",
        "name": "MERGE_CRIAR"
      },
      {
        "parameters": {
          "mode": "combine",
          "combineBy": "combineByPosition",
          "options": {}
        },
        "type": "n8n-nodes-base.merge",
        "typeVersion": 3.2,
        "position": [
          912,
          512
        ],
        "id": "8c7e11f1-da03-4c40-b731-d1b553234915",
        "name": "MERGE_ATUALIZAR"
      },
      {
        "parameters": {
          "rule": {
            "interval": [
              {}
            ]
          }
        },
        "type": "n8n-nodes-base.scheduleTrigger",
        "typeVersion": 1.2,
        "position": [
          -1248,
          336
        ],
        "id": "78d9378e-5fc8-492a-aff2-94741947a339",
        "name": "Schedule Trigger"
      },
      {
        "parameters": {
          "resource": "file",
          "operation": "get",
          "owner": {
            "__rl": true,
            "value": "ckelysena",
            "mode": "name"
          },
          "repository": {
            "__rl": true,
            "value": "backup-n8n",
            "mode": "list",
            "cachedResultName": "backup-n8n",
            "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
          },
          "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $binary.data.fileName }}",
          "additionalParameters": {}
        },
        "type": "n8n-nodes-base.github",
        "typeVersion": 1.1,
        "position": [
          384,
          496
        ],
        "id": "f27f5105-e29d-4ad7-86d6-205485342863",
        "name": "Get a file",
        "webhookId": "6bae1858-ad20-4b95-82f9-9e4c0aef9a41",
        "alwaysOutputData": true,
        "credentials": {
          "githubApi": {
            "id": "NgKvwgoBHwOzMdbx",
            "name": "GitHub account"
          }
        },
        "onError": "continueRegularOutput"
      },
      {
        "parameters": {
          "resource": "file",
          "operation": "edit",
          "owner": {
            "__rl": true,
            "value": "ckelysena",
            "mode": "list",
            "cachedResultName": "ckelysena",
            "cachedResultUrl": "https://github.com/ckelysena"
          },
          "repository": {
            "__rl": true,
            "value": "backup-n8n",
            "mode": "list",
            "cachedResultName": "backup-n8n",
            "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
          },
          "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $binary.data.fileName }}",
          "binaryData": true,
          "commitMessage": "=update-{{ $('Setar a data do Commit').first().json.commitDate }}"
        },
        "type": "n8n-nodes-base.github",
        "typeVersion": 1.1,
        "position": [
          1136,
          528
        ],
        "id": "0c2804dd-89d5-4e25-9bba-6392bef60c87",
        "name": "atualizar",
        "webhookId": "ebf49be0-6798-4566-b91d-f5a393672ed9",
        "credentials": {
          "githubApi": {
            "id": "NgKvwgoBHwOzMdbx",
            "name": "GitHub account"
          }
        }
      },
      {
        "parameters": {
          "resource": "file",
          "owner": {
            "__rl": true,
            "value": "ckelysena",
            "mode": "name"
          },
          "repository": {
            "__rl": true,
            "value": "backup-n8n",
            "mode": "list",
            "cachedResultName": "backup-n8n",
            "cachedResultUrl": "https://github.com/ckelysena/backup-n8n"
          },
          "filePath": "={{ $('Setar a data do Commit').first().json.PASTA_BACKUP }}{{ $('ARQUIVO').first().json.ARQUIVO }}",
          "fileContent": "={{ JSON.stringify($json, null, 2) }}",
          "commitMessage": "backup-{{ $('Setar a data do Commit').first().json.commitDate }}",
          "additionalParameters": {
            "branch": {
              "branch": "={{ $('Setar a data do Commit').first().json.BRANCH }}"
            }
          }
        },
        "type": "n8n-nodes-base.github",
        "typeVersion": 1.1,
        "position": [
          1072,
          304
        ],
        "id": "3e2d718a-e4fe-40c3-9477-8242e38fb730",
        "name": "criar",
        "webhookId": "d7129e27-51ce-4cb1-92d7-ed225b8efc2f",
        "credentials": {
          "githubApi": {
            "id": "NgKvwgoBHwOzMdbx",
            "name": "GitHub account"
          }
        }
      },
      {
        "parameters": {
          "url": "http://localhost:5678/api/v1/workflows?tags=fluxo_git",
          "sendHeaders": true,
          "headerParameters": {
            "parameters": [
              {
                "name": "X-N8N-API-KEY",
                "value": "<redacted-credential>"
              }
            ]
          },
          "options": {}
        },
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.4,
        "position": [
          -416,
          336
        ],
        "id": "fcc399f0-c78f-421f-a3f6-03ab675f6e6b",
        "name": "HTTP Request"
      },
      {
        "parameters": {
          "jsCode": "const data = $json.data || [];\n\nreturn data.map(item => {\n  return {\n    json: item\n  };\n});;"
        },
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          -64,
          480
        ],
        "id": "63a588e4-95d7-4114-8e3c-b3d3a38838b5",
        "name": "Code in JavaScript"
      }
    ],
    "connections": {
      "Move JSON to binary": {
        "main": [
          [
            {
              "node": "Loop Over Items",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Setar a data do Commit": {
        "main": [
          [
            {
              "node": "HTTP Request",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Sete a data": {
        "main": [
          [
            {
              "node": "Data formatada",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Data formatada": {
        "main": [
          [
            {
              "node": "Setar a data do Commit",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Recupere os workflows [N8N]": {
        "main": [
          []
        ]
      },
      "Loop Over Items": {
        "main": [
          [],
          [
            {
              "node": "ARQUIVO",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Replace Me": {
        "main": [
          [
            {
              "node": "Loop Over Items",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "ARQUIVO": {
        "main": [
          [
            {
              "node": "MERGE_CRIAR",
              "type": "main",
              "index": 0
            },
            {
              "node": "MERGE_ATUALIZAR",
              "type": "main",
              "index": 1
            },
            {
              "node": "Get a file",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "If": {
        "main": [
          [
            {
              "node": "MERGE_CRIAR",
              "type": "main",
              "index": 1
            }
          ],
          [
            {
              "node": "MERGE_ATUALIZAR",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "MERGE_CRIAR": {
        "main": [
          [
            {
              "node": "criar",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "MERGE_ATUALIZAR": {
        "main": [
          [
            {
              "node": "atualizar",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Schedule Trigger": {
        "main": [
          [
            {
              "node": "Sete a data",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Get a file": {
        "main": [
          [
            {
              "node": "If",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "atualizar": {
        "main": [
          [
            {
              "node": "Replace Me",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "criar": {
        "main": [
          [
            {
              "node": "Replace Me",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "HTTP Request": {
        "main": [
          [
            {
              "node": "Code in JavaScript",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Code in JavaScript": {
        "main": [
          [
            {
              "node": "Move JSON to binary",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    },
    "authors": "Mickeliny de Sena",
    "name": "Version dd54d001",
    "description": "",
    "autosaved": true
  },
  "tags": [
    {
      "updatedAt": "2026-05-12T01:30:57.016Z",
      "createdAt": "2026-05-12T01:30:57.016Z",
      "id": "YSW6uffFWQDJyeuS",
      "name": "fluxo_git"
    }
  ]
}