Skip to main content
skill GitHub Copilot official · GitHub

salesforce-flow-design — GitHub Copilot skill: Flow design

Reviews Salesforce Flow architecture, type selection, bulk safety, and fault handling. Use it before designing, reviewing, or activating a Flow.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill salesforce-flow-design
Open on GitHub

What salesforce-flow-design does

This skill guides Salesforce Flow choices across Before-save and After-save Record-Triggered, Screen, Autolaunched, Scheduled, and Platform Event–Triggered flows. It also separates cases better handled by a formula field, validation rule, roll-up summary, or Apex. The choice depends on related records, email, callouts, and execution context.

Its review checks for DML and Get Records inside loops, recommends Transform when a collection only needs reshaping, and requires fault connectors on runtime actions. It also checks overlapping Flows, Process Builder rules, Workflow Rules, and Apex triggers. Screen Flow paths are checked for End elements, Back navigation, and input validation.

Install it when Salesforce Flow design or review is part of your work before activation. For high-volume processing, complex multi-object logic, or callouts, Apex is the better direction described by the skill.

What it helps with

  • choose a Salesforce Flow type for a process
  • detect DML inside a Loop
  • move Get Records before the loop
  • add fault paths to data-changing actions
  • review automation overlap before activation

Example prompts for the agent

  • Review this Record-Triggered Flow for DML and Get Records inside Loop, then suggest a bulk-safe structure.
  • Choose the right Flow type for a process that updates related records and sends email.
  • Run a deployment safety review and check every fault connector in this Salesforce Flow.

How to install salesforce-flow-design

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill salesforce-flow-design

2GitHub CLI

gh skill install github/awesome-copilot salesforce-flow-design

3Manually: put the files in place

.github/skills/salesforce-flow-design/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

hermes-tweet Xquik Connects X/Twitter research and gated posting tools to Hermes Agent workflows. Claude Code CX Codex Cursor 2,600installs sign-in-with-google-web official google Guides Google Identity Services setup across web projects. It implements secure token handling and IETF authentication patterns. Claude Code Gemini CLI CX Codex 743installs api-gateway-mcp-server official google Configures Google Cloud API Gateway as a remote MCP server over HTTP. It exposes REST APIs as tools for AI agents using annotated OpenAPI 3.x specs. Claude Code Gemini CLI CX Codex 499installs engineering-advanced-skills Alireza Rezvani An index of 37 engineering skills for architecture, automation, reliability, and platform work. Use it when a project needs task-specific engineering workflows. Claude Code 2,019installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs lark-im larksuite This skill lets an agent work with Lark IM messages, chats, files, and interactive cards. Use it when coding tasks need access to team conversations. Claude Code CX Codex Cursor +1 472,300installs lark-event larksuite Listens to Lark/Feishu events and streams them as NDJSON. Use it for bots, message processing, and long-running subscribers. Claude Code CX Codex Cursor +1 466,200installs

Questions about salesforce-flow-design

How do I install salesforce-flow-design in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill salesforce-flow-design. The skill file is installed at .github/skills/salesforce-flow-design/SKILL.md.

What does salesforce-flow-design do?

It reviews Salesforce Flow type selection, bulk safety, fault connectors, screen paths, and overlapping automation before activation.

When should I use a Before-save Record-Triggered Flow?

Use it when only the triggering record's own fields must change before save. Related records, email, or callouts require an After-save Record-Triggered Flow.

Source text

SKILL.md · MIT
---
name: salesforce-flow-design
description: '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, Scheduled, or Platform Event flows to ensure correct type selection, no DML/Get Records in loops, proper fault connectors on all data-changing elements, and appropriate automation density checks before deployment.'
---

# 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

```
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

```
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

```
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
```
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 on the same `Object` + `When to Run` combination
- Legacy Process Builder rules still active on the same object
- Workflow Rules that fire on the same field changes
- Apex triggers that also run on the same `before insert` / `after update` context

Overlapping automations can cause unexpected ordering, recursion, and governor limit failures. Document the automation inventory for the object before activating.

## Step 6 — Screen Flow UX Guidelines

- Every path through a Screen Flow must reach an **End** element — no orphan branches.
- Provide a **Back** navigation option on multi-step flows unless back-navigation would corrupt data.
- Use `lightning-input` and SLDS-compliant components for all user inputs — do not use HTML form elements.
- Validate required inputs on the screen before the user can advance — use Flow validation rules on the screen.
- Handle the **Pause** element if the flow may need to await user action across sessions.

## Step 7 — Deployment Safety

```
Deploy as Draft    →   Test with 1 record   →   Test with 200+ records   →   Activate
```

- Always deploy as **Draft** first and test thoroughly before activation.
- For Record-Triggered Flows: test with the exact entry conditions (e.g. `ISCHANGED(Status)` — ensure the test data actually triggers the condition).
- For Scheduled Flows: test with a small batch in a sandbox before enabling in production.
- Check the Automation Density score for the object — more than 3 active automations on a single object increases order-of-execution risk.

## Quick Reference — Flow Anti-Patterns Summary

| Anti-pattern | Risk | Fix |
|---|---|---|
| DML element inside a Loop | Governor limit exception | Move DML outside the loop |
| Get Records inside a Loop | SOQL governor limit exception | Query before the loop |
| No fault connector on DML/email/callout element | Unhandled exception surfaced to user | Add fault path to every such element |
| Updating the triggering record in an after-save flow with no recursion guard | Infinite trigger loops | Add an entry condition or recursion guard variable |
| Looping directly on `$Record` collection | Incorrect behaviour at scale | Assign to a collection variable first, then loop |
| Process Builder still active alongside a new Flow | Double-execution, unexpected ordering | Deactivate Process Builder before activating the Flow |
| Screen Flow with no End element on all branches | Runtime error or stuck user | Ensure every branch resolves to an End element |

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor