Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / Мониторинг, эксплуатация и инциденты

Мониторинг, эксплуатация и инциденты

Диагностика сбойных воркфлоу 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.

Шаги

  1. On Workflow Error
  2. Normalize Failure
  3. Test with Sample Failures
  4. Sample Failures
  5. Build Config
  6. Skip Excluded Workflows
  7. Get Failed Execution
  8. Get Workflow Definition
  9. Redact and Build Context
  10. Diagnose Failure
  11. Format Diagnosis
  12. Post Diagnosis to Discord
  13. Called by Error Handler
  14. Get Recent Diagnoses

Всего шагов: 16.

Похожие автоматизации