From 85abf58337791fcd12f439904899aaf147134e65 Mon Sep 17 00:00:00 2001 From: stroblme Date: Sun, 16 Aug 2026 11:15:49 +0200 Subject: [PATCH] Count flows rather than nodes in the health report is keyed by node id, so a four-node flow reported four flows. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_011LF61rxW1FG5YCD2J9YqjY --- backend/app/api/routes/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/api/routes/utils.py b/backend/app/api/routes/utils.py index 5a9a562..fa2ba54 100644 --- a/backend/app/api/routes/utils.py +++ b/backend/app/api/routes/utils.py @@ -69,7 +69,9 @@ async def health(request: Request, response: Response) -> dict[str, Any]: redis_info["rtt_ms"] = round((time.perf_counter() - start) * 1000, 1) if not connected: problems.append("redis unreachable") - engine["flows"] = len(getattr(controller, "loaded", {}) or {}) + # `loaded` is keyed by node id, so its length is a node count. + loaded = getattr(controller, "loaded", {}) or {} + engine["flows"] = len({entry.flow for entry in loaded.values()}) engine["nodes"] = len( getattr(getattr(controller, "pipeline", None), "nodes", []) or [] )