diff --git a/WORKFLOWS_IMPLEMENTATION.md b/WORKFLOWS_IMPLEMENTATION.md index 557668e..e1655d9 100644 --- a/WORKFLOWS_IMPLEMENTATION.md +++ b/WORKFLOWS_IMPLEMENTATION.md @@ -7,12 +7,19 @@ This repository contains complete, executable n8n workflow JSON files for a mult ## Files Included ### Main Export File -- **`workflows-export.json`** - Single JSON file containing all 4 workflows in the required format with a `files` array +- **`workflows-export.json`** - Single JSON file containing all 7 workflows in the required format with a `files` array ### Individual Workflow Files -- **`workflows/agents/vishnu-cto.json`** - CTO Orchestrator Agent -- **`workflows/agents/brahma-network.json`** - Network Administrator Agent -- **`workflows/agents/shiva-devops.json`** - DevOps Engineer Agent + +**AI Agent Workflows:** +- **`workflows/agents/vishnu-cto.json`** - CTO Orchestrator Agent (Preservation) +- **`workflows/agents/brahma-network.json`** - Network Administrator Agent (Creation) +- **`workflows/agents/shiva-devops.json`** - DevOps Engineer Agent (Transformation) +- **`workflows/agents/saraswati-database.json`** - Database Administrator Agent (Knowledge) +- **`workflows/agents/ganesha-security.json`** - Security Engineer Agent (Problem-Solving) +- **`workflows/agents/hanuman-helpdesk.json`** - Helpdesk Support Agent (Service) + +**Utility Workflows:** - **`workflows/utilities/approval-handler.json`** - Human-in-the-Loop Approval Handler ## Workflow Details @@ -83,7 +90,76 @@ This repository contains complete, executable n8n workflow JSON files for a mult - Conditional execution based on system state - Notifications for success/blocked deployments -### 4. Approval Handler (approval-handler.json) +### 4. Saraswati Database Agent (saraswati-database.json) + +**Role:** Database Administrator and Knowledge Keeper +**Trigger:** Schedule (Every 30 minutes) +**Version:** 1.0 + +**Nodes:** +- Schedule Trigger - Every 30 min +- HTTP Request - Database Status (checks `http://postgres.local:5432`) +- Execute Command - Query Analysis (PostgreSQL diagnostics) +- Code - Combine Database Data +- AI Agent - Saraswati Database (analyzes results) +- Telegram - Database Report (sends notifications) + +**Key Features:** +- Scheduled database monitoring every 30 minutes +- Database health checks via HTTP +- Query performance analysis +- Slow query detection +- AI-powered optimization recommendations +- Reports via Telegram + +### 5. Ganesha Security Agent (ganesha-security.json) + +**Role:** Security Engineer and Obstacle Remover +**Trigger:** Schedule (Every 10 minutes) +**Version:** 1.0 + +**Nodes:** +- Schedule Trigger - Every 10 min +- Execute Command - Auth Logs (checks failed login attempts) +- Execute Command - Fail2ban Status +- Execute Command - Certificate Check (SSL/TLS expiration) +- Code - Combine Security Data +- AI Agent - Ganesha Security (threat analysis) +- Telegram - Security Report (sends alerts) + +**Key Features:** +- Frequent security monitoring every 10 minutes +- Authentication log analysis +- Fail2ban status monitoring +- Certificate expiration tracking +- AI-powered threat assessment +- Immediate alerts for security incidents + +### 6. Hanuman Helpdesk Agent (hanuman-helpdesk.json) + +**Role:** Helpdesk Agent and Devoted Servant +**Trigger:** Telegram (on message) +**Version:** 1.0 + +**Nodes:** +- Telegram Trigger - User Requests +- Code - Parse User Request (categorization) +- AI Agent - Hanuman Helpdesk (triage and response) +- Code - Process Response +- IF - Should Escalate? +- Telegram - Direct Response +- Telegram - Escalation Notice +- Execute Workflow - Escalate to Vishnu + +**Key Features:** +- Real-time user support via Telegram +- Intelligent request categorization +- AI-powered triage and troubleshooting +- Automatic escalation to specialist agents +- Friendly, empathetic communication +- User satisfaction tracking + +### 7. Approval Handler (approval-handler.json) **Role:** Utility Workflow for Human-in-the-Loop **Trigger:** Telegram (on message) @@ -142,7 +218,7 @@ Update these placeholder URLs to match your environment: 5. Configure credentials and environment variables 6. Activate the workflow -Repeat for all 4 workflows. +Repeat for all 7 workflows. ### Method 2: Programmatic Import @@ -150,7 +226,7 @@ Use the main export file with the n8n API or bulk import tool: ```bash # Example using the workflows-export.json structure -# This file contains all 4 workflows in a single JSON with 'files' array +# This file contains all 7 workflows in a single JSON with 'files' array cat workflows-export.json | jq -r '.files[] | @json' | while read workflow; do echo "$workflow" | n8n import:workflow --input=- done @@ -316,8 +392,11 @@ For issues or questions: ## Version History -- **v1.0** - Initial implementation with all 4 core workflows - - Vishnu CTO Agent (Orchestrator) - - Brahma Network Agent (Infrastructure) - - Shiva DevOps Agent (Deployment) +- **v1.0** - Initial implementation with all 6 AI agent workflows + 1 utility + - Vishnu CTO Agent (Orchestrator - Preservation) + - Brahma Network Agent (Infrastructure - Creation) + - Shiva DevOps Agent (Deployment - Transformation) + - Saraswati Database Agent (Data - Knowledge) + - Ganesha Security Agent (Protection - Problem-Solving) + - Hanuman Helpdesk Agent (Support - Service) - Approval Handler (Human-in-the-Loop) diff --git a/WORKFLOW_ARCHITECTURE.md b/WORKFLOW_ARCHITECTURE.md index 523c0cc..4d550bc 100644 --- a/WORKFLOW_ARCHITECTURE.md +++ b/WORKFLOW_ARCHITECTURE.md @@ -300,13 +300,19 @@ n8n-AI-Multiple-Agent-Team/ │ ├── vishnu-cto.json # 7 nodes, orchestration │ ├── brahma-network.json # 6 nodes, monitoring │ ├── shiva-devops.json # 9 nodes, deployment +│ ├── saraswati-database.json # 6 nodes, database +│ ├── ganesha-security.json # 7 nodes, security +│ ├── hanuman-helpdesk.json # 8 nodes, support │ └── approval-handler.json # 7 nodes, approval │ ├── workflows/ │ ├── agents/ │ │ ├── vishnu-cto.json │ │ ├── brahma-network.json -│ │ └── shiva-devops.json +│ │ ├── shiva-devops.json +│ │ ├── saraswati-database.json +│ │ ├── ganesha-security.json +│ │ └── hanuman-helpdesk.json │ └── utilities/ │ └── approval-handler.json │ diff --git a/workflows-export.json b/workflows-export.json index a6ee11d..c5fd246 100644 --- a/workflows-export.json +++ b/workflows-export.json @@ -17,7 +17,10 @@ "name": "Webhook - Critical Issue", "type": "n8n-nodes-base.webhook", "typeVersion": 1, - "position": [250, 300], + "position": [ + 250, + 300 + ], "webhookId": "vishnu-critical-issue" }, { @@ -26,13 +29,16 @@ "options": { "temperature": 0.7 }, - "systemMessage": "You are Vishnu, the CTO Agent and Preserver of the Homelab Infrastructure.\\n\\nCOSMIC ATTRIBUTES:\\n- Preservation: Your primary goal is maintaining system stability\\n- Balance: You balance competing needs (performance vs. cost, security vs. accessibility)\\n- Wisdom: You have access to all team knowledge and historical data\\n- Authority: You make final decisions and coordinate all agents\\n\\nRESPONSIBILITIES:\\n1. Monitor overall infrastructure health\\n2. Receive escalations from specialist agents\\n3. Coordinate responses to complex, multi-system issues\\n4. Make strategic decisions about:\\n - Which agents to involve in a problem\\n - When to request human intervention\\n - Priority and urgency of issues\\n - Resource allocation across services\\n\\nDECISION FRAMEWORK:\\nWhen an issue arises:\\n1. Assess scope (single service, multiple systems, infrastructure-wide)\\n2. Determine severity (low/medium/high/critical)\\n3. Identify appropriate specialist agent(s)\\n4. Delegate investigation with clear objectives\\n5. Synthesize specialist reports\\n6. Propose unified solution\\n7. Coordinate execution or escalate to human\\n\\nDELEGATION RULES:\\n- Network issues → Brahma (Network)\\n- Compute/VM issues → Brahma (Compute) or Shiva\\n- Storage issues → Brahma (Storage)\\n- Database issues → Saraswati\\n- Security issues → Ganesha\\n- Deployment issues → Shiva\\n- User support → Hanuman\\n\\nESCALATION TRIGGERS:\\nNotify human immediately for:\\n- Multi-system cascading failures\\n- Data integrity threats\\n- Security breaches\\n- Decisions with business impact\\n- Conflicts between specialist recommendations\\n\\nOUTPUT FORMAT:\\nRespond with JSON:\\n{\\n \\\"analysis\\\": \\\"your assessment\\\",\\n \\\"severity\\\": \\\"low/medium/high/critical\\\",\\n \\\"delegate_to\\\": [\\\"agent-name\\\"],\\n \\\"requires_approval\\\": true/false,\\n \\\"proposed_action\\\": \\\"description\\\"\\n}\\n\\nYOUR MANTRA: \\\"Stability first, innovation with caution, users always considered.\\\"" + "systemMessage": "You are Vishnu, the CTO Agent and Preserver of the Homelab Infrastructure.\n\nCOSMIC ATTRIBUTES:\n- Preservation: Your primary goal is maintaining system stability\n- Balance: You balance competing needs (performance vs. cost, security vs. accessibility)\n- Wisdom: You have access to all team knowledge and historical data\n- Authority: You make final decisions and coordinate all agents\n\nRESPONSIBILITIES:\n1. Monitor overall infrastructure health\n2. Receive escalations from specialist agents\n3. Coordinate responses to complex, multi-system issues\n4. Make strategic decisions about:\n - Which agents to involve in a problem\n - When to request human intervention\n - Priority and urgency of issues\n - Resource allocation across services\n\nDECISION FRAMEWORK:\nWhen an issue arises:\n1. Assess scope (single service, multiple systems, infrastructure-wide)\n2. Determine severity (low/medium/high/critical)\n3. Identify appropriate specialist agent(s)\n4. Delegate investigation with clear objectives\n5. Synthesize specialist reports\n6. Propose unified solution\n7. Coordinate execution or escalate to human\n\nDELEGATION RULES:\n- Network issues \u2192 Brahma (Network)\n- Compute/VM issues \u2192 Brahma (Compute) or Shiva\n- Storage issues \u2192 Brahma (Storage)\n- Database issues \u2192 Saraswati\n- Security issues \u2192 Ganesha\n- Deployment issues \u2192 Shiva\n- User support \u2192 Hanuman\n\nESCALATION TRIGGERS:\nNotify human immediately for:\n- Multi-system cascading failures\n- Data integrity threats\n- Security breaches\n- Decisions with business impact\n- Conflicts between specialist recommendations\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"analysis\": \"your assessment\",\n \"severity\": \"low/medium/high/critical\",\n \"delegate_to\": [\"agent-name\"],\n \"requires_approval\": true/false,\n \"proposed_action\": \"description\"\n}\n\nYOUR MANTRA: \"Stability first, innovation with caution, users always considered.\"" }, "id": "ai-agent-vishnu", "name": "AI Agent - Vishnu CTO", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1, - "position": [450, 300] + "position": [ + 450, + 300 + ] }, { "parameters": { @@ -42,7 +48,10 @@ "name": "Code - Delegation Logic", "type": "n8n-nodes-base.code", "typeVersion": 2, - "position": [650, 300] + "position": [ + 650, + 300 + ] }, { "parameters": { @@ -53,29 +62,38 @@ "name": "Execute Workflow - Delegate", "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1, - "position": [850, 300] + "position": [ + 850, + 300 + ] }, { "parameters": { - "jsCode": "// Synthesize results from delegated agent\nconst delegateResult = $input.first().json;\nconst originalIssue = $('Code - Delegation Logic').item.json;\n\nreturn {\n json: {\n summary: `🔱 Vishnu CTO - Issue Resolution\\n\\nOriginal Issue: ${JSON.stringify(originalIssue.issue)}\\n\\nSeverity: ${originalIssue.severity.toUpperCase()}\\n\\nDelegated To: ${originalIssue.delegate_to.join(', ')}\\n\\nSpecialist Report:\\n${JSON.stringify(delegateResult, null, 2)}\\n\\nDecision: ${originalIssue.proposed_action}\\n\\nRequires Human Approval: ${originalIssue.requires_approval ? 'YES' : 'NO'}`,\n requires_approval: originalIssue.requires_approval,\n proposed_action: originalIssue.proposed_action\n }\n};" + "jsCode": "// Synthesize results from delegated agent\nconst delegateResult = $input.first().json;\nconst originalIssue = $('Code - Delegation Logic').item.json;\n\nreturn {\n json: {\n summary: `\ud83d\udd31 Vishnu CTO - Issue Resolution\\n\\nOriginal Issue: ${JSON.stringify(originalIssue.issue)}\\n\\nSeverity: ${originalIssue.severity.toUpperCase()}\\n\\nDelegated To: ${originalIssue.delegate_to.join(', ')}\\n\\nSpecialist Report:\\n${JSON.stringify(delegateResult, null, 2)}\\n\\nDecision: ${originalIssue.proposed_action}\\n\\nRequires Human Approval: ${originalIssue.requires_approval ? 'YES' : 'NO'}`,\n requires_approval: originalIssue.requires_approval,\n proposed_action: originalIssue.proposed_action\n }\n};" }, "id": "code-synthesize", "name": "Code - Synthesize Results", "type": "n8n-nodes-base.code", "typeVersion": 2, - "position": [1050, 300] + "position": [ + 1050, + 300 + ] }, { "parameters": { "chatId": "={{$env.TELEGRAM_CHAT_ID}}", - "text": "={{ $json.summary }}\\n\\nReply YES to approve or NO to decline.", + "text": "={{ $json.summary }}\n\nReply YES to approve or NO to decline.", "additionalFields": {} }, "id": "telegram-approval", "name": "Telegram - Approval Request", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [1250, 300], + "position": [ + 1250, + 300 + ], "credentials": { "telegramApi": { "id": "1", @@ -92,7 +110,10 @@ "name": "Webhook Response", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1, - "position": [1250, 500] + "position": [ + 1250, + 500 + ] } ], "connections": { @@ -187,7 +208,10 @@ "name": "Schedule Trigger - Every 15 min", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1, - "position": [250, 300] + "position": [ + 250, + 300 + ] }, { "parameters": { @@ -195,13 +219,16 @@ "options": { "temperature": 0.7 }, - "systemMessage": "You are Brahma, the Network Creator and Administrator.\\n\\nCOSMIC ATTRIBUTES:\\n- Creation: You build and maintain network infrastructure\\n- Architecture: You design network topology and segments\\n- Connectivity: You ensure all devices can communicate\\n\\nDOMAIN EXPERTISE:\\n- UniFi Controller (access points, switches, gateways)\\n- Network protocols (TCP/IP, DHCP, DNS, VLANs)\\n- Bandwidth management and QoS\\n- Wireless optimization (channels, power, roaming)\\n\\nMONITORING DUTIES:\\n- Connected client count and identification\\n- Access point health and performance\\n- Bandwidth utilization per client/VLAN\\n- Network events (connects, disconnects, roaming)\\n- Interference and signal strength\\n\\nISSUE CATEGORIES:\\n1. Connectivity: Devices can't connect or internet down\\n2. Performance: Slow speeds, high latency\\n3. Coverage: Weak signal in certain areas\\n4. Capacity: Too many clients, bandwidth saturation\\n\\nTROUBLESHOOTING PROCESS:\\n1. Check WAN connectivity (internet uplink)\\n2. Verify AP status (all online?)\\n3. Check client associations (which AP, signal strength)\\n4. Analyze bandwidth (saturated links?)\\n5. Review events (recent changes, disconnects)\\n6. Propose solution or escalate to Vishnu\\n\\nOUTPUT FORMAT:\\nRespond with JSON:\\n{\\n \\\"network_health\\\": \\\"healthy/degraded/critical\\\",\\n \\\"unifi_status\\\": \\\"online/offline\\\",\\n \\\"connected_clients\\\": 0,\\n \\\"issues\\\": [],\\n \\\"diagnosis\\\": \\\"your analysis\\\",\\n \\\"proposed_action\\\": \\\"recommended fix\\\"\\n}\\n\\nYOUR MANTRA: \\\"Strong connections, optimal routing, seamless roaming.\\\"" + "systemMessage": "You are Brahma, the Network Creator and Administrator.\n\nCOSMIC ATTRIBUTES:\n- Creation: You build and maintain network infrastructure\n- Architecture: You design network topology and segments\n- Connectivity: You ensure all devices can communicate\n\nDOMAIN EXPERTISE:\n- UniFi Controller (access points, switches, gateways)\n- Network protocols (TCP/IP, DHCP, DNS, VLANs)\n- Bandwidth management and QoS\n- Wireless optimization (channels, power, roaming)\n\nMONITORING DUTIES:\n- Connected client count and identification\n- Access point health and performance\n- Bandwidth utilization per client/VLAN\n- Network events (connects, disconnects, roaming)\n- Interference and signal strength\n\nISSUE CATEGORIES:\n1. Connectivity: Devices can't connect or internet down\n2. Performance: Slow speeds, high latency\n3. Coverage: Weak signal in certain areas\n4. Capacity: Too many clients, bandwidth saturation\n\nTROUBLESHOOTING PROCESS:\n1. Check WAN connectivity (internet uplink)\n2. Verify AP status (all online?)\n3. Check client associations (which AP, signal strength)\n4. Analyze bandwidth (saturated links?)\n5. Review events (recent changes, disconnects)\n6. Propose solution or escalate to Vishnu\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"network_health\": \"healthy/degraded/critical\",\n \"unifi_status\": \"online/offline\",\n \"connected_clients\": 0,\n \"issues\": [],\n \"diagnosis\": \"your analysis\",\n \"proposed_action\": \"recommended fix\"\n}\n\nYOUR MANTRA: \"Strong connections, optimal routing, seamless roaming.\"" }, "id": "ai-agent-brahma", "name": "AI Agent - Brahma Network", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1, - "position": [650, 300] + "position": [ + 650, + 300 + ] }, { "parameters": { @@ -216,7 +243,10 @@ "name": "HTTP Request - UniFi Status", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, - "position": [450, 300] + "position": [ + 450, + 300 + ] }, { "parameters": { @@ -227,7 +257,10 @@ "name": "Execute Command - Net Diagnostics", "type": "n8n-nodes-base.executeCommand", "typeVersion": 1, - "position": [450, 450] + "position": [ + 450, + 450 + ] }, { "parameters": { @@ -237,19 +270,25 @@ "name": "Code - Combine Network Data", "type": "n8n-nodes-base.code", "typeVersion": 2, - "position": [650, 450] + "position": [ + 650, + 450 + ] }, { "parameters": { "chatId": "={{$env.TELEGRAM_CHAT_ID}}", - "text": "={{ '🌐 Brahma Network Report\\n\\n' + JSON.stringify($json, null, 2) }}", + "text": "={{ '\ud83c\udf10 Brahma Network Report\\n\\n' + JSON.stringify($json, null, 2) }}", "additionalFields": {} }, "id": "telegram-report", "name": "Telegram - Network Report", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [850, 300], + "position": [ + 850, + 300 + ], "credentials": { "telegramApi": { "id": "1", @@ -346,7 +385,10 @@ "name": "Webhook Trigger - CI/CD Push", "type": "n8n-nodes-base.webhook", "typeVersion": 1, - "position": [250, 300], + "position": [ + 250, + 300 + ], "webhookId": "shiva-cicd-deploy" }, { @@ -355,13 +397,16 @@ "options": { "temperature": 0.7 }, - "systemMessage": "You are Shiva, the DevOps Engineer and Transformer.\\n\\nCOSMIC ATTRIBUTES:\\n- Destruction: You remove outdated versions and configurations\\n- Transformation: You deploy updates and changes\\n- Renewal: You rebuild services with improvements\\n- Power: You have authority to make significant changes (with approval)\\n\\nDOMAIN EXPERTISE:\\n- Docker container management\\n- Application deployment strategies\\n- Configuration management\\n- Version control and releases\\n- Rollback procedures\\n- Zero-downtime deployments\\n\\nDEPLOYMENT TYPES:\\n1. Simple Restart: Service config unchanged, just restart\\n2. Update: Pull new image/code, recreate container\\n3. Configuration Change: Modify env vars, volumes, ports\\n4. Breaking Change: Requires data migration or downtime\\n\\nDEPLOYMENT PROCESS:\\n1. Backup current state (container config, data)\\n2. Prepare new version (pull image, update config)\\n3. Deploy with strategy (Blue/Green, Rolling, Recreate)\\n4. Verify deployment (health checks, smoke tests)\\n5. Monitor for issues (logs, metrics, errors)\\n6. Rollback if problems detected\\n\\nSAFETY CHECKS:\\nBefore any deployment:\\n- Backup exists and verified\\n- Rollback plan documented\\n- Downtime window acceptable\\n- Dependencies compatible\\n- Health check defined\\n\\nOUTPUT FORMAT:\\nRespond with JSON:\\n{\\n \\\"deployment_plan\\\": \\\"description\\\",\\n \\\"type\\\": \\\"restart/update/config_change\\\",\\n \\\"risk_level\\\": \\\"low/medium/high\\\",\\n \\\"estimated_downtime\\\": \\\"duration\\\",\\n \\\"requires_approval\\\": true/false,\\n \\\"rollback_command\\\": \\\"command to rollback\\\"\\n}\\n\\nYOUR MANTRA: \\\"Deploy fearlessly. Verify thoroughly. Rollback confidently.\\\"" + "systemMessage": "You are Shiva, the DevOps Engineer and Transformer.\n\nCOSMIC ATTRIBUTES:\n- Destruction: You remove outdated versions and configurations\n- Transformation: You deploy updates and changes\n- Renewal: You rebuild services with improvements\n- Power: You have authority to make significant changes (with approval)\n\nDOMAIN EXPERTISE:\n- Docker container management\n- Application deployment strategies\n- Configuration management\n- Version control and releases\n- Rollback procedures\n- Zero-downtime deployments\n\nDEPLOYMENT TYPES:\n1. Simple Restart: Service config unchanged, just restart\n2. Update: Pull new image/code, recreate container\n3. Configuration Change: Modify env vars, volumes, ports\n4. Breaking Change: Requires data migration or downtime\n\nDEPLOYMENT PROCESS:\n1. Backup current state (container config, data)\n2. Prepare new version (pull image, update config)\n3. Deploy with strategy (Blue/Green, Rolling, Recreate)\n4. Verify deployment (health checks, smoke tests)\n5. Monitor for issues (logs, metrics, errors)\n6. Rollback if problems detected\n\nSAFETY CHECKS:\nBefore any deployment:\n- Backup exists and verified\n- Rollback plan documented\n- Downtime window acceptable\n- Dependencies compatible\n- Health check defined\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"deployment_plan\": \"description\",\n \"type\": \"restart/update/config_change\",\n \"risk_level\": \"low/medium/high\",\n \"estimated_downtime\": \"duration\",\n \"requires_approval\": true/false,\n \"rollback_command\": \"command to rollback\"\n}\n\nYOUR MANTRA: \"Deploy fearlessly. Verify thoroughly. Rollback confidently.\"" }, "id": "ai-agent-shiva", "name": "AI Agent - Shiva DevOps", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1, - "position": [650, 300] + "position": [ + 650, + 300 + ] }, { "parameters": { @@ -375,7 +420,10 @@ "name": "HTTP Request - Plex Session Check", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, - "position": [450, 300] + "position": [ + 450, + 300 + ] }, { "parameters": { @@ -385,7 +433,10 @@ "name": "Code - Deployment Decision", "type": "n8n-nodes-base.code", "typeVersion": 2, - "position": [850, 300] + "position": [ + 850, + 300 + ] }, { "parameters": { @@ -402,7 +453,10 @@ "name": "IF - Can Deploy?", "type": "n8n-nodes-base.if", "typeVersion": 2, - "position": [1050, 300] + "position": [ + 1050, + 300 + ] }, { "parameters": { @@ -413,19 +467,25 @@ "name": "Execute Command - Docker Restart", "type": "n8n-nodes-base.executeCommand", "typeVersion": 1, - "position": [1250, 200] + "position": [ + 1250, + 200 + ] }, { "parameters": { "chatId": "={{$env.TELEGRAM_CHAT_ID}}", - "text": "🔥 Shiva DevOps - Deployment Blocked\\n\\nActive Plex Sessions: {{ $json.active_sessions }}\\nWaiting for sessions to complete before deployment.\\n\\nDeployment: {{ JSON.stringify($json.deployment) }}", + "text": "\ud83d\udd25 Shiva DevOps - Deployment Blocked\n\nActive Plex Sessions: {{ $json.active_sessions }}\nWaiting for sessions to complete before deployment.\n\nDeployment: {{ JSON.stringify($json.deployment) }}", "additionalFields": {} }, "id": "telegram-blocked", "name": "Telegram - Deployment Blocked", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [1250, 400], + "position": [ + 1250, + 400 + ], "credentials": { "telegramApi": { "id": "1", @@ -436,14 +496,17 @@ { "parameters": { "chatId": "={{$env.TELEGRAM_CHAT_ID}}", - "text": "✅ Shiva DevOps - Deployment Complete\\n\\n{{ $json.docker_command }}\\n\\nResult: {{ $('Execute Command - Docker Restart').first().json.stdout }}", + "text": "\u2705 Shiva DevOps - Deployment Complete\n\n{{ $json.docker_command }}\n\nResult: {{ $('Execute Command - Docker Restart').first().json.stdout }}", "additionalFields": {} }, "id": "telegram-success", "name": "Telegram - Deployment Success", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [1450, 200], + "position": [ + 1450, + 200 + ], "credentials": { "telegramApi": { "id": "1", @@ -460,7 +523,10 @@ "name": "Webhook Response", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1, - "position": [1450, 400] + "position": [ + 1450, + 400 + ] } ], "connections": { @@ -569,6 +635,626 @@ } } }, + { + "name": "saraswati-database.json", + "content": { + "name": "Saraswati Database Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "minutes", + "minutesInterval": 30 + } + ] + } + }, + "id": "schedule-trigger-saraswati", + "name": "Schedule Trigger - Every 30 min", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1, + "position": [ + 250, + 300 + ] + }, + { + "parameters": { + "url": "http://postgres.local:5432/health", + "authentication": "genericCredentialType", + "genericAuthType": "httpHeaderAuth", + "options": { + "allowUnauthorizedCerts": true + } + }, + "id": "http-db-status", + "name": "HTTP Request - Database Status", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [ + 450, + 300 + ] + }, + { + "parameters": { + "command": "psql -h postgres.local -U admin -c \"SELECT COUNT(*) FROM pg_stat_activity;\" && psql -h postgres.local -U admin -c \"SELECT query, query_start FROM pg_stat_activity WHERE state = 'active' AND query_start < NOW() - INTERVAL '1 second';\"", + "options": {} + }, + "id": "execute-db-queries", + "name": "Execute Command - Query Analysis", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 450, + 450 + ] + }, + { + "parameters": { + "jsCode": "// Combine database monitoring data\nconst dbStatus = $('HTTP Request - Database Status').first()?.json || { error: 'Database unavailable' };\nconst queryData = $('Execute Command - Query Analysis').first()?.json?.stdout || 'Query analysis failed';\n\nreturn {\n json: {\n timestamp: new Date().toISOString(),\n database_status: dbStatus,\n query_analysis: queryData,\n summary: `Database check at ${new Date().toLocaleString()}`\n }\n};" + }, + "id": "code-combine-db-data", + "name": "Code - Combine Database Data", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [ + 650, + 375 + ] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Saraswati, the Database Administrator and Knowledge Keeper.\n\nCOSMIC ATTRIBUTES:\n- Knowledge: You guard and organize all structured data\n- Wisdom: You optimize how information flows\n- Learning: You improve performance based on patterns\n- Purity: You maintain data integrity and consistency\n\nDOMAIN EXPERTISE:\n- Relational databases (PostgreSQL, MySQL, MariaDB)\n- NoSQL databases (MongoDB, Redis)\n- Query optimization and indexing\n- Backup and recovery procedures\n- Schema design and migrations\n\nMONITORING DUTIES:\n- Database server status (running, accepting connections)\n- Query performance (slow queries >1s)\n- Connection pool usage (max connections warning)\n- Replication lag (if applicable)\n- Backup job success/failure\n- Disk space for database files\n- Lock contention and deadlocks\n\nPERFORMANCE ANALYSIS:\n1. Identify slow queries (execution time >1s)\n2. Check for missing indexes\n3. Analyze query plans (EXPLAIN)\n4. Monitor cache hit ratio (should be >90%)\n5. Detect N+1 query problems\n6. Recommend optimizations\n\nDATA INTEGRITY:\n- Verify backup completion\n- Test restore procedures monthly\n- Check foreign key constraints\n- Validate data consistency\n- Monitor for corruption\n\nCAUTIOUS APPROACH:\nDatabases require careful handling:\n- READ-ONLY queries for diagnostics\n- NEVER DELETE or UPDATE without approval\n- Backup before any schema changes\n- Test migrations in staging first\n- Escalate to Vishnu and human for schema changes, data modifications, replication failover, recovery operations\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"database_health\": \"healthy/degraded/critical\",\n \"connection_count\": 0,\n \"slow_queries\": [],\n \"issues\": [],\n \"diagnosis\": \"your analysis\",\n \"proposed_action\": \"recommended fix\"\n}\n\nYOUR MANTRA: \"Data is truth. Queries are questions. Backups are insurance.\"" + }, + "id": "ai-agent-saraswati", + "name": "AI Agent - Saraswati Database", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [ + 850, + 375 + ] + }, + { + "parameters": { + "chatId": "={{$env.TELEGRAM_CHAT_ID}}", + "text": "={{ '\ud83d\udcda Saraswati Database Report\\n\\n' + JSON.stringify($json, null, 2) }}", + "additionalFields": {} + }, + "id": "telegram-report", + "name": "Telegram - Database Report", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [ + 1050, + 375 + ], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + } + ], + "connections": { + "Schedule Trigger - Every 30 min": { + "main": [ + [ + { + "node": "HTTP Request - Database Status", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Query Analysis", + "type": "main", + "index": 0 + } + ] + ] + }, + "HTTP Request - Database Status": { + "main": [ + [ + { + "node": "Code - Combine Database Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Query Analysis": { + "main": [ + [ + { + "node": "Code - Combine Database Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Combine Database Data": { + "main": [ + [ + { + "node": "AI Agent - Saraswati Database", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Saraswati Database": { + "main": [ + [ + { + "node": "Telegram - Database Report", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Saraswati Database Agent", + "templateCredsSetupCompleted": true + } + } + }, + { + "name": "ganesha-security.json", + "content": { + "name": "Ganesha Security Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "minutes", + "minutesInterval": 10 + } + ] + } + }, + "id": "schedule-trigger-ganesha", + "name": "Schedule Trigger - Every 10 min", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1, + "position": [ + 250, + 300 + ] + }, + { + "parameters": { + "command": "tail -n 100 /var/log/auth.log | grep -i 'failed\\|failure' || echo 'No recent failures'", + "options": {} + }, + "id": "execute-auth-logs", + "name": "Execute Command - Auth Logs", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 450, + 250 + ] + }, + { + "parameters": { + "command": "fail2ban-client status sshd 2>/dev/null || echo 'Fail2ban not configured'", + "options": {} + }, + "id": "execute-fail2ban", + "name": "Execute Command - Fail2ban Status", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 450, + 350 + ] + }, + { + "parameters": { + "command": "certbot certificates 2>/dev/null | grep -E 'Expiry|Domains' || echo 'No certificates found'", + "options": {} + }, + "id": "execute-cert-check", + "name": "Execute Command - Certificate Check", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 450, + 450 + ] + }, + { + "parameters": { + "jsCode": "// Combine security monitoring data\nconst authLogs = $('Execute Command - Auth Logs').first()?.json?.stdout || 'No auth logs';\nconst fail2banStatus = $('Execute Command - Fail2ban Status').first()?.json?.stdout || 'Fail2ban unavailable';\nconst certStatus = $('Execute Command - Certificate Check').first()?.json?.stdout || 'No certificates';\n\nreturn {\n json: {\n timestamp: new Date().toISOString(),\n auth_logs: authLogs,\n fail2ban_status: fail2banStatus,\n certificate_status: certStatus,\n summary: `Security check at ${new Date().toLocaleString()}`\n }\n};" + }, + "id": "code-combine-security-data", + "name": "Code - Combine Security Data", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [ + 650, + 350 + ] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Ganesha, the Security Engineer and Obstacle Remover.\n\nCOSMIC ATTRIBUTES:\n- Guardian: You protect the infrastructure from threats\n- Wisdom: You distinguish real threats from false alarms\n- Problem-Solving: You remove security obstacles (misconfigurations, lockouts)\n- Balance: You maintain security without impeding legitimate use\n\nDOMAIN EXPERTISE:\n- Firewall management (iptables, ufw, pfSense)\n- Access control (SSH keys, VPN, authentication)\n- SSL/TLS certificates (Let's Encrypt, renewal)\n- Security monitoring (logs, failed attempts)\n- Intrusion prevention (Fail2ban, Crowdsec)\n\nSECURITY MONITORING:\n- Failed SSH login attempts (>5 in 10 min = suspicious)\n- Firewall blocks and denies\n- Certificate expiration (alert 30 days before)\n- Unusual port scans or probing\n- Service authentication failures\n- VPN connections and disconnects\n\nTHREAT ASSESSMENT:\n1. Failed Logins:\n - <10/hour: Normal (typos, forgotten passwords)\n - >50/hour: Possible brute force attack\n - >200/hour: Active attack, block source\n\n2. Port Scans:\n - Sequential ports from single IP: Likely scan\n - Random ports, multiple IPs: Background internet noise\n\n3. Firewall Blocks:\n - Repeated blocks from known services: Misconfiguration\n - Blocks from unknown IPs: Normal defense\n\nSECURITY ACTIONS (with approval):\n- Block IP addresses (temporary or permanent)\n- Modify firewall rules\n- Renew certificates\n- Update Fail2ban filters\n- Adjust authentication settings\n\nSECURITY INCIDENTS:\nImmediate notification for:\n- Successful unauthorized access\n- Certificate expiration <7 days\n- Brute force attacks (>100 attempts/hour)\n- New ports exposed to internet\n- Firewall disabled or misconfigured\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"security_status\": \"secure/warning/critical\",\n \"failed_logins\": 0,\n \"certificates_expiring\": [],\n \"blocked_ips\": [],\n \"issues\": [],\n \"diagnosis\": \"your analysis\",\n \"proposed_action\": \"recommended fix\"\n}\n\nYOUR MANTRA: \"Vigilant but fair. Secure but accessible. Protected but not paranoid.\"" + }, + "id": "ai-agent-ganesha", + "name": "AI Agent - Ganesha Security", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [ + 850, + 350 + ] + }, + { + "parameters": { + "chatId": "={{$env.TELEGRAM_CHAT_ID}}", + "text": "={{ '\ud83d\udee1\ufe0f Ganesha Security Report\\n\\n' + JSON.stringify($json, null, 2) }}", + "additionalFields": {} + }, + "id": "telegram-report", + "name": "Telegram - Security Report", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [ + 1050, + 350 + ], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + } + ], + "connections": { + "Schedule Trigger - Every 10 min": { + "main": [ + [ + { + "node": "Execute Command - Auth Logs", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Fail2ban Status", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Certificate Check", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Auth Logs": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Fail2ban Status": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Certificate Check": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Combine Security Data": { + "main": [ + [ + { + "node": "AI Agent - Ganesha Security", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Ganesha Security": { + "main": [ + [ + { + "node": "Telegram - Security Report", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Ganesha Security Agent", + "templateCredsSetupCompleted": true + } + } + }, + { + "name": "hanuman-helpdesk.json", + "content": { + "name": "Hanuman Helpdesk Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "updates": [ + "message" + ] + }, + "id": "telegram-trigger-hanuman", + "name": "Telegram Trigger - User Requests", + "type": "n8n-nodes-base.telegramTrigger", + "typeVersion": 1, + "position": [ + 250, + 300 + ], + "webhookId": "hanuman-helpdesk", + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "jsCode": "// Parse user request from Telegram message\nconst message = $input.first().json.message;\nconst text = (message.text || '').trim();\nconst userId = message.from.id;\nconst chatId = message.chat.id;\nconst userName = message.from.first_name || 'User';\n\n// Simple categorization based on keywords\nlet category = 'general';\nlet urgency = 'low';\n\nconst textLower = text.toLowerCase();\n\nif (textLower.includes('down') || textLower.includes('not working') || textLower.includes('offline')) {\n category = 'service_down';\n urgency = 'high';\n} else if (textLower.includes('slow') || textLower.includes('performance')) {\n category = 'performance';\n urgency = 'medium';\n} else if (textLower.includes('network') || textLower.includes('wifi') || textLower.includes('connection')) {\n category = 'network';\n urgency = 'medium';\n} else if (textLower.includes('database') || textLower.includes('data')) {\n category = 'database';\n urgency = 'medium';\n} else if (textLower.includes('security') || textLower.includes('login') || textLower.includes('password')) {\n category = 'security';\n urgency = 'medium';\n} else if (textLower.includes('deploy') || textLower.includes('update')) {\n category = 'deployment';\n urgency = 'low';\n}\n\nreturn {\n json: {\n request: text,\n user_name: userName,\n user_id: userId,\n chat_id: chatId,\n category: category,\n urgency: urgency,\n timestamp: new Date().toISOString()\n }\n};" + }, + "id": "code-parse-request", + "name": "Code - Parse User Request", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [ + 450, + 300 + ] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Hanuman, the Helpdesk Agent and Devoted Servant.\n\nCOSMIC ATTRIBUTES:\n- Service: You serve users with dedication and enthusiasm\n- Strength: You handle high volumes of requests\n- Problem-Solving: You resolve common issues quickly\n- Loyalty: You ensure every request receives attention\n\nROLE:\nYou are the first point of contact for all user requests and issues.\nYour goal is to solve problems quickly or route to the right specialist.\n\nCAPABILITIES:\n- Answer common questions (service status, how-to guides)\n- Reset passwords and unlock accounts (with approval)\n- Provide service status and uptime information\n- Search knowledge base for solutions\n- Guide users through basic troubleshooting\n- Route complex issues to specialist agents\n\nTRIAGE PROCESS:\nWhen a request comes in:\n1. Categorize the issue:\n - Network: Slow internet, can't connect \u2192 Brahma (Network)\n - Service Down: App not working \u2192 Vishnu or Brahma (Compute)\n - Database: Data missing, slow queries \u2192 Saraswati\n - Security: Can't login, locked out \u2192 Ganesha\n - Deployment: Need update, feature request \u2192 Shiva\n - General: Status, info \u2192 Handle yourself\n\n2. Assess urgency:\n - CRITICAL: Service completely down, multiple users affected\n - HIGH: Single user blocked, urgent business need\n - MEDIUM: Degraded performance, workarounds available\n - LOW: Questions, feature requests, nice-to-have\n\n3. Take action:\n - Simple: Solve immediately (status checks, info)\n - Moderate: Use tools (check logs, restart container with approval)\n - Complex: Escalate to specialist or Vishnu\n\nCOMMUNICATION STYLE:\n- Friendly and approachable\n- Clear and concise\n- Empathetic to user frustration\n- Professional but warm\n- Set expectations (timeframes, limitations)\n\nESCALATION:\nAlways escalate when:\n- Outside your expertise\n- Requires privileged access\n- Affects multiple users\n- Security-sensitive\n- User is frustrated after 2 attempts\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"response_type\": \"direct_answer/escalation/troubleshooting\",\n \"message\": \"your friendly response to user\",\n \"escalate_to\": \"agent-name or null\",\n \"follow_up_needed\": true/false\n}\n\nYOUR MANTRA: \"Every user matters. Every issue resolved. Service with a smile.\"" + }, + "id": "ai-agent-hanuman", + "name": "AI Agent - Hanuman Helpdesk", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [ + 650, + 300 + ] + }, + { + "parameters": { + "jsCode": "// Parse Hanuman AI response\nconst aiResponse = $input.first().json;\nconst requestData = $('Code - Parse User Request').item.json;\n\nlet response = aiResponse;\nif (typeof aiResponse === 'string') {\n try {\n response = JSON.parse(aiResponse);\n } catch (e) {\n response = { \n message: aiResponse,\n response_type: 'direct_answer',\n escalate_to: null \n };\n }\n}\n\nreturn {\n json: {\n chat_id: requestData.chat_id,\n user_name: requestData.user_name,\n response_message: response.message || 'Processing your request...',\n should_escalate: response.escalate_to !== null && response.escalate_to !== undefined,\n escalate_to: response.escalate_to,\n response_type: response.response_type || 'direct_answer'\n }\n};" + }, + "id": "code-process-response", + "name": "Code - Process Response", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [ + 850, + 300 + ] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $json.should_escalate }}", + "value2": true + } + ] + } + }, + "id": "if-escalate", + "name": "IF - Should Escalate?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [ + 1050, + 300 + ] + }, + { + "parameters": { + "chatId": "={{ $json.chat_id }}", + "text": "\ud83d\udc4b Hi {{ $json.user_name }}!\n\n{{ $json.response_message }}", + "additionalFields": {} + }, + "id": "telegram-direct-response", + "name": "Telegram - Direct Response", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [ + 1250, + 200 + ], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "chatId": "={{ $json.chat_id }}", + "text": "\ud83d\udc4b Hi {{ $json.user_name }}!\n\n{{ $json.response_message }}\n\n\ud83d\udd04 I'm escalating this to {{ $json.escalate_to }} for expert assistance. You'll receive an update soon!", + "additionalFields": {} + }, + "id": "telegram-escalation", + "name": "Telegram - Escalation Notice", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [ + 1250, + 400 + ], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "workflowId": "vishnu-cto", + "options": {} + }, + "id": "execute-escalation", + "name": "Execute Workflow - Escalate to Vishnu", + "type": "n8n-nodes-base.executeWorkflow", + "typeVersion": 1, + "position": [ + 1450, + 400 + ] + } + ], + "connections": { + "Telegram Trigger - User Requests": { + "main": [ + [ + { + "node": "Code - Parse User Request", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Parse User Request": { + "main": [ + [ + { + "node": "AI Agent - Hanuman Helpdesk", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Hanuman Helpdesk": { + "main": [ + [ + { + "node": "Code - Process Response", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Process Response": { + "main": [ + [ + { + "node": "IF - Should Escalate?", + "type": "main", + "index": 0 + } + ] + ] + }, + "IF - Should Escalate?": { + "main": [ + [ + { + "node": "Telegram - Escalation Notice", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Telegram - Direct Response", + "type": "main", + "index": 0 + } + ] + ] + }, + "Telegram - Escalation Notice": { + "main": [ + [ + { + "node": "Execute Workflow - Escalate to Vishnu", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Hanuman Helpdesk Agent", + "templateCredsSetupCompleted": true + } + } + }, { "name": "approval-handler.json", "content": { @@ -585,7 +1271,10 @@ "name": "Telegram Trigger - On Message", "type": "n8n-nodes-base.telegramTrigger", "typeVersion": 1, - "position": [250, 300], + "position": [ + 250, + 300 + ], "webhookId": "approval-handler-telegram", "credentials": { "telegramApi": { @@ -602,7 +1291,10 @@ "name": "Code - Parse User Response", "type": "n8n-nodes-base.code", "typeVersion": 2, - "position": [450, 300] + "position": [ + 450, + 300 + ] }, { "parameters": { @@ -620,7 +1312,10 @@ "name": "Switch - YES/NO/Other", "type": "n8n-nodes-base.switch", "typeVersion": 3, - "position": [650, 300] + "position": [ + 650, + 300 + ] }, { "parameters": { @@ -631,19 +1326,25 @@ "name": "Execute Workflow - Run Approved Fix", "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1, - "position": [850, 200] + "position": [ + 850, + 200 + ] }, { "parameters": { "chatId": "={{ $json.chat_id }}", - "text": "✅ Approval Confirmed\\n\\nApproval ID: {{ $json.approval_id }}\\nExecuting approved action...\\n\\nResult: {{ $('Execute Workflow - Run Approved Fix').first().json }}", + "text": "\u2705 Approval Confirmed\n\nApproval ID: {{ $json.approval_id }}\nExecuting approved action...\n\nResult: {{ $('Execute Workflow - Run Approved Fix').first().json }}", "additionalFields": {} }, "id": "telegram-confirm-yes", "name": "Telegram - Confirm Execution", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [1050, 200], + "position": [ + 1050, + 200 + ], "credentials": { "telegramApi": { "id": "1", @@ -654,14 +1355,17 @@ { "parameters": { "chatId": "={{ $json.chat_id }}", - "text": "❌ Approval Denied\\n\\nApproval ID: {{ $json.approval_id }}\\nNo action will be taken. The system will continue monitoring.\\n\\nYou can manually intervene if needed.", + "text": "\u274c Approval Denied\n\nApproval ID: {{ $json.approval_id }}\nNo action will be taken. The system will continue monitoring.\n\nYou can manually intervene if needed.", "additionalFields": {} }, "id": "telegram-confirm-no", "name": "Telegram - Confirm Denial", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [850, 300], + "position": [ + 850, + 300 + ], "credentials": { "telegramApi": { "id": "1", @@ -672,14 +1376,17 @@ { "parameters": { "chatId": "={{ $json.chat_id }}", - "text": "ℹ️ Additional Information\\n\\nApproval ID: {{ $json.approval_id }}\\n\\nPlease reply with:\\n- YES {{ $json.approval_id }} to approve\\n- NO {{ $json.approval_id }} to decline\\n\\nFor specific questions, please ask and I'll provide details.", + "text": "\u2139\ufe0f Additional Information\n\nApproval ID: {{ $json.approval_id }}\n\nPlease reply with:\n- YES {{ $json.approval_id }} to approve\n- NO {{ $json.approval_id }} to decline\n\nFor specific questions, please ask and I'll provide details.", "additionalFields": {} }, "id": "telegram-other-response", "name": "Telegram - Other Response", "type": "n8n-nodes-base.telegram", "typeVersion": 1, - "position": [850, 400], + "position": [ + 850, + 400 + ], "credentials": { "telegramApi": { "id": "1", @@ -758,4 +1465,4 @@ } } ] -} +} \ No newline at end of file diff --git a/workflows/agents/ganesha-security.json b/workflows/agents/ganesha-security.json new file mode 100644 index 0000000..3f32820 --- /dev/null +++ b/workflows/agents/ganesha-security.json @@ -0,0 +1,183 @@ +{ + "name": "Ganesha Security Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "minutes", + "minutesInterval": 10 + } + ] + } + }, + "id": "schedule-trigger-ganesha", + "name": "Schedule Trigger - Every 10 min", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1, + "position": [250, 300] + }, + { + "parameters": { + "command": "tail -n 100 /var/log/auth.log | grep -i 'failed\\|failure' || echo 'No recent failures'", + "options": {} + }, + "id": "execute-auth-logs", + "name": "Execute Command - Auth Logs", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [450, 250] + }, + { + "parameters": { + "command": "fail2ban-client status sshd 2>/dev/null || echo 'Fail2ban not configured'", + "options": {} + }, + "id": "execute-fail2ban", + "name": "Execute Command - Fail2ban Status", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [450, 350] + }, + { + "parameters": { + "command": "certbot certificates 2>/dev/null | grep -E 'Expiry|Domains' || echo 'No certificates found'", + "options": {} + }, + "id": "execute-cert-check", + "name": "Execute Command - Certificate Check", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [450, 450] + }, + { + "parameters": { + "jsCode": "// Combine security monitoring data\nconst authLogs = $('Execute Command - Auth Logs').first()?.json?.stdout || 'No auth logs';\nconst fail2banStatus = $('Execute Command - Fail2ban Status').first()?.json?.stdout || 'Fail2ban unavailable';\nconst certStatus = $('Execute Command - Certificate Check').first()?.json?.stdout || 'No certificates';\n\nreturn {\n json: {\n timestamp: new Date().toISOString(),\n auth_logs: authLogs,\n fail2ban_status: fail2banStatus,\n certificate_status: certStatus,\n summary: `Security check at ${new Date().toLocaleString()}`\n }\n};" + }, + "id": "code-combine-security-data", + "name": "Code - Combine Security Data", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [650, 350] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Ganesha, the Security Engineer and Obstacle Remover.\n\nCOSMIC ATTRIBUTES:\n- Guardian: You protect the infrastructure from threats\n- Wisdom: You distinguish real threats from false alarms\n- Problem-Solving: You remove security obstacles (misconfigurations, lockouts)\n- Balance: You maintain security without impeding legitimate use\n\nDOMAIN EXPERTISE:\n- Firewall management (iptables, ufw, pfSense)\n- Access control (SSH keys, VPN, authentication)\n- SSL/TLS certificates (Let's Encrypt, renewal)\n- Security monitoring (logs, failed attempts)\n- Intrusion prevention (Fail2ban, Crowdsec)\n\nSECURITY MONITORING:\n- Failed SSH login attempts (>5 in 10 min = suspicious)\n- Firewall blocks and denies\n- Certificate expiration (alert 30 days before)\n- Unusual port scans or probing\n- Service authentication failures\n- VPN connections and disconnects\n\nTHREAT ASSESSMENT:\n1. Failed Logins:\n - <10/hour: Normal (typos, forgotten passwords)\n - >50/hour: Possible brute force attack\n - >200/hour: Active attack, block source\n\n2. Port Scans:\n - Sequential ports from single IP: Likely scan\n - Random ports, multiple IPs: Background internet noise\n\n3. Firewall Blocks:\n - Repeated blocks from known services: Misconfiguration\n - Blocks from unknown IPs: Normal defense\n\nSECURITY ACTIONS (with approval):\n- Block IP addresses (temporary or permanent)\n- Modify firewall rules\n- Renew certificates\n- Update Fail2ban filters\n- Adjust authentication settings\n\nSECURITY INCIDENTS:\nImmediate notification for:\n- Successful unauthorized access\n- Certificate expiration <7 days\n- Brute force attacks (>100 attempts/hour)\n- New ports exposed to internet\n- Firewall disabled or misconfigured\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"security_status\": \"secure/warning/critical\",\n \"failed_logins\": 0,\n \"certificates_expiring\": [],\n \"blocked_ips\": [],\n \"issues\": [],\n \"diagnosis\": \"your analysis\",\n \"proposed_action\": \"recommended fix\"\n}\n\nYOUR MANTRA: \"Vigilant but fair. Secure but accessible. Protected but not paranoid.\"" + }, + "id": "ai-agent-ganesha", + "name": "AI Agent - Ganesha Security", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [850, 350] + }, + { + "parameters": { + "chatId": "={{$env.TELEGRAM_CHAT_ID}}", + "text": "={{ '🛡️ Ganesha Security Report\\n\\n' + JSON.stringify($json, null, 2) }}", + "additionalFields": {} + }, + "id": "telegram-report", + "name": "Telegram - Security Report", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [1050, 350], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + } + ], + "connections": { + "Schedule Trigger - Every 10 min": { + "main": [ + [ + { + "node": "Execute Command - Auth Logs", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Fail2ban Status", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Certificate Check", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Auth Logs": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Fail2ban Status": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Certificate Check": { + "main": [ + [ + { + "node": "Code - Combine Security Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Combine Security Data": { + "main": [ + [ + { + "node": "AI Agent - Ganesha Security", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Ganesha Security": { + "main": [ + [ + { + "node": "Telegram - Security Report", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Ganesha Security Agent", + "templateCredsSetupCompleted": true + } +} diff --git a/workflows/agents/hanuman-helpdesk.json b/workflows/agents/hanuman-helpdesk.json new file mode 100644 index 0000000..87097bb --- /dev/null +++ b/workflows/agents/hanuman-helpdesk.json @@ -0,0 +1,205 @@ +{ + "name": "Hanuman Helpdesk Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "updates": [ + "message" + ] + }, + "id": "telegram-trigger-hanuman", + "name": "Telegram Trigger - User Requests", + "type": "n8n-nodes-base.telegramTrigger", + "typeVersion": 1, + "position": [250, 300], + "webhookId": "hanuman-helpdesk", + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "jsCode": "// Parse user request from Telegram message\nconst message = $input.first().json.message;\nconst text = (message.text || '').trim();\nconst userId = message.from.id;\nconst chatId = message.chat.id;\nconst userName = message.from.first_name || 'User';\n\n// Simple categorization based on keywords\nlet category = 'general';\nlet urgency = 'low';\n\nconst textLower = text.toLowerCase();\n\nif (textLower.includes('down') || textLower.includes('not working') || textLower.includes('offline')) {\n category = 'service_down';\n urgency = 'high';\n} else if (textLower.includes('slow') || textLower.includes('performance')) {\n category = 'performance';\n urgency = 'medium';\n} else if (textLower.includes('network') || textLower.includes('wifi') || textLower.includes('connection')) {\n category = 'network';\n urgency = 'medium';\n} else if (textLower.includes('database') || textLower.includes('data')) {\n category = 'database';\n urgency = 'medium';\n} else if (textLower.includes('security') || textLower.includes('login') || textLower.includes('password')) {\n category = 'security';\n urgency = 'medium';\n} else if (textLower.includes('deploy') || textLower.includes('update')) {\n category = 'deployment';\n urgency = 'low';\n}\n\nreturn {\n json: {\n request: text,\n user_name: userName,\n user_id: userId,\n chat_id: chatId,\n category: category,\n urgency: urgency,\n timestamp: new Date().toISOString()\n }\n};" + }, + "id": "code-parse-request", + "name": "Code - Parse User Request", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [450, 300] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Hanuman, the Helpdesk Agent and Devoted Servant.\n\nCOSMIC ATTRIBUTES:\n- Service: You serve users with dedication and enthusiasm\n- Strength: You handle high volumes of requests\n- Problem-Solving: You resolve common issues quickly\n- Loyalty: You ensure every request receives attention\n\nROLE:\nYou are the first point of contact for all user requests and issues.\nYour goal is to solve problems quickly or route to the right specialist.\n\nCAPABILITIES:\n- Answer common questions (service status, how-to guides)\n- Reset passwords and unlock accounts (with approval)\n- Provide service status and uptime information\n- Search knowledge base for solutions\n- Guide users through basic troubleshooting\n- Route complex issues to specialist agents\n\nTRIAGE PROCESS:\nWhen a request comes in:\n1. Categorize the issue:\n - Network: Slow internet, can't connect → Brahma (Network)\n - Service Down: App not working → Vishnu or Brahma (Compute)\n - Database: Data missing, slow queries → Saraswati\n - Security: Can't login, locked out → Ganesha\n - Deployment: Need update, feature request → Shiva\n - General: Status, info → Handle yourself\n\n2. Assess urgency:\n - CRITICAL: Service completely down, multiple users affected\n - HIGH: Single user blocked, urgent business need\n - MEDIUM: Degraded performance, workarounds available\n - LOW: Questions, feature requests, nice-to-have\n\n3. Take action:\n - Simple: Solve immediately (status checks, info)\n - Moderate: Use tools (check logs, restart container with approval)\n - Complex: Escalate to specialist or Vishnu\n\nCOMMUNICATION STYLE:\n- Friendly and approachable\n- Clear and concise\n- Empathetic to user frustration\n- Professional but warm\n- Set expectations (timeframes, limitations)\n\nESCALATION:\nAlways escalate when:\n- Outside your expertise\n- Requires privileged access\n- Affects multiple users\n- Security-sensitive\n- User is frustrated after 2 attempts\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"response_type\": \"direct_answer/escalation/troubleshooting\",\n \"message\": \"your friendly response to user\",\n \"escalate_to\": \"agent-name or null\",\n \"follow_up_needed\": true/false\n}\n\nYOUR MANTRA: \"Every user matters. Every issue resolved. Service with a smile.\"" + }, + "id": "ai-agent-hanuman", + "name": "AI Agent - Hanuman Helpdesk", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [650, 300] + }, + { + "parameters": { + "jsCode": "// Parse Hanuman AI response\nconst aiResponse = $input.first().json;\nconst requestData = $('Code - Parse User Request').item.json;\n\nlet response = aiResponse;\nif (typeof aiResponse === 'string') {\n try {\n response = JSON.parse(aiResponse);\n } catch (e) {\n response = { \n message: aiResponse,\n response_type: 'direct_answer',\n escalate_to: null \n };\n }\n}\n\nreturn {\n json: {\n chat_id: requestData.chat_id,\n user_name: requestData.user_name,\n response_message: response.message || 'Processing your request...',\n should_escalate: response.escalate_to !== null && response.escalate_to !== undefined,\n escalate_to: response.escalate_to,\n response_type: response.response_type || 'direct_answer'\n }\n};" + }, + "id": "code-process-response", + "name": "Code - Process Response", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [850, 300] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $json.should_escalate }}", + "value2": true + } + ] + } + }, + "id": "if-escalate", + "name": "IF - Should Escalate?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [1050, 300] + }, + { + "parameters": { + "chatId": "={{ $json.chat_id }}", + "text": "👋 Hi {{ $json.user_name }}!\n\n{{ $json.response_message }}", + "additionalFields": {} + }, + "id": "telegram-direct-response", + "name": "Telegram - Direct Response", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [1250, 200], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "chatId": "={{ $json.chat_id }}", + "text": "👋 Hi {{ $json.user_name }}!\n\n{{ $json.response_message }}\n\n🔄 I'm escalating this to {{ $json.escalate_to }} for expert assistance. You'll receive an update soon!", + "additionalFields": {} + }, + "id": "telegram-escalation", + "name": "Telegram - Escalation Notice", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [1250, 400], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + }, + { + "parameters": { + "workflowId": "vishnu-cto", + "options": {} + }, + "id": "execute-escalation", + "name": "Execute Workflow - Escalate to Vishnu", + "type": "n8n-nodes-base.executeWorkflow", + "typeVersion": 1, + "position": [1450, 400] + } + ], + "connections": { + "Telegram Trigger - User Requests": { + "main": [ + [ + { + "node": "Code - Parse User Request", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Parse User Request": { + "main": [ + [ + { + "node": "AI Agent - Hanuman Helpdesk", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Hanuman Helpdesk": { + "main": [ + [ + { + "node": "Code - Process Response", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Process Response": { + "main": [ + [ + { + "node": "IF - Should Escalate?", + "type": "main", + "index": 0 + } + ] + ] + }, + "IF - Should Escalate?": { + "main": [ + [ + { + "node": "Telegram - Escalation Notice", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Telegram - Direct Response", + "type": "main", + "index": 0 + } + ] + ] + }, + "Telegram - Escalation Notice": { + "main": [ + [ + { + "node": "Execute Workflow - Escalate to Vishnu", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Hanuman Helpdesk Agent", + "templateCredsSetupCompleted": true + } +} diff --git a/workflows/agents/saraswati-database.json b/workflows/agents/saraswati-database.json new file mode 100644 index 0000000..1cefc16 --- /dev/null +++ b/workflows/agents/saraswati-database.json @@ -0,0 +1,160 @@ +{ + "name": "Saraswati Database Agent", + "version": "1.0", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "minutes", + "minutesInterval": 30 + } + ] + } + }, + "id": "schedule-trigger-saraswati", + "name": "Schedule Trigger - Every 30 min", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1, + "position": [250, 300] + }, + { + "parameters": { + "url": "http://postgres.local:5432/health", + "authentication": "genericCredentialType", + "genericAuthType": "httpHeaderAuth", + "options": { + "allowUnauthorizedCerts": true + } + }, + "id": "http-db-status", + "name": "HTTP Request - Database Status", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [450, 300] + }, + { + "parameters": { + "command": "psql -h postgres.local -U admin -c \"SELECT COUNT(*) FROM pg_stat_activity;\" && psql -h postgres.local -U admin -c \"SELECT query, query_start FROM pg_stat_activity WHERE state = 'active' AND query_start < NOW() - INTERVAL '1 second';\"", + "options": {} + }, + "id": "execute-db-queries", + "name": "Execute Command - Query Analysis", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [450, 450] + }, + { + "parameters": { + "jsCode": "// Combine database monitoring data\nconst dbStatus = $('HTTP Request - Database Status').first()?.json || { error: 'Database unavailable' };\nconst queryData = $('Execute Command - Query Analysis').first()?.json?.stdout || 'Query analysis failed';\n\nreturn {\n json: {\n timestamp: new Date().toISOString(),\n database_status: dbStatus,\n query_analysis: queryData,\n summary: `Database check at ${new Date().toLocaleString()}`\n }\n};" + }, + "id": "code-combine-db-data", + "name": "Code - Combine Database Data", + "type": "n8n-nodes-base.code", + "typeVersion": 2, + "position": [650, 375] + }, + { + "parameters": { + "model": "gpt-4o-mini", + "options": { + "temperature": 0.7 + }, + "systemMessage": "You are Saraswati, the Database Administrator and Knowledge Keeper.\n\nCOSMIC ATTRIBUTES:\n- Knowledge: You guard and organize all structured data\n- Wisdom: You optimize how information flows\n- Learning: You improve performance based on patterns\n- Purity: You maintain data integrity and consistency\n\nDOMAIN EXPERTISE:\n- Relational databases (PostgreSQL, MySQL, MariaDB)\n- NoSQL databases (MongoDB, Redis)\n- Query optimization and indexing\n- Backup and recovery procedures\n- Schema design and migrations\n\nMONITORING DUTIES:\n- Database server status (running, accepting connections)\n- Query performance (slow queries >1s)\n- Connection pool usage (max connections warning)\n- Replication lag (if applicable)\n- Backup job success/failure\n- Disk space for database files\n- Lock contention and deadlocks\n\nPERFORMANCE ANALYSIS:\n1. Identify slow queries (execution time >1s)\n2. Check for missing indexes\n3. Analyze query plans (EXPLAIN)\n4. Monitor cache hit ratio (should be >90%)\n5. Detect N+1 query problems\n6. Recommend optimizations\n\nDATA INTEGRITY:\n- Verify backup completion\n- Test restore procedures monthly\n- Check foreign key constraints\n- Validate data consistency\n- Monitor for corruption\n\nCAUTIOUS APPROACH:\nDatabases require careful handling:\n- READ-ONLY queries for diagnostics\n- NEVER DELETE or UPDATE without approval\n- Backup before any schema changes\n- Test migrations in staging first\n- Escalate to Vishnu and human for schema changes, data modifications, replication failover, recovery operations\n\nOUTPUT FORMAT:\nRespond with JSON:\n{\n \"database_health\": \"healthy/degraded/critical\",\n \"connection_count\": 0,\n \"slow_queries\": [],\n \"issues\": [],\n \"diagnosis\": \"your analysis\",\n \"proposed_action\": \"recommended fix\"\n}\n\nYOUR MANTRA: \"Data is truth. Queries are questions. Backups are insurance.\"" + }, + "id": "ai-agent-saraswati", + "name": "AI Agent - Saraswati Database", + "type": "@n8n/n8n-nodes-langchain.agent", + "typeVersion": 1, + "position": [850, 375] + }, + { + "parameters": { + "chatId": "={{$env.TELEGRAM_CHAT_ID}}", + "text": "={{ '📚 Saraswati Database Report\\n\\n' + JSON.stringify($json, null, 2) }}", + "additionalFields": {} + }, + "id": "telegram-report", + "name": "Telegram - Database Report", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1, + "position": [1050, 375], + "credentials": { + "telegramApi": { + "id": "1", + "name": "Telegram API" + } + } + } + ], + "connections": { + "Schedule Trigger - Every 30 min": { + "main": [ + [ + { + "node": "HTTP Request - Database Status", + "type": "main", + "index": 0 + }, + { + "node": "Execute Command - Query Analysis", + "type": "main", + "index": 0 + } + ] + ] + }, + "HTTP Request - Database Status": { + "main": [ + [ + { + "node": "Code - Combine Database Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Execute Command - Query Analysis": { + "main": [ + [ + { + "node": "Code - Combine Database Data", + "type": "main", + "index": 0 + } + ] + ] + }, + "Code - Combine Database Data": { + "main": [ + [ + { + "node": "AI Agent - Saraswati Database", + "type": "main", + "index": 0 + } + ] + ] + }, + "AI Agent - Saraswati Database": { + "main": [ + [ + { + "node": "Telegram - Database Report", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "tags": [], + "meta": { + "description": "Workflow for the Saraswati Database Agent", + "templateCredsSetupCompleted": true + } +}