937 lines
28 KiB
JSON
937 lines
28 KiB
JSON
{
|
||
"name": "Docker Event (Extended)",
|
||
"nodes": [
|
||
{
|
||
"parameters": {
|
||
"httpMethod": "POST",
|
||
"path": "docker-event",
|
||
"responseMode": "responseNode",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.webhook",
|
||
"typeVersion": 2.1,
|
||
"position": [
|
||
0,
|
||
-224
|
||
],
|
||
"id": "870fa550-42f6-4e19-a796-f1f044b0cdc8",
|
||
"name": "Webhook",
|
||
"webhookId": "e147d70b-79d8-44fd-bbe8-8274cf905b11",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const data = $input.first().json;\n\nconst container = data.container ?? data.body?.container ?? '';\nconst image = data.image ?? data.body?.image ?? '';\nconst timestamp = data.timestamp ?? data.body?.timestamp ?? '';\n\nconst slug = container.toLowerCase().replace(/[^a-z0-9]+/g, '-');\n\nconst serviceName = container.replace(/[-_]/g, ' ');\n\nreturn [{\n json: {\n container,\n image,\n serviceName,\n timestamp,\n slug \n }\n}];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
224,
|
||
-224
|
||
],
|
||
"id": "aaa6a678-1ad3-4f82-9b01-37e21b47b189",
|
||
"name": "Kontext aufbereiten",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": "",
|
||
"typeValidation": "loose",
|
||
"version": 3
|
||
},
|
||
"conditions": [
|
||
{
|
||
"id": "ebe26f0c-d5a7-45c9-9747-afc75b57a41c",
|
||
"leftValue": "={{ $json.data }}",
|
||
"rightValue": "[]",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "notEndsWith"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"looseTypeValidation": true,
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 2.3,
|
||
"position": [
|
||
672,
|
||
-224
|
||
],
|
||
"id": "62197a33-5169-48e1-9539-57c047efb108",
|
||
"name": "If",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"url": "=https://cms.dk0.dev/items/projects?filter[slug][_eq]={{ $json.slug }}&limit=1",
|
||
"authentication": "predefinedCredentialType",
|
||
"nodeCredentialType": "httpBearerAuth",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.4,
|
||
"position": [
|
||
448,
|
||
-224
|
||
],
|
||
"id": "db783886-06b5-4473-8907-dd6c655aa3dd",
|
||
"name": "Search for Slug",
|
||
"credentials": {
|
||
"httpBearerAuth": {
|
||
"id": "ZtI5e08iryR9m6FG",
|
||
"name": "Directus"
|
||
}
|
||
},
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"model": "openrouter/free",
|
||
"options": {}
|
||
},
|
||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
976,
|
||
16
|
||
],
|
||
"id": "b9130ff4-359b-4736-9442-1b0ca7d31877",
|
||
"name": "OpenRouter Chat Model",
|
||
"credentials": {
|
||
"openRouterApi": {
|
||
"id": "8Kdy4RHHwMZ0Cn6x",
|
||
"name": "OpenRouter"
|
||
}
|
||
},
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"promptType": "define",
|
||
"text": "= Du bist ein technischer Autor für das Self-Hosting Portfolio von Dennis auf dk0.dev.\n Ein neuer Service wurde auf dem Server deployed:\n \n Container: {{ $('Kontext aufbereiten').item.json.container }}\n Image: {{ $('Kontext aufbereiten').item.json.image }}\n Service: {{ $('Kontext aufbereiten').item.json.serviceName }}\n \n Aufgabe:\n 1. Erkenne ob es sich um ein EIGENES Projekt (z.B. Image enthält \"denshooter\", \"dk0\", \"portfolio\") oder eine \nSELF-HOSTED App handelt.\n 2. Bewerte die \"Coolness\" (1-10) basierend auf:\n - Eigener Code = +3 Punkte\n - Neue/spannende Technologie = +2 Punkte\n - Großes/bekanntes Projekt (Suricata, CrowdStrike-Level) = +3 Punkte\n - Standard Self-Hosted Tool (Nextcloud, Plausible) = +1 Punkt\n - CI/CD Build-Container, Test-Runner = 0 Punkte (ignorieren)\n 3. Erstelle Beschreibung NUR wenn coolness_score >= 6\n \n Antworte NUR als valides JSON:\n {\n \"coolness_score\": 1-10,\n \"notify\": true/false (true wenn >= 7),\n \"reason\": \"Kurze Begründung warum cool oder nicht\",\n \"type\": \"own\" oder \"selfhosted\" oder \"ignore\",\n \"title_en\": \"...\",\n \"title_de\": \"...\",\n \"description_en\": \"...\",\n \"description_de\": \"...\",\n \"content_en\": \"...\",\n \"content_de\": \"...\",\n \"category\": \"selfhosted\" oder \"webdev\" oder \"automation\",\n \"technologies\": [\"Docker\", \"...\"]\n }",
|
||
"batching": {},
|
||
"prompt": "\n Verwende keine Bindestriche, Em-Dashes oder Gedankenstriche (–, —, -)."
|
||
},
|
||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||
"typeVersion": 1.9,
|
||
"position": [
|
||
896,
|
||
-224
|
||
],
|
||
"id": "77d46075-3342-4e93-8806-07087a2389dc",
|
||
"name": "Basic LLM Chain",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const raw = $input.first().json.text ?? \"\";\n\nconst match = raw.match(/\\{[\\s\\S]*\\}/);\nif (!match) throw new Error(\"No JSON found\");\n\nconst ai = JSON.parse(match[0]);\n\nreturn [\n {\n json: ai,\n },\n];\n"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
1248,
|
||
-224
|
||
],
|
||
"id": "de5ed311-0d46-4677-963c-711a6ad514e9",
|
||
"name": "Parse JSON",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const ai = $('Parse JSON').first().json;\n const ctx = $('Kontext aufbereiten').first().json;\n\n const body = {\n slug: ctx.slug,\n status: \"draft\",\n featured: false,\n title: ai.title_en,\n category: ai.category,\n technologies: ai.technologies,\n tags: ai.technologies,\n date: new Date().toISOString().slice(0, 10),\n translations: {\n create: [\n {\n languages_code: \"en-US\",\n title: ai.title_en,\n description: ai.description_en,\n content: ai.content_en\n },\n {\n languages_code: \"de-DE\",\n title: ai.title_de,\n description: ai.description_de,\n content: ai.content_de\n }\n ]\n }\n };\n\n const response = await this.helpers.httpRequest({\n method: \"POST\",\n url: \"https://cms.dk0.dev/items/projects\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer RF2QytqhcLXuVy6FO3PzWlsoR-ysCTwB\"\n },\n body\n });\n\n return [{ json: response }];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
1680,
|
||
-224
|
||
],
|
||
"id": "c47b915d-e4d7-43e9-8ee3-b41389896fa7",
|
||
"name": "Add to Directus",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"respondWith": "json",
|
||
"responseBody": "{ \"success\": true }",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.respondToWebhook",
|
||
"typeVersion": 1.5,
|
||
"position": [
|
||
2128,
|
||
-224
|
||
],
|
||
"id": "6cf8f30d-1352-466f-9163-9b4f16b972e0",
|
||
"name": "Respond to Webhook",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "145931600",
|
||
"text": "={{ \n'🆕 Neuer Service erkannt!\\n\\n' +\n'📦 ' + $('Kontext aufbereiten').first().json.container + '\\n' +\n'🐳 ' + $('Kontext aufbereiten').first().json.image + '\\n\\n' +\n'📝 ' + $('Parse JSON').first().json.title_de + '\\n' + \n$('Parse JSON').first().json.description_de + '\\n\\n' +\n'Status: Draft in Directus erstellt (ID: ' + $json.data.id + ')\\n\\n' +\n('/publishproject_' + $json.data.id).replace(/_/g, '\\\\_') + ' — Veröffentlichen\\n' + \n('/deleteproject_' + $json.data.id).replace(/_/g, '\\\\_') + ' — Löschen' \n}}",
|
||
"additionalFields": {}
|
||
},
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1.2,
|
||
"position": [
|
||
1904,
|
||
-224
|
||
],
|
||
"id": "b29de3ec-b1ca-40c3-8493-af44e5372fd2",
|
||
"name": "Send a text message",
|
||
"webhookId": "c02ccf69-16dc-436e-b1cc-f8fa9dd8d33f",
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "ADurvy9EKUDzbDdq",
|
||
"name": "DK0_Server"
|
||
}
|
||
},
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"rules": {
|
||
"values": [
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": "",
|
||
"typeValidation": "strict",
|
||
"version": 3
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $json.notify }}",
|
||
"rightValue": "true",
|
||
"operator": {
|
||
"type": "boolean",
|
||
"operation": "true",
|
||
"singleValue": true
|
||
},
|
||
"id": "febc397c-b060-4a66-ab9b-1274c8509cc2"
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.switch",
|
||
"typeVersion": 3.4,
|
||
"position": [
|
||
1456,
|
||
-224
|
||
],
|
||
"id": "5ade115f-e134-4358-8d95-a144eede8d9a",
|
||
"name": "Switch",
|
||
"disabled": true
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const data = $input.first().json;\n\nconst container = data.container ?? data.body?.container ?? '';\nconst image = data.image ?? data.body?.image ?? '';\nconst timestamp = data.timestamp ?? data.body?.timestamp ?? '';\n\nconst slug = container.toLowerCase().replace(/[^a-z0-9]+/g, '-');\nconst serviceName = container.replace(/[-_]/g, ' ');\n\n// Detect project type\nlet projectType = 'selfhosted';\nif (image.includes('denshooter') || image.includes('dk0')) {\n projectType = 'own';\n} else if (container.match(/^(act-|gitea-actions-|runner-)/)) {\n projectType = 'cicd';\n}\n\n// Extract repo from image for own projects\nlet repo = null;\nif (projectType === 'own') {\n const match = image.match(/([^/]+):(\\w+)/);\n if (match) repo = match[1];\n}\n\nreturn [{\n json: {\n container,\n image,\n serviceName,\n timestamp,\n slug,\n projectType,\n repo\n }\n}];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
896,
|
||
768
|
||
],
|
||
"id": "fb34f047-5c11-4255-9b45-adb9fe169042",
|
||
"name": "Parse Context"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"url": "=https://cms.dk0.dev/items/projects?filter[slug][_eq]={{ $json.slug }}&limit=1",
|
||
"authentication": "predefinedCredentialType",
|
||
"nodeCredentialType": "httpBearerAuth",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.4,
|
||
"position": [
|
||
1120,
|
||
768
|
||
],
|
||
"id": "acd7a411-2465-4aa3-a7ee-442a79c500f2",
|
||
"name": "Check if Exists",
|
||
"credentials": {
|
||
"httpBearerAuth": {
|
||
"id": "ZtI5e08iryR9m6FG",
|
||
"name": "Directus"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": "",
|
||
"typeValidation": "loose"
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $json.data.length }}",
|
||
"rightValue": "0",
|
||
"operator": {
|
||
"type": "number",
|
||
"operation": "equals"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 2.3,
|
||
"position": [
|
||
1344,
|
||
768
|
||
],
|
||
"id": "bdcddb94-8676-4467-a370-ad2cf07d09a3",
|
||
"name": "If New"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"rules": {
|
||
"values": [
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": ""
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $('Parse Context').item.json.projectType }}",
|
||
"rightValue": "own",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "equals"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"renameOutput": true,
|
||
"outputKey": "Own Project"
|
||
},
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": ""
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $('Parse Context').item.json.projectType }}",
|
||
"rightValue": "cicd",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "equals"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"renameOutput": true,
|
||
"outputKey": "CI/CD (Ignore)"
|
||
},
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": ""
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $('Parse Context').item.json.projectType }}",
|
||
"rightValue": "selfhosted",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "equals"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"renameOutput": true,
|
||
"outputKey": "Self-Hosted"
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.switch",
|
||
"typeVersion": 3.2,
|
||
"position": [
|
||
1568,
|
||
768
|
||
],
|
||
"id": "00786826-8d6b-4e17-aa7f-1afdca38d7a3",
|
||
"name": "Switch Type"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"url": "=https://git.dk0.dev/api/v1/repos/denshooter/{{ $('Parse Context').item.json.repo }}/commits?limit=1",
|
||
"authentication": "genericCredentialType",
|
||
"genericAuthType": "httpHeaderAuth",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.4,
|
||
"position": [
|
||
1776,
|
||
560
|
||
],
|
||
"id": "9ef7f66b-3054-4765-b0a8-7ebb6aa353aa",
|
||
"name": "Get Last Commit",
|
||
"credentials": {
|
||
"httpHeaderAuth": {
|
||
"id": "YN3oIbok6Fjy5WNW",
|
||
"name": "gitea api"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"url": "=https://git.dk0.dev/api/v1/repos/denshooter/{{ $('Parse Context').item.json.repo }}/contents/README.md",
|
||
"authentication": "genericCredentialType",
|
||
"genericAuthType": "httpHeaderAuth",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.4,
|
||
"position": [
|
||
1840,
|
||
672
|
||
],
|
||
"id": "114fece9-c5f1-4c6b-8272-6f39fb8ce24a",
|
||
"name": "Get README",
|
||
"credentials": {
|
||
"httpHeaderAuth": {
|
||
"id": "YN3oIbok6Fjy5WNW",
|
||
"name": "gitea api"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const ctx = $('Parse Context').first().json;\nconst commit = $('Get Last Commit').first().json[0];\nconst readme = $('Get README').first().json;\n\n// Decode README (base64)\nlet readmeText = '';\ntry {\n readmeText = Buffer.from(readme.content, 'base64').toString('utf8');\n // First 500 chars\n readmeText = readmeText.substring(0, 500).replace(/\\n/g, ' ');\n} catch (e) {\n readmeText = 'No README available';\n}\n\nconst commitMsg = commit?.commit?.message || 'No recent commits';\nconst commitAuthor = commit?.commit?.author?.name || 'Unknown';\n\nreturn [{\n json: {\n container: ctx.container,\n image: ctx.image,\n slug: ctx.slug,\n repo: ctx.repo,\n commitMsg,\n commitAuthor,\n readmeExcerpt: readmeText\n }\n}];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
2192,
|
||
480
|
||
],
|
||
"id": "8810426d-c146-42c9-8ec2-5d8f56934a1f",
|
||
"name": "Merge Git Data"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "145931600",
|
||
"text": "={{ \n'🚀 Neuer Deploy: ' + $json.container + '\\n' +\n'📦 ' + $json.image + '\\n\\n' +\n'📝 Letzter Commit:\\n' + $json.commitMsg + '\\n' +\n'👤 ' + $json.commitAuthor + '\\n\\n' +\n'📄 README:\\n' + $json.readmeExcerpt + '...\\n\\n' +\n'Was ist das Highlight?' \n}}",
|
||
"replyMarkup": "inlineKeyboard",
|
||
"inlineKeyboard": {
|
||
"rows": [
|
||
{
|
||
"row": {
|
||
"buttons": [
|
||
{
|
||
"text": "Selbst beschreiben",
|
||
"additionalFields": {
|
||
"callback_data": "={{ 'manual:' + $json.slug }}"
|
||
}
|
||
},
|
||
{
|
||
"text": "Auto-generieren",
|
||
"additionalFields": {
|
||
"callback_data": "={{ 'ignore:' + $json.slug }}"
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"additionalFields": {}
|
||
},
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1.2,
|
||
"position": [
|
||
2544,
|
||
592
|
||
],
|
||
"id": "d4016ea3-7233-4926-af21-c7b07cc5f39d",
|
||
"name": "Ask via Telegram",
|
||
"webhookId": "313376d7-33a6-4c80-938b-e8ebc7ee2d11",
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "ADurvy9EKUDzbDdq",
|
||
"name": "DK0_Server"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"promptType": "define",
|
||
"text": "=Du bist ein technischer Autor für dk0.dev.\n\nNeuer Self-Hosted Service:\nContainer: {{ $('Parse Context').item.json.container }}\nImage: {{ $('Parse Context').item.json.image }}\n\nErstelle eine Portfolio-Beschreibung:\n- Was macht die App\n- Warum Self-Hosting besser ist als Cloud\n- Wie sie in die Infrastruktur integriert ist\n\nAntworte NUR als JSON:\n{\n \"title_en\": \"Titel\",\n \"title_de\": \"Titel\",\n \"description_en\": \"4-6 Sätze\",\n \"description_de\": \"4-6 Sätze\",\n \"content_en\": \"2-3 Absätze Markdown\",\n \"content_de\": \"2-3 Absätze Markdown\",\n \"category\": \"selfhosted\",\n \"technologies\": [\"Docker\", \"...\"]\n}",
|
||
"batching": {},
|
||
"prompt": "\n Verwende keine Bindestriche, Em-Dashes oder Gedankenstriche (–, —, -)."
|
||
},
|
||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||
"typeVersion": 1.9,
|
||
"position": [
|
||
1952,
|
||
864
|
||
],
|
||
"id": "0fd46a9d-40a9-4bb7-be5e-9b32b9a96381",
|
||
"name": "AI: Self-Hosted"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "145931600",
|
||
"text": "={{ \n'🆕 Self-Hosted Service: ' + $('Parse Context').first().json.serviceName + '\\n\\n' +\n'📝 ' + $json.data.title + '\\n\\n' +\n'Status: Draft erstellt (ID: ' + $json.data.id + ')\\n\\n' +\n'/publishproject' + $json.data.id + ' — Veröffentlichen\\n' + \n'/deleteproject' + $json.data.id + ' — Löschen' \n}}",
|
||
"additionalFields": {}
|
||
},
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1.2,
|
||
"position": [
|
||
2656,
|
||
848
|
||
],
|
||
"id": "bfaca06b-65ca-41a8-ba8a-1b1aef7ba12d",
|
||
"name": "Notify Selfhosted",
|
||
"webhookId": "a7d15c96-41e1-4242-9b5f-0382f4f0d31a",
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "ADurvy9EKUDzbDdq",
|
||
"name": "DK0_Server"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"respondWith": "json",
|
||
"responseBody": "{ \"success\": true, \"message\": \"CI/CD container ignored\" }",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.respondToWebhook",
|
||
"typeVersion": 1.5,
|
||
"position": [
|
||
1776,
|
||
960
|
||
],
|
||
"id": "d93818d9-64f9-4f57-ae84-c4280eeb50f0",
|
||
"name": "Respond (Ignore)"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"respondWith": "json",
|
||
"responseBody": "{ \"success\": true }",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.respondToWebhook",
|
||
"typeVersion": 1.5,
|
||
"position": [
|
||
2880,
|
||
768
|
||
],
|
||
"id": "4f1ad083-e73a-497c-a724-673205254b34",
|
||
"name": "Respond"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"respondWith": "json",
|
||
"responseBody": "{ \"success\": true, \"message\": \"Project already exists\" }",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.respondToWebhook",
|
||
"typeVersion": 1.5,
|
||
"position": [
|
||
1568,
|
||
960
|
||
],
|
||
"id": "0b93b3c7-c158-4389-af18-b418aa3b2239",
|
||
"name": "Respond (Exists)"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"httpMethod": "POST",
|
||
"path": "docker-event",
|
||
"responseMode": "responseNode",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.webhook",
|
||
"typeVersion": 2.1,
|
||
"position": [
|
||
688,
|
||
768
|
||
],
|
||
"id": "2b1c77d4-9f7f-4758-9e8e-f88195448ba3",
|
||
"name": "Webhook1",
|
||
"webhookId": "25d94042-2088-4e09-bfae-645db3d6803f"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"model": "openrouter/free",
|
||
"options": {}
|
||
},
|
||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1968,
|
||
1072
|
||
],
|
||
"id": "a450227f-f1e5-44f3-a90e-044420042fc4",
|
||
"name": "OpenRouter Chat Model1",
|
||
"credentials": {
|
||
"openRouterApi": {
|
||
"id": "8Kdy4RHHwMZ0Cn6x",
|
||
"name": "OpenRouter"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const raw = $input.first().json.text ?? \"\";\nconst match = raw.match(/\\{[\\s\\S]*\\}/);\nif (!match) throw new Error(\"No JSON found\");\nconst ai = JSON.parse(match[0]);\nreturn [{ json: ai }];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
2224,
|
||
848
|
||
],
|
||
"id": "ca78ecdd-5520-4540-969b-9e7b77bac3b4",
|
||
"name": "Parse JSON1"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "const ai = $input.first().json;\nconst ctx = $('Parse Context').first().json;\n\nconst body = {\n slug: ctx.slug,\n status: \"draft\",\n featured: false,\n title: ai.title_en,\n category: ai.category,\n technologies: ai.technologies,\n tags: ai.technologies,\n date: new Date().toISOString().slice(0, 10),\n translations: {\n create: [\n {\n languages_code: \"en-US\",\n title: ai.title_en,\n description: ai.description_en,\n content: ai.content_en\n },\n {\n languages_code: \"de-DE\",\n title: ai.title_de,\n description: ai.description_de,\n content: ai.content_de\n }\n ]\n }\n};\n\nconst response = await this.helpers.httpRequest({\n method: \"POST\",\n url: \"https://cms.dk0.dev/items/projects\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer RF2QytqhcLXuVy6FO3PzWlsoR-ysCTwB\"\n },\n body\n});\n\nreturn [{ json: response }];"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
2448,
|
||
848
|
||
],
|
||
"id": "1ac0a31c-68a1-44df-a6b3-203698318cbf",
|
||
"name": "Add to Directus1"
|
||
}
|
||
],
|
||
"pinData": {},
|
||
"connections": {
|
||
"Webhook": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Kontext aufbereiten",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Kontext aufbereiten": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Search for Slug",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"If": {
|
||
"main": [
|
||
[],
|
||
[
|
||
{
|
||
"node": "Basic LLM Chain",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Search for Slug": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "If",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"OpenRouter Chat Model": {
|
||
"ai_languageModel": [
|
||
[
|
||
{
|
||
"node": "Basic LLM Chain",
|
||
"type": "ai_languageModel",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Basic LLM Chain": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Parse JSON",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Parse JSON": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Switch",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Add to Directus": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Send a text message",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Send a text message": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Respond to Webhook",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Switch": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Add to Directus",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Parse Context": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Check if Exists",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Check if Exists": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "If New",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"If New": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Switch Type",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"node": "Respond (Exists)",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Switch Type": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Get Last Commit",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"node": "Respond (Ignore)",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"node": "AI: Self-Hosted",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Get Last Commit": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Get README",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Get README": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge Git Data",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Merge Git Data": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Ask via Telegram",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Ask via Telegram": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Respond",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"AI: Self-Hosted": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Parse JSON1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Notify Selfhosted": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Respond",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Webhook1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Parse Context",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"OpenRouter Chat Model1": {
|
||
"ai_languageModel": [
|
||
[
|
||
{
|
||
"node": "AI: Self-Hosted",
|
||
"type": "ai_languageModel",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Parse JSON1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Add to Directus1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Add to Directus1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Notify Selfhosted",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
}
|
||
},
|
||
"active": true,
|
||
"settings": {
|
||
"executionOrder": "v1",
|
||
"binaryMode": "separate",
|
||
"availableInMCP": false
|
||
},
|
||
"versionId": "1e2cf0ca-fe15-4a10-9716-30f85a2c2531",
|
||
"meta": {
|
||
"templateCredsSetupCompleted": true,
|
||
"instanceId": "cb28e4db755465d5826da179e87f69603d81f833414cc52c327be9183a217b8d"
|
||
},
|
||
"id": "RARR6MAlJSHAmBp8",
|
||
"tags": []
|
||
} |