Lightning Flow Scanner Demo Repository

January 19, 2026 ยท View on GitHub

This directory contains sample Salesforce Flows used to demo Lightning Flow Scanner rules.

You can:

  • Use these flows to demo scanner output.
  • Deploy them to an Org for integrated tests.

Demo Flows

These flows demonstrate common violations detected by Lightning Flow Scanner rules:

Flow NameRule DemonstratedDescription
Action_Call_In_A_LoopAction Call In LoopDemonstrates action calls inside a loop that can exhaust governor limits. Best practice: bulkify by collecting data in the loop, then make a single action call with a collection.
DML_Statement_In_A_LoopDML Statement In LoopShows DML operations (create/update/delete) inside a loop, a high-risk anti-pattern that frequently causes governor limit exceptions.
Duplicate_DML_OperationDuplicate DML OperationIllustrates how database operations across multiple screens can execute multiple times when users navigate backward.
Excessive_Cyclomatic_ComplexityCyclomatic ComplexityHigh-complexity flow with many loops and decision elements that reduce maintainability.
FlowNamingConventionFlow Naming ConventionFlow with a non-descriptive name that doesn't follow organizational naming standards.
Get_Records_Stores_All_FieldsGet Record All FieldsGet Records element retrieving all fields unnecessarily, impacting performance and exposing unnecessary data.
Hardcoded_IdHardcoded IdFlow using hardcoded record IDs that are unique to a specific org and won't work in other environments.
Hardcoded_UrlHardcoded URLFlow containing hardcoded Salesforce URLs that break when migrated between sandboxes and production.
Inactive_FlowInactive FlowFlow marked as inactive that may need review or activation.
Invalid_API_VersionInvalid API VersionFlow using an outdated API version.
Missing_Auto_LayoutMissing Auto LayoutFlow not using auto-layout canvas mode.
Missing_Fault_PathMissing Fault PathFlow without fault path connectors for proper error handling.
Missing_Flow_DescriptionMissing Flow DescriptionFlow lacking a description for documentation and maintainability.
Missing_Null_Handler_SimpleMissing Null HandlerGet Records element without null checks, risking errors when no records are found.
Missing_Trigger_OrderMissing Trigger OrderRecord-triggered flow missing trigger order configuration.
Recursive_After_UpdateRecursive After UpdateAfter-update trigger flow that can cause infinite recursion by updating the triggering record.
Same_Record_Field_UpdatesSame Record Field UpdatesFlow updating the same record field multiple times inefficiently.
SOQL_Query_In_A_LoopSOQL Query In LoopSOQL queries placed inside a loop, risking governor limit exceptions.
Unclear_API_NameUnclear API NameFlow with copied elements retaining similar API names like "Copy_1_of_Assignment", reducing readability.
Unreachable_ElementUnreachable ElementFlow with elements that cannot be reached from the start element.
Unsafe_Running_ContextUnsafe Running ContextFlow configured to run in System Mode without Sharing, potentially exposing unauthorized data.
Unused_VariableUnused VariableFlow declaring variables that are never referenced or used.

Testing Flows

The force-app/testing/ directory contains additional flows used for integration tests, including both violation examples and fixed versions for testing auto-fixes and edge cases.

Getting Started

To deploy the Demo Flows using the Salesforce CLI:

sf project deploy start --source-dir force-app