--- id: "2f84b73d-4fd9-4046-bdf1-d68d47d6be97" name: "sf CLI: verify flow logic + results" micro_summary: "Pre: sf project retrieve the Flow, read the .flow-meta.xml (mappings, Create-only after-save trigger, entry-filter exclusions, queue-by-DeveloperName lookup). Post: sf data query SOQL that Owner became the queue (Owner.Type=Queue). SO-1024: all 6 mappings verified." status: "resolved" see_also: [] scope: "Use the sf CLI to (pre) confirm a flow's business logic from its metadata XML and (post) confirm the flow's actual effect on records via SOQL." warnings: "`sf ... --json` piped straight into a parser breaks: the CLI prints an \"update available\" banner to stdout before the JSON, causing JSONDecodeError. Redirect the JSON to a file, then parse the file." --- ## PRE — confirm logic from metadata ``` sf project generate --name fc && cd fc sf project retrieve start --metadata "Flow:Case_Assign_Owner_Queue_by_Record_Type" --target-org ``` Read `*.flow-meta.xml` and confirm: - ``: `recordTriggerType=Create` + `triggerType=RecordAfterSave` (fires on create only, never on RT update). - mapping ``/`CASE(...)`: record-type DeveloperName -> queue DeveloperName. - ``: excludes already-owned (`Owner:Queue.DeveloperName != target`) and the Phlebotomy/`Recurring_Response_Outreach` exception. - `Get_Target_Queue`: looks up `Group` where `Type=Queue AND DeveloperName=` (no hardcoded Ids). SO-1024 result: all 6 mappings correct, trigger + filters as specified. ## POST — confirm results ``` sf data query --target-org --json --query \ "SELECT CaseNumber, RecordType.DeveloperName, Owner.Name, Owner.Type FROM Case WHERE Id IN (...)" ``` Pass = `Owner.Type = Queue` and Owner name == mapped queue.