Skip to content

Commit 9b11ba2

Browse files
committed
chore(action): improve category documentation
1 parent 7b3e360 commit 9b11ba2

3 files changed

Lines changed: 42 additions & 60 deletions

File tree

packages/action/README.md

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
- [Run On Push](#run-on-pushpush)
4444
- [Flags](#flags)
4545
- **[Default Rules](#default-rules)**
46+
- [Problems](#problems)
47+
- [Suggestions](#suggestions)
48+
- [Layout](#layout)
4649
- **[Configuration](#configuration)**
4750
- **[Development](#development)**
4851

@@ -136,201 +139,179 @@ Scan all flows on every push to selected branches.
136139
> Want to help improve this project? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)
137140
138141
<!-- START GENERATED_RULES -->
142+
139143
### Problems
140144
141-
### DML Statement In A Loop
142-
Executing DML operations (insert, update, delete) inside a loop is a high-risk anti-pattern that frequently causes governor limit exceptions. All database operations should be collected and executed once, outside the loop.
145+
Rules that detect issues highly likely to cause runtime errors, security risks, governor limit exceptions, or deployment failures.
143146
147+
#### DML Statement In A Loop
148+
Executing DML operations (insert, update, delete) inside a loop is a high-risk anti-pattern that frequently causes governor limit exceptions. All database operations should be collected and executed once, outside the loop.
144149
**Rule ID:** `dml-in-loop`
145150
**Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
146151
**Severity:** 🔴 *Error*
147152
148-
### Hardcoded Id
153+
#### Hardcoded Id
149154
Avoid hard-coding record IDs, as they are unique to a specific org and will not work in other environments. Instead, store IDs in variables—such as merge-field URL parameters or a **Get Records** element—to make the Flow portable, maintainable, and flexible.
150-
151155
**Rule ID:** `hardcoded-id`
152156
**Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
153157
**Severity:** 🔴 *Error*
154158
155-
### Hardcoded Url
159+
#### Hardcoded Url
156160
Avoid hard-coding URLs, as they may change between environments or over time. Instead, store URLs in variables or custom settings to make the Flow adaptable, maintainable, and environment-independent.
157-
158161
**Rule ID:** `hardcoded-url`
159162
**Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
160163
**Severity:** 🔴 *Error*
161164
162-
### Process Builder
165+
#### Process Builder
163166
Process Builder is retired. Continuing to use it increases maintenance overhead and risks future compatibility issues. Migrating automation to Flow reduces risk and improves maintainability.
164-
165167
**Rule ID:** `process-builder-usage`
166168
**Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
167169
**Severity:** 🔴 *Error*
168170
169-
### SOQL Query In A Loop
171+
#### SOQL Query In A Loop
170172
Running SOQL queries inside a loop can rapidly exceed query limits and severely degrade performance. Queries should be executed once, with results reused throughout the loop.
171-
172173
**Rule ID:** `soql-in-loop`
173174
**Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
174175
**Severity:** 🔴 *Error*
175176
176-
### Unsafe Running Context
177+
#### Unsafe Running Context
177178
Flows configured to run in System Mode without Sharing grant access to all data, bypassing user permissions. Avoid this setting to prevent security risks and protect sensitive data.
178-
179179
**Rule ID:** `unsafe-running-context`
180180
**Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
181181
**Severity:** 🔴 *Error*
182182
183-
### Duplicate DML Operation
183+
#### Duplicate DML Operation
184184
When a Flow performs database operations across multiple screens, users navigating backward can cause the same actions to run multiple times. To prevent unintended changes, either restrict backward navigation or redesign the Flow so database operations execute in a single, forward-moving step.
185-
186185
**Rule ID:** `duplicate-dml`
187186
**Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
188187
**Severity:** 🟡 *Warning*
189188
190-
### Missing Fault Path
189+
#### Missing Fault Path
191190
Elements that can fail should include a Fault Path to handle errors gracefully. Without it, failures show generic errors to users. Fault Paths improve reliability and user experience.
192-
193191
**Rule ID:** `missing-fault-path`
194192
**Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
195193
**Severity:** 🟡 *Warning*
196194
197-
### Missing Null Handler
195+
#### Missing Null Handler
198196
Get Records operations return null when no data is found. Without handling these null values, Flows can fail or produce unintended results. Adding a null check improves reliability and ensures the Flow behaves as expected.
199-
200197
**Rule ID:** `missing-null-handler`
201198
**Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
202199
**Severity:** 🟡 *Warning*
203200
204-
### Recursive After Update
201+
#### Recursive After Update
205202
After-save Flows that update the same record can trigger recursion, causing unintended behavior or performance issues. Avoid updating the triggering record in after-save Flows; use before-save Flows instead to prevent recursion.
206-
207203
**Rule ID:** `recursive-record-update`
208204
**Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
209205
**Severity:** 🟡 *Warning*
210206
211207
212-
213208
### Suggestions
214209
215-
### Action Call In A Loop
216-
Repeatedly invoking Apex actions inside a loop can exhaust governor limits and lead to performance issues. Where possible, bulkify your logic by moving the action call outside the loop and passing a collection variable instead.
210+
Rules in this category recommend better patterns and optimizations related to performance, bulkification, trigger behavior, and overall design. Following them improves efficiency and long-term maintainability without affecting correctness.
217211
212+
#### Action Call In A Loop
213+
Repeatedly invoking Apex actions inside a loop can exhaust governor limits and lead to performance issues. Where possible, bulkify your logic by moving the action call outside the loop and passing a collection variable instead.
218214
**Rule ID:** `action-call-in-loop`
219215
**Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
220216
**Severity:** 🟡 *Warning*
221217
222-
### Get Record All Fields
218+
#### Get Record All Fields
223219
Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
224-
225220
**Rule ID:** `get-record-all-fields`
226221
**Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
227222
**Severity:** 🟡 *Warning*
228223
229-
### Inactive Flow
224+
#### Inactive Flow
230225
Inactive Flows should be deleted or archived to reduce risk. Even when inactive, they can cause unintended record changes during testing or be activated as subflows. Keeping only active, relevant Flows improves safety and maintainability.
231-
232226
**Rule ID:** `inactive-flow`
233227
**Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
234228
**Severity:** 🟡 *Warning*
235229
236-
### Invalid API Version
230+
#### Invalid API Version
237231
Flows running on outdated API versions may behave inconsistently when newer platform features or components are used. From API version 50.0 onward, the API Version attribute explicitly controls Flow runtime behavior. Keeping Flows aligned with a supported API version helps prevent compatibility issues and ensures predictable execution.
238-
239232
**Rule ID:** `invalid-api-version`
240233
**Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
241234
**Severity:** 🟡 *Warning*
242235
243-
### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
236+
#### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
244237
Record-triggered Flows without filters on changed fields or entry conditions execute on every record change. Adding filters ensures the Flow runs only when needed, improving performance.
245-
246238
**Rule ID:** `missing-record-trigger-filter`
247239
**Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
248240
**Severity:** 🟡 *Warning*
249241
250-
### Same Record Field Updates
242+
#### Same Record Field Updates
251243
Before-save Flows can safely update the triggering record directly via $Record, applying changes efficiently without extra DML operations. Using before-save updates improves performance
252-
253244
**Rule ID:** `same-record-field-updates`
254245
**Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
255246
**Severity:** 🟡 *Warning*
256247
257-
### Excessive Cyclomatic Complexity
248+
#### Excessive Cyclomatic Complexity
258249
High numbers of loops and decision elements increase a Flow's cyclomatic complexity. To maintain simplicity and readability, consider using subflows or splitting a Flow into smaller, ordered Flows.
259-
260250
**Rule ID:** `excessive-cyclomatic-complexity`
261251
**Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
262252
**Severity:** 🔵 *Note*
263253
264-
### Missing Trigger Order
254+
#### Missing Trigger Order
265255
Record-triggered Flows without a specified Trigger Order may execute in an unpredictable sequence. Setting a Trigger Order ensures your Flows run in the intended order.
266-
267256
**Rule ID:** `unspecified-trigger-order`
268257
**Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
269258
**Severity:** 🔵 *Note*
270259
271-
### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
260+
#### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
272261
Flows that use a String variable for a record ID instead of receiving the full record introduce unnecessary complexity and additional Get Records queries. Using the complete record simplifies the Flow and improves performance.
273-
274262
**Rule ID:** `record-id-as-string`
275263
**Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
276264
**Severity:** 🔵 *Note*
277265
278-
### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
266+
#### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
279267
Loop elements that perform direct Assignments on each item can slow down Flows. Using Transform elements allows bulk operations on collections, improving performance and reducing complexity.
280-
281268
**Rule ID:** `transform-instead-of-loop`
282269
**Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
283270
**Severity:** 🔵 *Note*
284271
285272
286-
287273
### Layout
288274
289-
### Flow Naming Convention
290-
Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purpose—for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.
275+
Rules in this category enforce consistency in naming, documentation, element organization, and visual layout. They help ensure Flows remain readable, well-documented, and structured as automations scale.
291276
277+
#### Flow Naming Convention
278+
Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purpose—for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.
292279
**Rule ID:** `invalid-naming-convention`
293280
**Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
294281
**Severity:** 🔴 *Error*
295282
296-
### Missing Flow Description
283+
#### Missing Flow Description
297284
Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
298-
299285
**Rule ID:** `missing-flow-description`
300286
**Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
301287
**Severity:** 🔴 *Error*
302288
303-
### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
289+
#### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
304290
Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
305-
306291
**Rule ID:** `missing-metadata-description`
307292
**Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
308293
**Severity:** 🟡 *Warning*
309294
310-
### Unclear API Name
295+
#### Unclear API Name
311296
Elements with unclear or duplicated API names, like Copy_X_Of_Element, reduce Flow readability. Make sure to update the API name when copying elements to keep your Flow organized.
312-
313297
**Rule ID:** `unclear-api-naming`
314298
**Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
315299
**Severity:** 🟡 *Warning*
316300
317-
### Unreachable Element
301+
#### Unreachable Element
318302
Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
319-
320303
**Rule ID:** `unreachable-element`
321304
**Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
322305
**Severity:** 🟡 *Warning*
323306
324-
### Unused Variable
307+
#### Unused Variable
325308
Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
326-
327309
**Rule ID:** `unused-variable`
328310
**Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
329311
**Severity:** 🟡 *Warning*
330312
331-
### Missing Auto Layout
313+
#### Missing Auto Layout
332314
Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
333-
334315
**Rule ID:** `missing-auto-layout`
335316
**Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
336317
**Severity:** 🔵 *Note*

packages/action/dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217661,10 +217661,12 @@ _define_property(FlowType, "surveyTypes", [
217661217661
"Survey"
217662217662
]);
217663217663
_define_property(FlowType, "unsupportedTypes", [
217664+
"ActionPlan",
217665+
"UserProvisioningFlow",
217664217666
"CheckoutFlow",
217665217667
"FSCLending",
217666-
"FSCLending",
217667-
"LoyaltyManagementFlow"
217668+
"LoyaltyManagementFlow",
217669+
"JourneyBuilderIntegration"
217668217670
]);
217669217671
_define_property(FlowType, "visualTypes", [
217670217672
"Flow",
@@ -217674,7 +217676,6 @@ _define_property(FlowType, "visualTypes", [
217674217676
"Appointments",
217675217677
"ActionCadenceStepFlow",
217676217678
"ContactRequestFlow",
217677-
"ContactRequestFlow",
217678217679
"CustomerLifecycle",
217679217680
"FieldServiceMobile",
217680217681
"FieldServiceWeb",

packages/action/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)