Copia de seguridad de flujos de trabajo n8n con control de versiones y seguimiento en Notion
Este es unDevOpsflujo de automatización del dominio deautomatización que contiene 28 nodos.Utiliza principalmente nodos como If, N8n, Wait, Limit, Filter. Respaldo de flujos de trabajo de n8n con control de versiones y seguimiento en Notion
- •Clave de API de Notion
Nodos utilizados (28)
Categoría
{
"meta": {
"instanceId": "e2b72466a589dd1250fc94a8e861457e040bf25b07f6b069958c036d3f2bfe77",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "0fe79c1a-bdb9-41d5-8306-dcff0e5eff64",
"name": "Al hacer clic en 'Probar flujo de trabajo'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
384,
144
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d67fc8d4-42b0-4183-a64b-1ef550aaea71",
"name": "GET - Workflows",
"type": "n8n-nodes-base.n8n",
"position": [
464,
832
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "DnCSC68bV3k9pk06",
"name": "n8n account"
}
},
"typeVersion": 1
},
{
"id": "3c90ef38-0341-4493-80f1-d85f112dbe9f",
"name": "CREATE - Workflow",
"type": "n8n-nodes-base.n8n",
"notes": "{\n \"name\": \"{{ $json.name }}\",\n \"nodes\": {{ JSON.stringify($json[\"nodes\"]) }},\n \"connections\": {{ JSON.stringify($json[\"connections\"] || {}) }}\n}",
"position": [
1344,
864
],
"parameters": {
"operation": "create",
"requestOptions": {},
"workflowObject": "={\n \"name\": \"{{ $('today_prefix').item.json.formattedDate + $json.name }}\",\n \"nodes\": {{ JSON.stringify($json[\"nodes\"]) }},\n \"connections\": {{ JSON.stringify($json[\"connections\"] || {}) }}\n}"
},
"credentials": {
"n8nApi": {
"id": "lz1TUJbuJ3ADZKs5",
"name": "render_n8n"
}
},
"typeVersion": 1
},
{
"id": "f521fd95-a581-4e7d-8c03-f5846ec2b859",
"name": "Recorrer elementos",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1120,
832
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "b2f9180c-9ae4-4114-aba7-0e4803598b61",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
400,
752
],
"parameters": {
"color": 6,
"width": 220,
"content": "### Source Select All"
},
"typeVersion": 1
},
{
"id": "3acd266a-e555-4501-9ef2-6e1a4d7be5ee",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1232,
784
],
"parameters": {
"color": 3,
"width": 540,
"height": 300,
"content": "### Destination Save Today\nworflowname becomes YYYY-MM-DD_workflowname"
},
"typeVersion": 1
},
{
"id": "ed59a2e4-c489-4359-bbf4-89dfc88424d9",
"name": "GET - Destination Workflows",
"type": "n8n-nodes-base.n8n",
"position": [
912,
512
],
"parameters": {
"limit": 200,
"filters": {},
"returnAll": false,
"requestOptions": {
"batching": {
"batch": {}
}
}
},
"credentials": {
"n8nApi": {
"id": "lz1TUJbuJ3ADZKs5",
"name": "render_n8n"
}
},
"typeVersion": 1
},
{
"id": "655bb1aa-306e-4f18-8bde-0706684f5d5a",
"name": "Split Out Workflows",
"type": "n8n-nodes-base.splitOut",
"position": [
912,
832
],
"parameters": {
"include": "allOtherFields",
"options": {},
"fieldToSplitOut": "id"
},
"typeVersion": 1
},
{
"id": "4e302ca7-31d4-47d9-a5f0-df4997b9dd5b",
"name": "Split Out Workflows1",
"type": "n8n-nodes-base.splitOut",
"position": [
1152,
512
],
"parameters": {
"include": "allOtherFields",
"options": {},
"fieldToSplitOut": "id"
},
"typeVersion": 1
},
{
"id": "6bcc9cc7-cb70-41aa-81d9-8a76d9fd0c88",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-256,
-80
],
"parameters": {
"color": 7,
"width": 576,
"height": 1312,
"content": "# Copy n8n workflows between n8n instances\nInspired by [Alex Kim's workflow](https://n8n.io/workflows/3048-clone-n8n-workflows-between-instances-using-n8n-api/), this version adds the ability to keep multiple versions of the same workflow on the destination instance. Each copied workflow’s name is prefixed with the date (`YYYY_MM_DD_`), enabling simple version tracking. Process details and workflow counts are recorded centrally in Notion.\n\n## How it works\n\n- Workflows from the **source n8n instance** are copied to the **destination** using the n8n API node.\n- On the destination, each workflow name is prefixed with the current date (e.g., `2025_08_03_PDF Summarizer`), so you can keep multiple daily versions.\n- The workflow tracks and saves:\n - The date of execution.\n - Number of workflows processed.\n - Both details are recorded in Notion.\n\n### Rolling retention policy example:\n\n- **Day 1:** Workflows are saved with `2025_08_03_` prefix.\n- **Day 2:** New set saved with `2025_08_04_`.\n- **Day 3:** Day 1’s set is deleted, new set saved as `2025_08_05_`.\n- To keep more days, adjust the “Subtract From Date” node.\n\n## How to use\n\n1. **Create a Notion database** with one page and three fields:\n - `sequence`: Should contain `\"prefix\"`.\n - `Value`: Today's date as `YYYY_MM_DD_`.\n - `Comment`: Number of saved workflows.\n\n2. **Configure the Notion node**:\n - Enter your Notion credentials.\n - Link to the created database/page.\n\n3. **Update the \"Subtract From Date\" node**:\n - Set how many days’ versions you want to keep (default: 2 days).\n - Set the limit to 1 in the \"Limit\" node for testing.\n4. **Input credentials** for both source and destination n8n instances.\n\n## Requirements\n\n- **Notion** for tracking execution date and workflow count.\n- **n8n API Keys** for both source and destination instances.\n- **n8n version** this workflow was tested on 1.103.2 (Ubuntu)\n- Ensure you have the necessary **API permissions** (read, create, delete workflows) for both n8n instances.\n\n## Need Help?\n\nContact me on LinkedIn or ask in the [Forum](https://community.n8n.io/)!\n\n\n"
},
"typeVersion": 1
},
{
"id": "d1374fb8-78ac-480e-a30b-90e723cd05c2",
"name": "Esperar",
"type": "n8n-nodes-base.wait",
"position": [
1568,
928
],
"webhookId": "4ae2efb3-4231-4577-81f5-8f825cb81484",
"parameters": {
"amount": 1
},
"typeVersion": 1.1
},
{
"id": "04b6f8a9-1e5f-4ef4-bc50-7899732387e5",
"name": "Limitar",
"type": "n8n-nodes-base.limit",
"disabled": true,
"position": [
688,
832
],
"parameters": {},
"typeVersion": 1
},
{
"id": "4190da9c-a51b-45f2-92fd-4bcb8e8ff4f3",
"name": "Filtrar",
"type": "n8n-nodes-base.filter",
"notes": "{{ (() => $json.name.slice(0, 7))() }}",
"position": [
1360,
512
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7bdc83bd-e9b3-4eaa-8154-4056fca3b390",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.name.slice(0, 11) }}",
"rightValue": "={{ $('yesterday_prefix').item.json.formattedDate }}"
}
]
}
},
"typeVersion": 2.2,
"alwaysOutputData": false
},
{
"id": "bbc9d2a5-f6fd-4800-99e3-f448856e39bf",
"name": "today",
"type": "n8n-nodes-base.dateTime",
"position": [
608,
144
],
"parameters": {
"options": {}
},
"typeVersion": 2
},
{
"id": "c6e31672-e3d2-4f31-8af4-b10099f131f6",
"name": "yesterday",
"type": "n8n-nodes-base.dateTime",
"position": [
432,
512
],
"parameters": {
"options": {},
"duration": 2,
"magnitude": "={{ $('today').item.json.currentDate }}",
"operation": "subtractFromDate"
},
"typeVersion": 2
},
{
"id": "9720d3b9-244d-4a44-9ebe-f4f80e14c7dd",
"name": "yesterday_prefix",
"type": "n8n-nodes-base.dateTime",
"position": [
688,
512
],
"parameters": {
"date": "={{ $json.newDate }}",
"format": "custom",
"options": {},
"operation": "formatDate",
"customFormat": "yyyy-MM-dd_"
},
"typeVersion": 2
},
{
"id": "ab21f9b5-21b4-432a-9fe3-eb28039c49a1",
"name": "today_prefix",
"type": "n8n-nodes-base.dateTime",
"position": [
832,
144
],
"parameters": {
"date": "={{ $json.currentDate }}",
"format": "custom",
"options": {},
"operation": "formatDate",
"customFormat": "yyyy-MM-dd_"
},
"typeVersion": 2
},
{
"id": "eeec891a-cad2-449c-8f4d-81d887a4efbe",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1328,
368
],
"parameters": {
"color": 3,
"width": 460,
"content": "### Destination Delete the day before yesterday\nWorkflows starting with YYYY-MM-DD_"
},
"typeVersion": 1
},
{
"id": "b5ea5dad-7ff0-41d7-a718-9623d190e508",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
864,
368
],
"parameters": {
"color": 3,
"width": 220,
"content": "### Destination Select All"
},
"typeVersion": 1
},
{
"id": "2209cca8-310f-4313-bf3e-3218ffc3bb0a",
"name": "Nota adhesiva6",
"type": "n8n-nodes-base.stickyNote",
"position": [
368,
368
],
"parameters": {
"color": 7,
"width": 220,
"content": "### Substract From Date\nSubstract 2 (duration) for the day before yesterday so you have 2 days of online backup"
},
"typeVersion": 1
},
{
"id": "8c0eabb2-a286-4931-a821-3602581dc367",
"name": "Nota adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
624,
368
],
"parameters": {
"color": 7,
"width": 220,
"content": "### YYYY-MM-DD_\nSetup the custom format with yyyy-MM-dd_\n"
},
"typeVersion": 1
},
{
"id": "7b99a424-b2dd-463b-898d-8bd5e111f139",
"name": "Nota adhesiva8",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
752
],
"parameters": {
"color": 3,
"width": 220,
"content": "### Try with 1 first"
},
"typeVersion": 1
},
{
"id": "885d90ef-3972-4c7e-b8df-ee1ab29fae52",
"name": "Notion",
"type": "n8n-nodes-base.notion",
"position": [
1584,
672
],
"parameters": {
"pageId": {
"__rl": true,
"mode": "id",
"value": "1f9d79a8-067c-802a-8098-db9052f7a1db"
},
"options": {},
"resource": "databasePage",
"operation": "update",
"propertiesUi": {
"propertyValues": [
{
"key": "Value|rich_text",
"textContent": "={{ $('today_prefix').item.json.formattedDate }}"
},
{
"key": "Comment|rich_text",
"textContent": "={{ $items().length.toString() }}"
}
]
}
},
"credentials": {
"notionApi": {
"id": "okdwSk0xpZvGnYXW",
"name": "Notion account"
}
},
"executeOnce": true,
"typeVersion": 2.2
},
{
"id": "138a534c-a92b-40d9-b345-a6da7f3a6e05",
"name": "Notion1",
"type": "n8n-nodes-base.notion",
"position": [
1040,
144
],
"parameters": {
"pageId": {
"__rl": true,
"mode": "id",
"value": "1f9d79a8-067c-802a-8098-db9052f7a1db"
},
"resource": "databasePage",
"operation": "get"
},
"credentials": {
"notionApi": {
"id": "okdwSk0xpZvGnYXW",
"name": "Notion account"
}
},
"typeVersion": 2.2
},
{
"id": "b00a1e8f-c08c-40af-ac3d-717d9e38d28a",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
1264,
144
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "35c3f4b7-55a7-4d3f-aab9-0dca9f9ed795",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.property_value }}",
"rightValue": "={{ $('today_prefix').item.json.formattedDate }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "052b251c-4c30-46e0-bc90-4007e5d193f2",
"name": "backup_already_done",
"type": "n8n-nodes-base.noOp",
"position": [
1488,
48
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1f3a05e2-56ff-4745-aba6-6c29737ac635",
"name": "Nota adhesiva9",
"type": "n8n-nodes-base.stickyNote",
"position": [
768,
0
],
"parameters": {
"color": 7,
"width": 220,
"height": 320,
"content": "### YYYY-MM-DD_\nThis is the prefix added to workflow name"
},
"typeVersion": 1
},
{
"id": "bb0611c5-1de3-4306-a17e-27dfc670e052",
"name": "n8n_destination",
"type": "n8n-nodes-base.n8n",
"position": [
1648,
512
],
"parameters": {
"operation": "delete",
"workflowId": {
"__rl": true,
"mode": "id",
"value": "={{ $('GET - Destination Workflows').item.json.id }}"
},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "lz1TUJbuJ3ADZKs5",
"name": "render_n8n"
}
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"b00a1e8f-c08c-40af-ac3d-717d9e38d28a": {
"main": [
[
{
"node": "052b251c-4c30-46e0-bc90-4007e5d193f2",
"type": "main",
"index": 0
}
],
[
{
"node": "c6e31672-e3d2-4f31-8af4-b10099f131f6",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Limit": {
"main": [
[
{
"node": "655bb1aa-306e-4f18-8bde-0706684f5d5a",
"type": "main",
"index": 0
}
]
]
},
"bbc9d2a5-f6fd-4800-99e3-f448856e39bf": {
"main": [
[
{
"node": "ab21f9b5-21b4-432a-9fe3-eb28039c49a1",
"type": "main",
"index": 0
}
]
]
},
"Filter": {
"main": [
[
{
"node": "bb0611c5-1de3-4306-a17e-27dfc670e052",
"type": "main",
"index": 0
}
]
]
},
"138a534c-a92b-40d9-b345-a6da7f3a6e05": {
"main": [
[
{
"node": "b00a1e8f-c08c-40af-ac3d-717d9e38d28a",
"type": "main",
"index": 0
}
]
]
},
"c6e31672-e3d2-4f31-8af4-b10099f131f6": {
"main": [
[
{
"node": "9720d3b9-244d-4a44-9ebe-f4f80e14c7dd",
"type": "main",
"index": 0
},
{
"node": "d67fc8d4-42b0-4183-a64b-1ef550aaea71",
"type": "main",
"index": 0
}
]
]
},
"ab21f9b5-21b4-432a-9fe3-eb28039c49a1": {
"main": [
[
{
"node": "138a534c-a92b-40d9-b345-a6da7f3a6e05",
"type": "main",
"index": 0
}
]
]
},
"d67fc8d4-42b0-4183-a64b-1ef550aaea71": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "885d90ef-3972-4c7e-b8df-ee1ab29fae52",
"type": "main",
"index": 0
}
],
[
{
"node": "3c90ef38-0341-4493-80f1-d85f112dbe9f",
"type": "main",
"index": 0
}
]
]
},
"bb0611c5-1de3-4306-a17e-27dfc670e052": {
"main": [
[]
]
},
"9720d3b9-244d-4a44-9ebe-f4f80e14c7dd": {
"main": [
[
{
"node": "ed59a2e4-c489-4359-bbf4-89dfc88424d9",
"type": "main",
"index": 0
}
]
]
},
"3c90ef38-0341-4493-80f1-d85f112dbe9f": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"655bb1aa-306e-4f18-8bde-0706684f5d5a": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"4e302ca7-31d4-47d9-a5f0-df4997b9dd5b": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"ed59a2e4-c489-4359-bbf4-89dfc88424d9": {
"main": [
[
{
"node": "4e302ca7-31d4-47d9-a5f0-df4997b9dd5b",
"type": "main",
"index": 0
}
]
]
},
"0fe79c1a-bdb9-41d5-8306-dcff0e5eff64": {
"main": [
[
{
"node": "bbc9d2a5-f6fd-4800-99e3-f448856e39bf",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Avanzado - DevOps
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Compartir este flujo de trabajo