🧠 Réplica del Secretario General (n8n → local)
Carpetas: agentes/sec/, agentes/migrated/ · Backup n8n: backups/n8n-export/ · Estado: ✅ funcionando
Qué hace
Replica los 6 workflows del folder n8n "Secretario General RifKings" (projectId YRXrJhgX6I8xWWXl) como agentes locales, para poder apagar n8n. Cada uno corre en el Mac vía launchd.
Cómo funciona
Los 6 workflows y su réplica local:
| n8n | Local |
|---|---|
| Recordatorios Smart | agentes/migrated/recordatorios-smart.ts |
| Sync Calendar v2 | agentes/migrated/sync-calendar.ts |
| Shopify Pedidos v4 | agentes/migrated/shopify-pedidos-watch.ts |
| Vigilante Envíos 17h | agentes/sec/vigilante-envios.ts |
| Notificador Rutina v4 | agentes/sec/notificador-rutina.ts |
| Router Central v10 | agentes/sec/router-central.ts (cerebro conversacional) |
El Router Central es el cerebro: lo invoca bot-telegram.ts (texto libre → procesar()). Clasifica con IA local (gemini-cli/haiku) y ejecuta: crear/listar/completar tareas (Notion), citas (Google Calendar), pedidos, rutina, carrito proveedor PatinePlus.
Datos/APIs
Notion (DB tareas 32602a86-...), Google Calendar, Shopify, Telegram (bot Sec), catálogo público patineteplus.com.
Cómo probarlo
cd ~/rifai-agents
FORCE=1 npx tsx agentes/sec/vigilante-envios.ts
npx tsx agentes/sec/router-central.ts "crea tarea probar"
Si se rompe / recuperar
- Re-exportar de n8n:
curl -s -H "X-N8N-API-KEY: $(grep N8N_API_KEY .env|cut -d= -f2)" https://rifkings.app.n8n.cloud/api/v1/workflows > backups/n8n-export/all.json - Recargar plists:
com.rifai.vigilante-envios,com.rifai.notificador-rutina, etc. - ⚠️ Sec lo lee SOLO
bot-telegram.ts(nobot-listener): dos lectores del mismo bot se pisan.
Cómo replicarlo
Leer cada JSON en backups/n8n-export/, mapear nodo a nodo a un agente TS, crear su plist en cron/ + cargar en ~/Library/LaunchAgents/. Ver memoria project_sec_department.