# Flow RecordLookup Projection Learnings

## 2026-08-10 - Authored field closure was dropped before query execution

- Environment: Test2 Admin inspection `31365043940`, deployed Core
  `9da92bb4444f8020130cbf556565854857082bdc`, L2 metadata
  `495a9e9c8f78a421ec098a55c44f60e71b031714`.
- Workload: synchronous standard-action Flows plus record-event worker Flows on
  wide objects. The worker reached 99-280 seconds of event lag while Runtime
  requests were cancelled inside Flow reads and outbox enqueue.
- Profile: L2 RecordLookup metadata declared a two-field `queriedFields`
  closure, but `FlowRecordLookup` did not deserialize that fact and both the
  direct and batched execution paths omitted `QuerySpec.SelectFields`.
  Persistence therefore selected every visible field, including hundreds of
  computed, audit, and relationship-display fields.
- Correctness impact: a downstream collection RecordUpdate reused the hydrated
  lookup row as its mutation payload, so fields outside the authored closure
  were sent back as writes and failed on computed, audit, or synthetic fields.
- Change under test: preserve the authored neutral field closure on
  `FlowRecordLookup`, bind it to `QuerySpec.SelectFields` on direct and batched
  reads, and include it in cache/coalescing/batch identity. Metadata that omits
  the closure retains the existing all-readable-fields compatibility path.
- Next check: run focused unit and integration coverage, then rerun one Lead
  conversion, one Order action, one CampaignMember attribution journey, and
  one auto-organization journey against the exact release candidate.
