Files
n8n-prueba/archivo.json
T
2026-06-03 21:21:49 +00:00

433 lines
11 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"$json": {
"updatedAt": "2026-06-03T21:21:47.575Z",
"createdAt": "2026-06-03T20:22:29.809Z",
"id": "nvV9JrJGy1AEZdYI",
"name": "Gitea n8n test",
"description": null,
"active": false,
"isArchived": false,
"nodes": [
{
"parameters": {
"operation": "get",
"workflowId": {
"__rl": true,
"value": "nvV9JrJGy1AEZdYI",
"mode": "list",
"cachedResultName": "Gitea n8n test (#nvV9JrJGy1AEZdYI)"
},
"requestOptions": {}
},
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [
-256,
-144
],
"id": "af9f2e9f-a19f-41d9-9871-c491419e4548",
"name": "Get a workflow",
"credentials": {
"n8nApi": {
"id": "73Ydc9X8h5HXvFrt",
"name": "Eidan - n8n account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3519ad4c-6d66-4963-ab76-ee5517d88d67",
"name": "repo_name",
"value": "n8n-prueba",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-160,
32
],
"id": "b6317eb2-986d-4973-b108-4d626bfc2c74",
"name": "Edit Fields1"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-320,
32
],
"id": "198926a6-c823-456d-be1e-35b7c31b3152",
"name": "When clicking Execute workflow"
},
{
"parameters": {
"url": "https://git.digitalcompass.agency/api/v1/users/EidanThen/repos",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "token f68f177ebd3d5795ffc09c1cd880c4007b063fd8"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
288,
-224
],
"id": "6bc3109a-056a-4b43-8c00-953009ca90c3",
"name": "Obtener repos"
},
{
"parameters": {
"method": "POST",
"url": "https://git.digitalcompass.agency/api/v1/repos/EidanThen/n8n-prueba/contents/archivo.json",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "token f68f177ebd3d5795ffc09c1cd880c4007b063fd8"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"message\": \"{{ $json.message }}\",\n \"content\": \"{{ $json.content }}\",\n \"branch\": \"{{ $json.branch }}\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
672,
160
],
"id": "095684ea-b184-4f2c-8f4d-c879c9879dbd",
"name": "Subir archivo",
"retryOnFail": false
},
{
"parameters": {
"jsCode": "const sha = $('Obtener archivo').first().json.sha;\nconst data = { $json };\n\nreturn [{\n json: {\n message: \"Update archivo.json\",\n content: Buffer.from(JSON.stringify(data, null, 2)).toString(\"base64\"),\n sha: sha,\n branch: \"main\"\n }\n}];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
672,
-48
],
"id": "70718bd0-b69a-4e24-8b99-9b8befdc7a7a",
"name": "Code in JavaScript"
},
{
"parameters": {
"jsCode": "const sha = $json.sha; // viene del GET anterior\nconst data = { $json };\n\nconst base64 = Buffer.from(JSON.stringify(data, null, 2)).toString(\"base64\");\n\nreturn [{\n json: {\n message: \"Update archivo.json\",\n content: base64,\n sha: sha,\n branch: \"main\"\n }\n}];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-80,
-144
],
"id": "dae8528c-ea17-4f09-8612-92c67879003c",
"name": "Code in JavaScript1"
},
{
"parameters": {
"url": "https://git.digitalcompass.agency/api/v1/repos/EidanThen/n8n-prueba/contents/archivo.json",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "token f68f177ebd3d5795ffc09c1cd880c4007b063fd8"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
96,
32
],
"id": "78024966-85c5-417d-939f-9d5df7e4d050",
"name": "Obtener archivo"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "117dc829-e363-46ac-8eaf-d7e453402efd",
"leftValue": "={{ $json.name }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
288,
32
],
"id": "927bc94a-1dfd-4d6f-8c58-dad1326aae82",
"name": "Existe archivo?"
},
{
"parameters": {
"method": "PUT",
"url": "https://git.digitalcompass.agency/api/v1/repos/EidanThen/n8n-prueba/contents/archivo.json",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "token f68f177ebd3d5795ffc09c1cd880c4007b063fd8"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"message\": \"{{ $json.message }}\",\n \"content\": \"{{ $json.content }}\",\n \"sha\": \"{{ $json.sha }}\",\n \"branch\": \"{{ $json.branch }}\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
848,
-48
],
"id": "27c22629-bdc8-4de5-a2b7-6b155b8f44dc",
"name": "Actualizar archivo"
},
{
"parameters": {
"operation": "get",
"workflowId": {
"__rl": true,
"value": "nvV9JrJGy1AEZdYI",
"mode": "list",
"cachedResultName": "Gitea n8n test (#nvV9JrJGy1AEZdYI)"
},
"requestOptions": {}
},
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [
496,
-48
],
"id": "7c151d40-68d4-4021-910e-f7047f20725a",
"name": "Get a workflow1",
"credentials": {
"n8nApi": {
"id": "73Ydc9X8h5HXvFrt",
"name": "Eidan - n8n account"
}
}
},
{
"parameters": {
"operation": "get",
"workflowId": {
"__rl": true,
"value": "nvV9JrJGy1AEZdYI",
"mode": "list",
"cachedResultName": "Gitea n8n test (#nvV9JrJGy1AEZdYI)"
},
"requestOptions": {}
},
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [
496,
160
],
"id": "3b5ccdea-7d04-41a0-83bb-0d4907b11cc3",
"name": "Get a workflow2",
"credentials": {
"n8nApi": {
"id": "73Ydc9X8h5HXvFrt",
"name": "Eidan - n8n account"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
1056,
288
],
"id": "7f41d0ce-27c7-4cb0-bc31-953af91fc7ee",
"name": "AI Agent"
}
],
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Obtener archivo",
"type": "main",
"index": 0
}
]
]
},
"Get a workflow": {
"main": [
[]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Actualizar archivo",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript1": {
"main": [
[]
]
},
"Subir archivo": {
"main": [
[],
[]
]
},
"Obtener archivo": {
"main": [
[
{
"node": "Existe archivo?",
"type": "main",
"index": 0
}
]
]
},
"Existe archivo?": {
"main": [
[
{
"node": "Get a workflow1",
"type": "main",
"index": 0
}
],
[
{
"node": "Get a workflow2",
"type": "main",
"index": 0
}
]
]
},
"Get a workflow1": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"Get a workflow2": {
"main": [
[
{
"node": "Subir archivo",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
},
"staticData": null,
"meta": null,
"pinData": {},
"versionId": "44e6a6e9-adf8-4524-bf97-5238493af5be",
"activeVersionId": null,
"versionCounter": 155,
"triggerCount": 0,
"shared": [
{
"updatedAt": "2026-06-03T20:22:29.813Z",
"createdAt": "2026-06-03T20:22:29.813Z",
"role": "workflow:owner",
"workflowId": "nvV9JrJGy1AEZdYI",
"projectId": "0bH6HfYEL8n6SDmr",
"project": {
"updatedAt": "2026-04-22T14:25:04.701Z",
"createdAt": "2026-04-22T14:22:54.790Z",
"id": "0bH6HfYEL8n6SDmr",
"name": "Eidan Then <ethen@gomezleemarketing.com>",
"type": "personal",
"icon": null,
"description": null,
"creatorId": "de14e7e5-491b-4983-abb2-f88af42e92fd"
}
}
],
"tags": [],
"activeVersion": null
}
}