fix(workflow): clicking on 'See runs' shows executions from all workflows#16300
Conversation
cf0711a to
d74fb56
Compare
Greptile OverviewGreptile SummaryFixed workflow runs filtering by allowing specific system relation fields ( Changes:
Note: The fix uses hardcoded field names, which is a pragmatic solution for this specific use case but may require similar updates if other system relation fields need filtering in the future. Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant UI as Workflow UI
participant Action as SeeRunsWorkflowSingleRecordAction
participant Filter as availableFieldMetadataItemsForFilterFamilySelector
participant Utils as getFilterFilterableFieldMetadataItems
participant Backend as GraphQL API
User->>UI: Clicks "See runs" button
UI->>Action: Trigger action with recordId
Action->>Action: Build filter query with workflow.IS filter
Action->>UI: Navigate to /objects/workflowRuns with filter params
Note over UI,Filter: Filter Application Phase
UI->>Filter: Request filterable fields for workflowRuns object
Filter->>Utils: Call with isJsonFilterEnabled flag
Note over Utils: BEFORE FIX: workflow field excluded (system field)
Note over Utils: AFTER FIX: workflow field included (whitelisted)
Utils->>Utils: Check field.isSystem
Utils->>Utils: Check if field is 'id' OR 'workflow' OR 'workflowVersion'
Utils->>Utils: Verify MANY_TO_ONE relation type
Utils->>Filter: Return filtered fields (now includes workflow relation)
Filter->>UI: Available filterable fields
UI->>Backend: Query workflowRuns with workflow filter applied
Backend->>UI: Return filtered workflow runs
UI->>User: Display runs only for selected workflow
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where clicking "See All Runs" for a specific workflow was displaying executions from all workflows instead of filtering to the selected workflow. The root cause was that system relation fields (workflow and workflowVersion) were being excluded from filterable fields, preventing proper workflow-specific filtering.
- Added an exception to allow specific system relation fields (
workflowandworkflowVersion) to be filterable - Modified the
isFieldFilterablecondition to include the newisWorkflowRelationFieldcheck alongside existing exceptions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const isWorkflowRelationField = | ||
| field.type === FieldMetadataType.RELATION && | ||
| (field.name === 'workflow' || field.name === 'workflowVersion'); |
There was a problem hiding this comment.
[nitpick] The hardcoded field names 'workflow' and 'workflowVersion' reduce maintainability. If additional system relation fields need to be filterable in the future, this list will need to be manually updated. Consider extracting these field names into a constant array (e.g., FILTERABLE_SYSTEM_RELATION_FIELDS) to centralize the configuration and make it easier to maintain.
Example:
const FILTERABLE_SYSTEM_RELATION_FIELDS = ['workflow', 'workflowVersion'];
const isWorkflowRelationField =
field.type === FieldMetadataType.RELATION &&
FILTERABLE_SYSTEM_RELATION_FIELDS.includes(field.name);| const isWorkflowRelationField = | ||
| field.type === FieldMetadataType.RELATION && | ||
| (field.name === 'workflow' || field.name === 'workflowVersion'); |
There was a problem hiding this comment.
The new isWorkflowRelationField logic lacks test coverage. Given that other utility functions in this module have tests in the __tests__ directory, consider adding test cases to verify that:
- System relation fields named 'workflow' and 'workflowVersion' are correctly identified as filterable
- Other system relation fields remain non-filterable
- Non-system workflow/workflowVersion fields are properly handled
This will prevent regressions and ensure the bug fix continues to work as intended.
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:28306 This environment will automatically shut down when the PR is closed or after 5 hours. |
|
Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
|
Thanks @abk404 for your contribution! |

Fixes: #16229 and #16286
This PR fixes the bug where click on 'See All Runs' button for a specific workflow was not filtering the runs for that speciific workflow.
Reason : The filter logic in
getFilterFilterableFieldMetadataItemswas excluding ALL system fields(except field id) from being filterable, which prevented these essential business relations from being used in filters.Fix : Added a targeted exception to allow specific system relation fields (
workflowandworkflowVersion) to be filterable, similar to how theidsystem field is already whitelisted.Before
Screen.Recording.2025-12-04.at.12.31.36.AM.mov
After
Screen.Recording.2025-12-04.at.12.32.35.AM.mov