AutomationFlowsAI & RAG › Cto Agent - Lume's Everywhere (fixed)

Cto Agent - Lume's Everywhere (fixed)

CTO Agent - Lume's Everywhere (FIXED). Uses toolThink, httpRequestTool, lmChatOpenAi, memoryMongoDbChat. Event-driven trigger; 18 nodes.

Event trigger★★★★☆ complexityAI-powered18 nodesTool ThinkHTTP Request ToolOpenAI ChatMemory Mongo Db ChatTool WorkflowAgentTelegram TriggerHTTP Request
AI & RAG Trigger: Event Nodes: 18 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "CTO Agent - Lume's Everywhere (FIXED)",
  "nodes": [
    {
      "parameters": {},
      "id": "14a86541-69ee-4ba0-8f46-51ed774a8dbb",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        128,
        672
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "toolDescription": "=Gunakan untuk membaca isi file di repository GitHub.\nInput: path file relatif (contoh: artifacts/pos-app/src/App.tsx)\nRepository: hamdallah24/pos-app branch Staging",
        "url": "=https://api.github.com/repos/hamdallah24/pos-app/contents/{{ $fromAI('path') }}?ref=Staging",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/vnd.github.v3.raw"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.4,
      "position": [
        256,
        672
      ],
      "id": "ac93a68d-d7c4-4930-bdfa-6f2f37a0bc85",
      "name": "github_read_file",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "toolDescription": "=Gunakan untuk melihat daftar file dan folder di repository GitHub.\nInput: path folder (contoh: artifacts/pos-app/src atau kosongkan untuk root)\nRepository: hamdallah24/pos-app branch Staging",
        "url": "=https://api.github.com/repos/hamdallah24/pos-app/contents/{{ $fromAI('path') }}?ref=Staging",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/vnd.github.v3+json"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.4,
      "position": [
        512,
        672
      ],
      "id": "bf7acaad-b94a-40e2-9f81-8f54444c48c2",
      "name": "github_list_directory",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "deepseek-v4-pro",
          "mode": "list",
          "cachedResultName": "DEEPSEEK-V4-PRO"
        },
        "options": {}
      },
      "id": "f091a7d8-4390-4093-9ba1-59eb49fb59b9",
      "name": "DeepSeek Chat Model (Pro)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        16,
        672
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.telegram_chat_id || $json.chat_id || '7218843690' }}",
        "collectionName": "Memory",
        "databaseName": "CLevelAgent",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryMongoDbChat",
      "typeVersion": 1.1,
      "position": [
        -128,
        672
      ],
      "id": "262894f2-1c3d-4a02-b745-650961f5b369",
      "name": "MongoDB Chat Memory",
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "description": "=Gunakan tool ini SETELAH kamu menganalisis masalah dan user sudah menyetujui proposal perubahan.\n\nWAJIB isi parameter:\n- user_message: instruksi teknis detail\n- repo_owner: selalu \"hamdallah24\"\n- repo_name: selalu \"pos-app\"\n- branch: selalu \"Staging\"\n- chat_id: ID Telegram user",
        "workflowId": {
          "__rl": true,
          "value": "86eCJ8nbprRs0CUW",
          "mode": "list",
          "cachedResultUrl": "/workflow/86eCJ8nbprRs0CUW",
          "cachedResultName": "Code Generator Stage 4"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "user_message": "={{ $json.user_message || $json.text }}",
            "repo_owner": "hamdallah24",
            "repo_name": "pos-app",
            "branch": "Staging",
            "chat_id": "={{ String($json.chat_id || '7218843690') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "user_message",
              "displayName": "user_message",
              "type": "string",
              "required": false
            },
            {
              "id": "repo_owner",
              "displayName": "repo_owner",
              "type": "string",
              "required": false
            },
            {
              "id": "repo_name",
              "displayName": "repo_name",
              "type": "string",
              "required": false
            },
            {
              "id": "branch",
              "displayName": "branch",
              "type": "string",
              "required": false
            },
            {
              "id": "chat_id",
              "displayName": "chat_id",
              "type": "string",
              "required": false
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        624,
        672
      ],
      "id": "bbf5cb76-df73-4b3e-bc98-2eb8da0dc5cf",
      "name": "Code Generator (Stage 4)"
    },
    {
      "parameters": {
        "description": "=Gunakan untuk mendelegasikan ke Sub-Agent spesialis. Pilih skill_file sesuai domain.\n\nSkill file: Securityskill.md | devopsskill.md | qaskill.md | softwarearchitectskill.md\n\nWAJIB isi: skill_file, task_description (teknis & jelas)\n\nParameter otomatis: repo_owner=hamdallah24, repo_name=pos-app, branch=Staging",
        "workflowId": {
          "__rl": true,
          "value": "RV5wbuCzWhbGS3Nf",
          "mode": "list",
          "cachedResultUrl": "/workflow/RV5wbuCzWhbGS3Nf",
          "cachedResultName": "Dynamic Specialist"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "repo_owner": "hamdallah24",
            "repo_name": "pos-app",
            "branch": "Staging",
            "telegram_chat_id": "={{ String($json.chat_id || '7218843690') }}",
            "task_description": "={{ $json.task_description }}",
            "skill_file": "={{ $json.skill_file || 'softwarearchitectskill.md' }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "skill_file",
              "displayName": "skill_file",
              "type": "string",
              "required": false
            },
            {
              "id": "task_description",
              "displayName": "task_description",
              "type": "string",
              "required": false
            },
            {
              "id": "repo_owner",
              "displayName": "repo_owner",
              "type": "string",
              "required": false
            },
            {
              "id": "repo_name",
              "displayName": "repo_name",
              "type": "string",
              "required": false
            },
            {
              "id": "branch",
              "displayName": "branch",
              "type": "string",
              "required": false
            },
            {
              "id": "telegram_chat_id",
              "displayName": "telegram_chat_id",
              "type": "string",
              "required": false
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        384,
        672
      ],
      "id": "b652bffb-eae1-4844-948f-6e817dce4ba7",
      "name": "Dynamic Specialist"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.text || $json.chatInput || 'Tidak ada pesan' }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "Anda adalah CTO Agent untuk POS App Lume's Everywhere \u2014 Stack: React+Vite+Tailwind, Express+Drizzle+PostgreSQL (Neon), PM2+Nginx di Ubuntu 22.04 VPS.\n\nPERAN\nAnda TIDAK menulis kode. Tugas Anda: pahami permintaan \u2192 delegasikan ke tool yang tepat \u2192 evaluasi hasil \u2192 minta persetujuan user untuk aksi destruktif.\n\n\u26a0\ufe0f GUARDLINE \u2014 WAJIB DIPATUHI (priority di atas segalanya)\n1. Untuk commit/deploy/delete: WAJIB berikan analisis + daftar file yang akan diubah + alasan. Akhiri dengan: \"Lanjutkan commit? Balas: SETUJU / TIDAK SETUJU\"\n2. JANGAN PERNAH commit atau deploy tanpa kata SETUJU dari user.\n3. Jika user TIDAK SETUJU, berhenti dan tawarkan revisi.\n\nROUTING\n- Baca file (contoh: \"baca package.json\") \u2192 gunakan github_read_file\n- Lihat struktur folder \u2192 github_list_directory\n- Analisis teknis \u2192 Dynamic Specialist (pilih skill_file yang relevan)\n- Setelah user SETUJU \u2192 Code Generator\n\nBAHASA\nIndonesia, ringkas, profesional. Maks 3000 karakter.\n\nPEMILIHAN SKILL\n- Security \u2192 Securityskill.md\n- DevOps/deploy/server \u2192 devopsskill.md\n- QA/testing/bug \u2192 qaskill.md\n- Fitur/refactor/arsitektur \u2192 softwarearchitectskill.md",
          "maxIterations": 3
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        176,
        400
      ],
      "id": "b5dbd6c3-416d-4161-8793-58cea17fd04d",
      "name": "CTO_Agent",
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.3,
      "position": [
        -400,
        384
      ],
      "id": "dc9f79eb-64ab-43da-8008-5e1a5fd059e4",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://n8n-duatuonaiw0g.jkt6.sumopod.my.id/webhook/logger-v1",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "chat_id",
              "value": "={{ $json.message.chat.id }}"
            },
            {
              "name": "level",
              "value": "SUCCESS"
            },
            {
              "name": "agent",
              "value": "CTO"
            },
            {
              "name": "message",
              "value": "={{ '\u2705 Selesai. ' + ($json.output || '').substring(0, 200) }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        496,
        400
      ],
      "id": "55295c23-edb5-4c5c-847b-2c8c0a5fc0ff",
      "name": "Log success"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://n8n-duatuonaiw0g.jkt6.sumopod.my.id/webhook/logger-v1",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "chat_id",
              "value": "={{ $json.chat_id }}"
            },
            {
              "name": "level",
              "value": "={{ $json.level }}"
            },
            {
              "name": "agent",
              "value": "={{ $json.agent }}"
            },
            {
              "name": "message",
              "value": "={{ $json.message }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -128,
        384
      ],
      "id": "b4854e93-4cc4-4a9b-941e-a08be242e6e3",
      "name": "INFO",
      "retryOnFail": false,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "jsCode": "const chatId = $json.message?.chat?.id || '7218843690';\nconst messageText = $json.message?.text || '';\n\nreturn [{\n  json: {\n    chat_id: chatId,\n    source: 'telegram',\n    level: 'INFO',\n    agent: 'CTO',\n    message: `\ud83d\udce5 Task diterima: ${messageText.substring(0, 100)}`,\n    text: messageText\n  }\n}];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -272,
        384
      ],
      "id": "8ed4091d-7a64-4d9f-8f1a-22dc893214f3",
      "name": "Parse Telegram Input"
    },
    {
      "parameters": {
        "chatId": "={{ $json.chat_id || $json.telegram_chat_id || '7218843690' }}",
        "text": "={{ $json.output || $json.message || JSON.stringify($json).substring(0, 3000) }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        640,
        400
      ],
      "id": "24e1c1cd-ffc6-48cd-8027-d6f821da90b7",
      "name": "Reply via Telegram",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "path": "cto-webhook",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "e7b3a2c1-5d4f-4a6b-8c9d-0e1f2a3b4c5d",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -400,
        500
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "27743678-5d6b-4c9a-bcf3-91a8e2f1c3d4",
              "leftValue": "={{ $json.message?.chat?.id ? true : false }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equal",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5e",
      "name": "IF Router: Source?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        -400,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const msg = $json.message || '';\nconst chatId = $json.chat_id || 'webhook';\nreturn [{ json: { chat_id: chatId, text: msg, source: 'webhook', level: 'INFO', agent: 'CTO', message: '\ud83d\udce5 Task via Webhook: ' + msg.substring(0, 100) } }];"
      },
      "id": "f1e2d3c4-b5a6-4c7d-8e9f-0a1b2c3d4e5f",
      "name": "Parse Webhook Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -272,
        500
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ reply: $json.output || $json.message || 'Tidak ada jawaban' }) }}"
      },
      "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c6a",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        640,
        500
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "3d4e5f6a-7b8c-4d9e-af0b-1c2d3e4f5a6b",
              "leftValue": "={{ $json.source || 'telegram' }}",
              "rightValue": "telegram",
              "operator": {
                "type": "string",
                "operation": "equal",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6b",
      "name": "IF Output: Source Telegram?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        496,
        500
      ]
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "github_read_file": {
      "ai_tool": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "github_list_directory": {
      "ai_tool": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model (Pro)": {
      "ai_languageModel": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Code Generator (Stage 4)": {
      "ai_tool": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Dynamic Specialist": {
      "ai_tool": [
        [
          {
            "node": "CTO_Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "CTO_Agent": {
      "main": [
        [
          {
            "node": "Log success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "IF Router: Source?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "IF Router: Source?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Router: Source?": {
      "main": [
        [
          {
            "node": "Parse Telegram Input",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Webhook Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log success": {
      "main": [
        [
          {
            "node": "IF Output: Source Telegram?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Output: Source Telegram?": {
      "main": [
        [
          {
            "node": "Reply via Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "INFO": {
      "main": [
        [
          {
            "node": "CTO_Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Telegram Input": {
      "main": [
        [
          {
            "node": "INFO",
            "type": "main",
            "index": 0
          },
          {
            "node": "CTO_Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Webhook Input": {
      "main": [
        [
          {
            "node": "INFO",
            "type": "main",
            "index": 0
          },
          {
            "node": "CTO_Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "v2-fixed-cto-agent",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "W4oIbAiNz2GUw6Mb",
  "tags": [
    {
      "name": "CTO",
      "color": "#1565FF"
    },
    {
      "name": "production",
      "color": "#00B341"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

CTO Agent - Lume's Everywhere (FIXED). Uses toolThink, httpRequestTool, lmChatOpenAi, memoryMongoDbChat. Event-driven trigger; 18 nodes.

Source: https://github.com/hamdallah24/lumespos/blob/43f21eda5eb83ddaff032aab1f3fd55e8f0255fc/n8n-workflows/1-CTO-Agent-fixed.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.

Telegram, Telegram Trigger, OpenAI Chat +8
AI & RAG

Bitlab-Chatbot. Uses telegramTrigger, telegram, snowflake, httpRequest. Event-driven trigger; 87 nodes.

Telegram Trigger, Telegram, Snowflake +13
AI & RAG

Personal Assistant. Uses memoryBufferWindow, agent, agentTool, httpRequestTool. Event-driven trigger; 77 nodes.

Memory Buffer Window, Agent, Agent Tool +15
AI & RAG

This template is designed for marketers, content creators, and e-commerce brands who want to automate the creation of professional ad videos at scale. It’s ideal for teams looking to generate consiste

Telegram, Telegram Trigger, Google Drive +8