General Guidelines

Modular Design & Architecture

Flow Version Management

⚠️ IMPORTANT: Pay attention to the Flow API version

Flow Trigger Explorer Management

⚠️ MANDATORY: Use Flow Trigger Explorer to explicitly set execution order for all Record-Triggered Flows on the same object

Naming Conventions

Flow API Name Pattern

Object-Specific Flows:

[Prefix]_[Object]_[Flow Description]_[Suffix]

Non-Object-Specific Flows:

[Prefix]_[Flow Description]_[Suffix]

The prefix represents the process category or business domain the flow belongs to.

📋 Reference: See the Domain Prefix Mapping Table (Annex I) in the Appendix for the complete list of prefixes.

The suffix represents the type of event:

Examples:


Email Notifications

⚠️ MANDATORY: Use Email Alerts instead of single emails

Error Handling & Logging

Default Error Handling

Uncaught exceptions in flows are automatically captured in the persistent Log Message table via platform events fired by Salesforce. This provides baseline error tracking without additional configuration.

Fault Path Implementation (When Required)

ℹ️ SELECTIVE USE: Fault paths should NOT be added systematically to every element. Only implement fault paths when a business exception is expected and requires special behavior.

When to Add Fault Paths:

Scenario

Reason for Fault Path

Business validation failures

Need to display user-friendly message or redirect flow

Integration callout failures

Need to implement retry logic or fallback behavior

Conditional rollback requirements

Need to partially commit or handle specific DML failures

User notification requirements

Need to alert specific users or teams about the failure

Custom recovery logic

Need to execute alternative business process on failure


When NOT to Add Fault Paths:

Performance & Bulkification

Loop Optimization

🚫 NEVER place DML operations (Create, Update, Delete) inside loops
🚫 NEVER place Get Records inside loops

Correct Pattern:

  1. Collect records in a collection variable within the loop
  2. Perform single DML operation outside the loop


Governor Limit Awareness

Limit Type

Maximum per Transaction

SOQL Queries

100

DML Statements

150

Records Retrieved

50,000

Flow Interviews

2,000

Entry Conditions

⚠️ MANDATORY: Define precise entry conditions to prevent unnecessary flow executions


Record-Triggered Flows - Synchronous & Asynchronous Paths

Bypass Automation Check

⚠️ MANDATORY: Flows at the beginning of execution should verify if they are bypassed

Flows First Approach

Asynchronous Path Limitations

⚠️ IMPORTANT: Only ONE asynchronous flow per object

Test Coverage Requirements

Synchronous Path

Asynchronous Path

⚠️ KNOWN LIMITATION: Due to current Salesforce limitations, the Test.stopTest() method does not function as expected for asynchronous paths of autolaunched flows.

Approach:

Future Benefit: A positive outcome of this approach is that we will have pre-existing unit tests ready for when Salesforce introduces the capability to verify asynchronous flow results in tests.

Record-Triggered Flows - Scheduled Paths

Lead Object Restrictions

⚠️ IMPORTANT: Avoid scheduled paths on the Lead object unless the time offset is very short (a day or less)

Reason: There is a known issue where a Lead cannot be converted if it has pending time-based actions.

Workaround: If an action needs to happen X days after a trigger:

  1. Create a Scheduled Flow running daily
  2. Check if the criteria is met (e.g., if 30 days passed after creation)
  3. Execute the required actions in that scheduled flow

General Scheduled Path Guidelines

Screen Flows

Screen Flows as Preferred Solution

✅ RECOMMENDED: Screen flows and dynamic layouts are the recommended solution over LWC

Assessment Process:

  1. Every new requirement (User Story) should first be assessed to determine if it can be achieved using a no-code solution
  2. If requirements cannot be achieved via screen flow, they should be challenged to assess and provide a simplified proposal using the standard no-coding approach
  3. Only after exhausting no-code options should custom development be considered

LWC Embedding

Test Coverage

ℹ️ NOTE: Screen flows do not require Apex test coverage to be deployed

Flow Test Coverage Summary

When Test Coverage is Required

Flow Type

Test Coverage Required

Notes

Record-Triggered (Synchronous)

✅ Yes - Mandatory

Full assertions required to deploy as active

Record-Triggered (Asynchronous)

✅ Yes - Coverage only

No assertions due to platform limitations

Record-Triggered (Scheduled Path)

✅ Yes - Coverage only

Similar limitations as async

Screen Flow

❌ No

Cannot be tested via Apex

Scheduled Flow (Schedule-Triggered)

❌ No

Not required by Salesforce

Platform Event-Triggered

❌ No

Not required by Salesforce

Autolaunched (Subflow)

⚠️ Depends

Covered when parent flow is tested


ℹ️ Note: Salesforce only requires test coverage for Record-Triggered Flows to deploy them as active. Other flow types (Scheduled Flows, Platform Event-Triggered Flows, Screen Flows) do not require Apex test coverage for deployment.

Test Coverage Best Practices


Important: Apex Tests vs Flow Tests

⚠️ CRITICAL DISTINCTION: Salesforce offers two types of flow testing, but only one counts for deployment:

Test Type

Counts for Coverage

Runs During Deployment

Apex Tests (test classes that trigger flows)

✅ Yes

✅ Yes

Flow Tests (point-and-click tests in Flow Builder)

❌ No

❌ No


Flow Tests created in Flow Builder are useful for manual validation and debugging, but they:

Therefore, Apex test classes are required to achieve the coverage needed for deploying Record-Triggered Flows as active.

Documentation Requirements

Flow Description

Every flow MUST include a clear description explaining what the flow does:

This flow validates the billing address format for Account records when they are created or updated. 

It checks for required address fields and standardizes the format before saving.

Keep descriptions:

Element Descriptions

Anti-Patterns to Avoid

❌ DO NOT: