Библиотека / Мониторинг, эксплуатация и инциденты
Мониторинг, эксплуатация и инциденты
Диагностика сбойных воркфлоу n8n с помощью Ollama и отправка отчёта в Discord
Работает как обработчик ошибок для других воркфлоу n8n: получает сбойный запуск, скрывает секреты, передаёт его локальной модели Ollama для диагностики и отправляет отчёт в Discord.
Что делает
## Diagnose failed n8n workflows with a local Ollama model and post to Discord ### Who's it for Anyone running n8n who gets failure alerts but still has to open the execution to work out what went wrong, and who wants that analysis to stay on their own hardware. ### How it works 1. Runs as the error workflow for your other workflows, as a sub-workflow called by an existing error handler, or from the test trigger. 2. Fetches the failed execution and the workflow definition through the n8n API. Trigger failures with no execution fall back to the error message. 3. Redacts tokens, JWTs, emails, keyed URLs and webhook URLs before anything reaches the model. 4. Skips repeats: the same workflow, node and error within dedup_hours is diagnosed once, so a failing schedule can't flood the channel. 5. A local model returns schema-checked JSON: what broke, likely cause, suggested fix, fix type, confidence and risk. 6. A Code node checks the model's labels, formats the message and posts it to Discord. Nothing is changed in the failing workflow. ### Setup - n8n API credential (Settings > n8n API) - Ollama reachable from n8n; set ollama_url and model in Build Config - A data table triage_history: text columns fingerprint, workflow_id, workflow_name, failed_node, error_message, execution_id, fix_type, and a date column diagnosed_at. Select it in both data table nodes. - A Discord webhook credential - Set n8n_editor_url, and add your error handler's ID to excluded_workflow_ids - Point workflows' Error workflow setting here, or call it from your error handler (companion template: *Send n8n workflow failure alerts to Discord*) ### Limits Only sees runs that fail. An expression that reads a missing field returns empty and the run succeeds, so add data checks for those. Nodes referenced with $(): Skip Excluded Workflows, Get Failed Execution, Redact and Build Context, Skip Repeat Failures, Format Diagnosis.
Шаги
- On Workflow Error
- Normalize Failure
- Test with Sample Failures
- Sample Failures
- Build Config
- Skip Excluded Workflows
- Get Failed Execution
- Get Workflow Definition
- Redact and Build Context
- Diagnose Failure
- Format Diagnosis
- Post Diagnosis to Discord
- Called by Error Handler
- Get Recent Diagnoses
Всего шагов: 16.
Похожие автоматизации
Мониторинг, эксплуатация и инцидентыОтправка уведомлений о сбоях workflow n8n в Discord и запись в Data TableШагов: 7Чат-боты и боты для мессенджеровЧат с локальными LLM через n8n и OllamaШагов: 3RAG и базы знанийChat with local documents using Ollama and MariaDB Vector cacheШагов: 28Чат-боты и боты для мессенджеровЧат с локальной моделью OllamaШагов: 6