Skip to content

feat(n8n): keep the alert hub working after the Nexus fleet rebuild - #8

Draft
theonlygeranium wants to merge 1 commit into
mainfrom
cursor/n8n-nexus-bot-bridge-be15
Draft

feat(n8n): keep the alert hub working after the Nexus fleet rebuild#8
theonlygeranium wants to merge 1 commit into
mainfrom
cursor/n8n-nexus-bot-bridge-be15

Conversation

@theonlygeranium

@theonlygeranium theonlygeranium commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

The n8n Alert Aggregation Hub was added before the Nexus Fleet Model rebuild. The workflow itself is still healthy (POST /webhook/tango-alert returns 200), but the new architecture stopped feeding it:

  • Nexus bots publish health.alert on Redis Streams and only logged locally
  • alert_dispatcher.py existed on Schubert with no callers
  • Health Guardian still POSTed DISCORD_WEBHOOK_URL directly

This PR reconnects both caller generations to the same hub schema.

What changed

  • Add scripts/alert_dispatcher.py with send_nexus_health_alert() (maps warning/error/healthy onto n8n severities)
  • Add scripts/nexus_n8n_bridge.py for FleetBot _handle_health_alert
  • Health Guardian prefers n8n, falls back to Discord webhook only if the dispatcher cannot start
  • Scheduler mirrors channel embeds to n8n (Discord channel message kept — different destination)
  • Sanitized workflow JSON (live Discord webhook URL not committed)
  • ADR-017, ADR-018, runbook, architecture, CHANGELOG

Verification

  • pytest tests/test_alert_dispatcher.py — 5 passed
  • Live hub: mapped Nexus payload severity=WARN from nexus:voss → HTTP 200 Alert processed
  • Live hub: raw severity=warning is still rejected by the deployed validate node; the mapper (or importing the updated workflow JSON) is required
  • Outline page n8n Alert Aggregation Hub updated with the 2026-08-22 compatibility note

Schubert follow-up

Live /opt/Project-Tango is ahead of GitHub main (Nexus src/). The mapper and FleetBot hook were also applied on Schubert so the hub works before this PR merges. Discord bots still need a restart to load scheduler.py. Health Guardian picks up on the next timer run.

Do not restart Caddy, Cloudflared, Postgres, Tailscale, or Ollama.

Impact: tango-healthcheck.timer, Discord scheduler, n8n tango-alert workflow
Requires restart: next healthcheck timer run; Discord bots to load scheduler.py

Open in Web Open in Cursor 

The n8n Alert Aggregation Hub was built against the pre-Nexus Discord
fleet. After the fleet rebuild, health.alert events stayed on Redis and
Health Guardian still posted Discord webhooks directly, so the hub went
quiet even though the workflow itself was healthy.

Add alert_dispatcher + a Nexus payload mapper, wire tango-healthcheck
and scheduler, and accept Nexus severity aliases in the workflow JSON.

Impact: tango-healthcheck.timer, Discord scheduler, n8n tango-alert workflow
Requires restart: yes — next healthcheck timer run picks up the script; Discord bots need a restart to load scheduler.py
Verification: pytest tests/test_alert_dispatcher.py; POST /webhook/tango-alert returns 200

Co-authored-by: theonlygeranium <theonlygeranium@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants