Skip to content

ref(workflows): Add batch DataConditionGroup lookup#115864

Open
cmanallen wants to merge 3 commits into
masterfrom
cmanallen/workflow-engine-batch-lookup
Open

ref(workflows): Add batch DataConditionGroup lookup#115864
cmanallen wants to merge 3 commits into
masterfrom
cmanallen/workflow-engine-batch-lookup

Conversation

@cmanallen
Copy link
Copy Markdown
Member

Resolves an N+1 query when looking up data condition groups. Trace information here.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 19, 2026
@cmanallen cmanallen marked this pull request as ready for review May 20, 2026 00:34
@cmanallen cmanallen requested a review from a team as a code owner May 20, 2026 00:34
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5fc14d8. Configure here.

Comment thread src/sentry/workflow_engine/models/workflow.py
@@ -156,14 +156,21 @@ def evaluate_workflow_triggers(
# Retrieve these as a batch to avoid a query/cache-lookup per DCG.
data_conditions_by_dcg_id = _get_data_conditions_for_group_by_dcg(dcg_ids)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not use these we've already fetched?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That caches list[DataConditions]. The new variable caches DataConditionsGroup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants