#11847 Use matching key for workflow event step instance lookup
A workflow step instance lookup key is redefined to match the actual filter and sort order, improving query performance from table scans to index seeks on large datasets.
- 2files
- 2AL files
- 2objects
Pull request · merged into main (BC30) on 2026-09-25 by darjoo · 2 files (+3 -2), 2 AL · performance · tier official · reviewed (checked by Opus)
What changed
- Key6 on Workflow Step Instance table changed from (Type, Status, Function Name, Previous Workflow Step ID) to (Type, Status, Function Name, Sequence No.) with Previous Workflow Step ID as included field
- SetCurrentKey call updated to use the redefined key for proper index selection
- Performance improved from 4.26M logical reads and ~3 seconds to index seeks completing in 13-227ms depending on workload
- Existing lookup behavior preserved; sort order unchanged as records come back ordered by Sequence No. then primary key
- On upgrade, Key6 index is dropped and rebuilt, requiring about 6 seconds per 1M table rows
AL objects touched
- Codeunit 1501 “Workflow Management”, Base Application: modified
- Table 1504 “Workflow Step Instance”, Base Application: modified
Context
- Work items: AB#642239
- Labels: Team: Integrations
- Systems: development
Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).