# 0024 — Flow — Module Triage

**Milestone:** M3
**Owner:** TBD
**Status:** planning

## Goal

Consolidates 50 legacy issues from the
`MetaDrivenPlatform4AI` repo that share the same module / area label,
so they can be triaged together by the corresponding domain IC.

Module label scope: `module/flow`.

## Acceptance criteria

- [ ] All `ported` children below have a Story or Bug filed in pingcap-pack
- [ ] All filed Stories / Bugs have a linked test (existing or to-write task with scaffold)
- [ ] Engineering review confirms which children are still applicable under the new project's design

## Stories / Bugs (filed as GitHub issues)

50 children classified `ported`. Phase 3/4 will file each as
a Story (capability) or Bug (defect) in this repo and back-reference the
legacy issue. Initial child list:

- [ ] #TBD — legacy MetaDrivenPlatform4AI#1233 — [Feature] Flow List — Filter Panel
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1579 — Flow automation: long-arc strategy for SF migration → Agent-authored flows
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1581 — Agent-era authoring strategy: which NexusCRM modules follow the Flow pattern
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1597 — [RFC] Launch-phase authoring gate: disable "New X" creation until Agent authoring ready
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1744 — Flow activation gap: migrate-workflow-flows converts 16 extras outside activate-flow-wave's scope; leaving them inert
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1748 — migrate-workflow-flows drops emailTemplate config in emailAlert actions (PoC_Status_Change; likely others)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1749 — Flow engine: some AfterSave flows not dispatched despite filter match (OpportunityShareToPersalesOwner; Task_Update_Opportunity_Key_Deal)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1841 — Cross-object copy hooks on insert (Quote←Opportunity; Order←Quote) are hardcoded in generic persistence
- [ ] #TBD — legacy MetaDrivenPlatform4AI#1968 — Flow RecordLookup SQL builder mis-handles complex filterLogic and IsNull=false
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2016 — [Flow] Opportunity_Auto_To_Launch_Stage filter unreachable + POC_Set_Region targets read-only formula field (metadata content; not engine)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2043 — test(flow): add Opportunity_Auto_To_Launch_Stage and POC_Set_Region to regressionFlows
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2044 — test(flow): #1817 staging runnability audit — three FAIL verdicts trace to test-setup gaps; not engine/metadata defects
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2045 — [Flow] F4 followup — add tests/e2e-api/cases case for BeforeSave $Record.<rel>__r.<field> nil-skip (deadline 2026-05-02)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2046 — [Flow] looksLikeVariableReference heuristic false-positive on identifier-shape literals containing dots
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2047 — [Flow] R10 sweep — non-presence-aware read-path resolvers still discard loadRelatedRecord 'resolved' bool
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2052 — fix(flow): date < / > / <= / >= operators silently false on date fields (compareNumbers via ToFloat64)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2053 — fix(flow): SObject formula fields not computed on insert/update — _System_Field Type='formula' silently null
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2093 — fix(flow): 2-hop relation traversal in BeforeSave assignment fails to resolve ($Record.Owner.UserRole.Name) (PR #2057 followup)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2098 — Flow: Lead_Convert_Filed_Set BeforeSave Update does not populate Lead.Opportunity_Name_New__c / Opportunity_Number__c on Convert
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2127 — Flow engine: nested cross-record reference '$Record.Owner.UserRole.Name' silently resolves to NULL → flow assignment writes NULL
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2132 — Flow recordUpdate with implicit-Id filter silently no-ops → Account_PoC_Status's 'Account_Status__c=POC' write never lands
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2180 — Flow trigger dispatcher does N+2K redundant FlowVersion fetches per record save (root cause of staging Opportunity 30s context-cancel in #1817)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2181 — Formula runtime engine breaks SF semantics: IF eagerly evaluates both branches; chained property access on nil throws (no null propagation)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2183 — flow: recordDelete + lookup filtered paths missing PB implicit-Id null semantics (#2174 sibling)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2186 — FlowDefinition / Flow Id generators use Salesforce custom-object KeyPrefix `a0B` instead of `300` / `301` (10 corrupted IDs on staging; still propagating)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2192 — Flow recordUpdate dispatcher: 3 silent-no-op sub-patterns when objectName is null (#2132 followup)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2193 — Localhost schema gap: Opportunity.Service_Start_Date__c column missing but flow Opportunity_Service_Start_Date_Close_Date references it
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2199 — Scheduler retry-storm: Account_Current_Order_Type fails every 5s with 'FlowVersionId: referenced Flow record is not accessible' (Flow row exists)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2213 — Backfill legacy flowdef_std_* / flowver_std_* rows to SF-standard 300/301 prefix (deferred from #2186)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2214 — Add e2e-api case for fix(flow): handle null objectName on recordUpdate + loop var fallback (#2192)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2217 — Scheduler validator: nonpoly_lookup_validator returns 'not accessible' for existing Flow row under system context
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2220 — Flow recordUpdate dispatcher: 2 sub-patterns still silent-no-op after PR #2208 (#2192 followup)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2224 — flow: FlowTriggerListener does not dispatch Cloud_Registration_Source_from_Org_to_Collections on IC create despite correct metadata (#2220 split A)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2225 — flow: Account_PoC_Status myRule_1 decision intermittently routes to default on PoC ApprovalStatus patch (#2220 split B)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2227 — flow: orphan FlowDefinition.ActiveVersionId pointers cause HTTP 500 on every Opportunity Stage PATCH (3 flows on localhost)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2228 — flow: Quote_Account_Opportunity_field FAIL-SILENT — recordUpdate writes 3 NULLs on AfterSave (#2220 Pattern C family)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2231 — flow: Scheduled trigger recordUpdate on $Record silently no-ops — Opportunity_Stage_To_Lunched + Account_status_Flow repro
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2232 — flow scheduler: shouldRunFlow compares UTC schedule string to local-time clock — fires at wrong wall-clock hour on non-UTC hosts
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2233 — flow: engine ignores rule-level conditionLogic expression — '(1 OR 2) AND 3' evaluated as plain AND; FAIL-SILENT class
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2253 — flow: Scheduled $Record recordUpdate silent no-op persists on Opportunity_Stage_To_Lunched after #2245 (sibling of #2231)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2254 — flow: FlowTriggerListener re-entrancy guard skips legitimate sibling record-triggered flows on the same record
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2259 — flow: $Profile.Name and $User.* global variables do not resolve in scheduled / Before/AfterSave flow formula context
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2268 — flow: customError in BeforeSave-Update Lead during atomic convertLead is silently swallowed (#1817 follow-up)
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2269 — test: flow-013-profile-name e2e case uses snake_case 'start_element_reference' creating Active orphan flow that poisons sibling cases
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2277 — [Arch][Flow] Unified FlowRuntimeContext provider — single injection point for $User / $Profile / $Organization / $Flow / $Record
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2278 — [Arch][Flow] TriggerSubscription SSoT derived from flow metadata — eliminate per-object subscribe drift
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2279 — [Arch][Flow] Execution audit trail — convert FAIL-SILENT class into FAIL-LOUD with structured logs
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2280 — [Arch][Flow] SF semantics conformance harness — golden set for formula / IF / IsBlank / date / null-propagation
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2281 — [Arch][Flow] Metadata invariant gate at startup — Flow Id / ActiveVersionId / object-ref / column-ref validation
- [ ] #TBD — legacy MetaDrivenPlatform4AI#2302 — flow: convertLead does not honor Tooling-API-activated BeforeSave-Update Lead validation flow's customError (#2268 follow-up)

## Non-goals

- Re-port legacy fixes that are no longer relevant under the new project's
  pure-platform design — engineering identifies these case-by-case
- Layer-belonging classification (L0 / L1 / L2) — engineering's job

## History

- 2026-05-03 — created during Phase 2 from clustered orphan issues.

## Stories (filed in Phase 3)

_Pending Phase 3 synthesis._
