Skip to content

fix(ui): use name instead of id in workflow execution triggered-by alert CEL filter#6236

Open
ahbeigi wants to merge 1 commit intokeephq:mainfrom
ahbeigi:fix/workflow-execution-triggered-alert-link-500
Open

fix(ui): use name instead of id in workflow execution triggered-by alert CEL filter#6236
ahbeigi wants to merge 1 commit intokeephq:mainfrom
ahbeigi:fix/workflow-execution-triggered-alert-link-500

Conversation

@ahbeigi
Copy link
Copy Markdown

@ahbeigi ahbeigi commented Apr 10, 2026

The triggered_by string for Prometheus/alert triggers encodes the alert name as the id value (e.g. type:alert name:JanusHighAudioJitter id:JanusHighAudioJitter). The link was constructed using id=="<value>" as the CEL filter, but the backend maps the id field to the UUID column (lastalert.alert_id). PostgreSQL rejects the query when it receives a non-UUID string against a UUID-typed column — this exception is not caught by the OperationalError guard in query_last_alerts, so it propagates to FastAPI's default error handler → 500.

Fix: filter by name instead of id. The name field maps to a string column via the wildcard DataType.STRING configuration, carries the same value as id for Prometheus alert triggers, and is the correct semantic field to identify an alert by its rule name.

Also adds a unit test for extractTriggerDetailsV2 covering alert trigger parsing and the correct CEL filter construction, including a regression case documenting the broken form.

Closes #6237

📑 Description

  • Fix broken "Triggered by" alert link in Workflow Execution History
  • workflow-executions-table.tsx: id=="${details.id}"name=="${details.name}" in the alert badge href
  • ui-utils.test.ts: new unit tests for extractTriggerDetailsV2

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Before: clicking the "Triggered by" alert badge in Workflow Execution History returns 500 — An internal server error occurred. URL: /alerts/query for any workflow triggered by a Prometheus/Alertmanager alert.

After: clicking the badge opens the Alerts Feed pre-filtered to name=="<alert-name>" with no error.

No breaking changes. No new dependencies.


Note

Low Risk
Small UI-only change to the alerts feed link plus new unit tests; no auth/data-write behavior changes, with low blast radius limited to filtering semantics.

Overview
Fixes the Workflow Execution History “Triggered by” alert badge link to build the Alerts Feed CEL query as name=="<alert-name>" instead of id==..., preventing 500s when the trigger’s id contains a non-UUID alert name.

Adds unit tests for extractTriggerDetailsV2 to cover alert/manual/interval/unknown parsing and a regression assertion documenting why the CEL filter must use details.name.

Reviewed by Cursor Bugbot for commit d302e3e. Bugbot is set up for automated code reviews on this repo. Configure here.

…ert CEL filter

The triggered_by string for Prometheus/alert triggers encodes the alert
name as the id value (e.g. 'type:alert name:JanusHighAudioJitter
id:JanusHighAudioJitter'). The link was constructed using id=="<value>"
as the CEL filter, but the backend maps the id field to the UUID column
(lastalert.alert_id) and fails to cast the alert name string to a UUID,
returning a 500 Internal Server Error.

Fix: filter by name instead of id. The name field maps to a string
column, carries the same value for Prometheus alert triggers, and is the
correct semantic field to identify an alert by its rule name.

Also adds a unit test for extractTriggerDetailsV2 covering the alert
trigger parsing and the correct CEL filter construction.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug Something isn't working javascript Pull requests that update Javascript code UI User interface related issues labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working javascript Pull requests that update Javascript code size:M This PR changes 30-99 lines, ignoring generated files. UI User interface related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Workflow execution triggered-by alert link returns 500

3 participants