MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Salesforce-Flow-Design

Salesforce-Flow-Design是一款design方向的AI技能,核心价值是Salesforce Flow architecture decisions, flow type selection, bulk safety validation, and fault handling standards,可用于解决开发者在design领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Salesforce Flow architecture decisions, flow type selection, bulk safety validation, and fault handling standards. Use this skill when designing or reviewing Record-Triggered, Screen, Autolaunched, Sc

Last verified on: 2026-05-30
mkdir -p ./skills/salesforce-flow-design && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/salesforce-flow-design/SKILL.md -o ./skills/salesforce-flow-design/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Salesforce Flow Design and Validation


Apply these checks to every Flow you design, build, or review.


Step 1 — Confirm Flow Is the Right Tool


Before designing a Flow, verify that a lighter-weight declarative option cannot solve the problem:


| Requirement | Best tool |

|---|---|

| Calculate a field value with no side effects | Formula field |

| Prevent a bad record save with a user message | Validation rule |

| Sum or count child records on a parent | Roll-up Summary field |

| Complex multi-object logic, callouts, or high volume | Apex (Queueable / Batch) — not Flow |

| Everything else | Flow ✓ |


If you are building a Flow that could be replaced by a formula field or validation rule, ask the user to confirm the requirement is genuinely more complex.


Step 2 — Select the Correct Flow Type


| Use case | Flow type | Key constraint |

|---|---|---|

| Update a field on the same record before it is saved | Before-save Record-Triggered | Cannot send emails, make callouts, or change related records |

| Create/update related records, emails, callouts | After-save Record-Triggered | Runs after commit — avoid recursion traps |

| Guide a user through a multi-step UI process | Screen Flow | Cannot be triggered by a record event automatically |

| Reusable background logic called from another Flow | Autolaunched (Subflow) | Input/output variables define the contract |

| Logic invoked from Apex `@InvocableMethod` | Autolaunched (Invocable) | Must declare input/output variables |

| Time-based batch processing | Scheduled Flow | Runs in batch context — respect governor limits |

| Respond to events (Platform Events / CDC) | Platform Event–Triggered | Runs asynchronously — eventual consistency |


**Decision rule**: choose before-save when you only need to change the triggering record's own fields. Move to after-save the moment you need to touch related records, send emails, or make callouts.


Step 3 — Bulk Safety Checklist


These patterns are governor limit failures at scale. Check for all of them before the Flow is activated.


DML in Loops — Automatic Fail


text
Loop element
  └── Create Records / Update Records / Delete Records  ← ❌ DML inside loop

Fix: collect records inside the loop into a collection variable, then run the DML element **outside** the loop.


Get Records in Loops — Automatic Fail


text
Loop element
  └── Get Records  ← ❌ SOQL inside loop

Fix: perform the Get Records query **before** the loop, then loop over the collection variable.


Correct Bulk Pattern


text
Get Records — collect all records in one query
└── Loop over the collection variable
    └── Decision / Assignment (no DML, no Get Records)
└── After the loop: Create/Update/Delete Records — one DML operation

Transform vs Loop

When the goal is reshaping a collection (e.g. mapping field values from one object to another), use the **Transform** element instead of a Loop + Assignment pattern. Transform is bulk-safe by design and produces cleaner Flow graphs.


Step 4 — Fault Path Requirements


Every element that can fail at runtime must have a fault connector. Flows without fault paths surface raw system errors to users.


Elements That Require Fault Connectors

- Create Records

- Update Records

- Delete Records

- Get Records (when accessing a required record that might not exist)

- Send Email

- HTTP Callout / External Service action

- Apex action (invocable)

- Subflow (if the subflow can throw a fault)


Fault Handler Pattern

text
Fault connector → Log Error (Create Records on a logging object or fire a Platform Event)
               → Screen element with user-friendly message (Screen Flows)
               → Stop / End element (Record-Triggered Flows)

Never connect a fault path back to the same element that faulted — this creates an infinite loop.


Step 5 — Automation Density Check


Before deploying, verify there are no overlapping automations on the same object and trigger event:


- Other active Record-Triggered Flows o

🎯 Best For

  • Engineering teams doing code reviews
  • Open source maintainers
  • Claude users
  • GitHub Copilot users
  • Designers

💡 Use Cases

  • Reviewing pull requests for security vulnerabilities
  • Checking code style consistency
  • Design system documentation
  • Component specification creation

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Salesforce-Flow-Design to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does this skill check for OWASP Top 10?

Security-focused review skills often include OWASP checks. Check the skill content for specific vulnerability categories covered.

Does Salesforce-Flow-Design generate production-ready design specs?

It generates detailed specifications that developers can use directly. Review and adjust for your specific design system.

How do I install Salesforce-Flow-Design?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/salesforce-flow-design/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Blindly accepting AI suggestions

Always verify AI-generated review comments. Some suggestions may not apply to your specific codebase conventions.

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills