{"id":"8c5963ca-41ef-4f42-8a98-1bc04b84eeb8","shortId":"2L9gjM","kind":"skill","title":"salesforce-flow-design","tagline":"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 Re","description":"# Salesforce Flow Design and Validation\n\nApply these checks to every Flow you design, build, or review.\n\n## Step 1 — Confirm Flow Is the Right Tool\n\nBefore designing a Flow, verify that a lighter-weight declarative option cannot solve the problem:\n\n| Requirement | Best tool |\n|---|---|\n| Calculate a field value with no side effects | Formula field |\n| Prevent a bad record save with a user message | Validation rule |\n| Sum or count child records on a parent | Roll-up Summary field |\n| Complex multi-object logic, callouts, or high volume | Apex (Queueable / Batch) — not Flow |\n| Everything else | Flow ✓ |\n\nIf 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.\n\n## Step 2 — Select the Correct Flow Type\n\n| Use case | Flow type | Key constraint |\n|---|---|---|\n| Update a field on the same record before it is saved | Before-save Record-Triggered | Cannot send emails, make callouts, or change related records |\n| Create/update related records, emails, callouts | After-save Record-Triggered | Runs after commit — avoid recursion traps |\n| Guide a user through a multi-step UI process | Screen Flow | Cannot be triggered by a record event automatically |\n| Reusable background logic called from another Flow | Autolaunched (Subflow) | Input/output variables define the contract |\n| Logic invoked from Apex `@InvocableMethod` | Autolaunched (Invocable) | Must declare input/output variables |\n| Time-based batch processing | Scheduled Flow | Runs in batch context — respect governor limits |\n| Respond to events (Platform Events / CDC) | Platform Event–Triggered | Runs asynchronously — eventual consistency |\n\n**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.\n\n## Step 3 — Bulk Safety Checklist\n\nThese patterns are governor limit failures at scale. Check for all of them before the Flow is activated.\n\n### DML in Loops — Automatic Fail\n\n```\nLoop element\n  └── Create Records / Update Records / Delete Records  ← ❌ DML inside loop\n```\n\nFix: collect records inside the loop into a collection variable, then run the DML element **outside** the loop.\n\n### Get Records in Loops — Automatic Fail\n\n```\nLoop element\n  └── Get Records  ← ❌ SOQL inside loop\n```\n\nFix: perform the Get Records query **before** the loop, then loop over the collection variable.\n\n### Correct Bulk Pattern\n\n```\nGet Records — collect all records in one query\n└── Loop over the collection variable\n    └── Decision / Assignment (no DML, no Get Records)\n└── After the loop: Create/Update/Delete Records — one DML operation\n```\n\n### Transform vs Loop\nWhen 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.\n\n## Step 4 — Fault Path Requirements\n\nEvery element that can fail at runtime must have a fault connector. Flows without fault paths surface raw system errors to users.\n\n### Elements That Require Fault Connectors\n- Create Records\n- Update Records\n- Delete Records\n- Get Records (when accessing a required record that might not exist)\n- Send Email\n- HTTP Callout / External Service action\n- Apex action (invocable)\n- Subflow (if the subflow can throw a fault)\n\n### Fault Handler Pattern\n```\nFault connector → Log Error (Create Records on a logging object or fire a Platform Event)\n               → Screen element with user-friendly message (Screen Flows)\n               → Stop / End element (Record-Triggered Flows)\n```\n\nNever connect a fault path back to the same element that faulted — this creates an infinite loop.\n\n## Step 5 — Automation Density Check\n\nBefore deploying, verify there are no overlapping automations on the same object and trigger event:\n\n- Other active Record-Triggered Flows on the same `Object` + `When to Run` combination\n- Legacy Process Builder rules still active on the same object\n- Workflow Rules that fire on the same field changes\n- Apex triggers that also run on the same `before insert` / `after update` context\n\nOverlapping automations can cause unexpected ordering, recursion, and governor limit failures. Document the automation inventory for the object before activating.\n\n## Step 6 — Screen Flow UX Guidelines\n\n- Every path through a Screen Flow must reach an **End** element — no orphan branches.\n- Provide a **Back** navigation option on multi-step flows unless back-navigation would corrupt data.\n- Use `lightning-input` and SLDS-compliant components for all user inputs — do not use HTML form elements.\n- Validate required inputs on the screen before the user can advance — use Flow validation rules on the screen.\n- Handle the **Pause** element if the flow may need to await user action across sessions.\n\n## Step 7 — Deployment Safety\n\n```\nDeploy as Draft    →   Test with 1 record   →   Test with 200+ records   →   Activate\n```\n\n- Always deploy as **Draft** first and test thoroughly before activation.\n- For Record-Triggered Flows: test with the exact entry conditions (e.g. `ISCHANGED(Status)` — ensure the test data actually triggers the condition).\n- For Scheduled Flows: test with a small batch in a sandbox before enabling in production.\n- Check the Automation Density score for the object — more than 3 active automations on a single object increases order-of-execution risk.\n\n## Quick Reference — Flow Anti-Patterns Summary\n\n| Anti-pattern | Risk | Fix |\n|---|---|---|\n| DML element inside a Loop | Governor limit exception | Move DML outside the loop |\n| Get Records inside a Loop | SOQL governor limit exception | Query before the loop |\n| No fault connector on DML/email/callout element | Unhandled exception surfaced to user | Add fault path to every such element |\n| Updating the triggering record in an after-save flow with no recursion guard | Infinite trigger loops | Add an entry condition or recursion guard variable |\n| Looping directly on `$Record` collection | Incorrect behaviour at scale | Assign to a collection variable first, then loop |\n| Process Builder still active alongside a new Flow | Double-execution, unexpected ordering | Deactivate Process Builder before activating the Flow |\n| Screen Flow with no End element on all branches | Runtime error or stuck user | Ensure every branch resolves to an End element |","tags":["salesforce","flow","design","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-salesforce-flow-design","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/salesforce-flow-design","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 30743 github stars · SKILL.md body (6,491 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:52:17.254Z","embedding":null,"createdAt":"2026-04-18T21:51:11.415Z","updatedAt":"2026-04-22T00:52:17.254Z","lastSeenAt":"2026-04-22T00:52:17.254Z","tsv":"'1':61,789 '2':167 '200':793 '3':331,853 '4':488 '5':606 '6':692 '7':781 'access':528 'across':778 'action':542,544,777 'activ':352,626,644,690,795,805,854,967,981 'actual':824 'add':915,939 'advanc':757 'after-sav':210,314,928 'alongsid':968 'also':661 'alway':796 'anoth':247,464 'anti':870,874 'anti-pattern':869,873 'apex':130,259,543,658 'appli':49 'architectur':7 'ask':155 'assign':432,473,956 'asynchron':291 'autolaunch':30,249,261 'autom':607,617,672,684,845,855 'automat':241,356,391 'avoid':219 'await':775 'back':593,713,723 'back-navig':722 'background':243 'bad':99 'base':269 'batch':132,270,276,835 'before-sav':190,297 'behaviour':953 'best':85 'branch':710,992,1000 'build':57,141 'builder':641,965,979 'bulk':12,332,416,478 'bulk-saf':477 'calcul':87 'call':245 'callout':126,200,209,329,539 'cannot':80,196,234 'case':174 'caus':674 'cdc':286 'chang':202,305,657 'check':51,343,609,843 'checklist':334 'child':111 'choos':296 'cleaner':484 'collect':370,377,413,420,429,455,951,959 'combin':638 'commit':218 'complex':121,165 'compliant':735 'compon':736 'condit':816,827,942 'confirm':62,159 'connect':589 'connector':503,518,558,906 'consist':293 'constraint':178 'context':277,670 'contract':255 'correct':38,170,415 'corrupt':726 'could':145 'count':110 'creat':360,519,561,601 'create/update':205 'create/update/delete':441 'data':727,823 'deactiv':977 'decis':8,294,431 'declar':78,264 'defin':253 'delet':364,523 'densiti':608,846 'deploy':611,782,784,797 'design':4,23,46,56,69,481 'direct':948 'dml':353,366,382,434,444,878,887 'dml/email/callout':908 'dml/get':42 'document':682 'doubl':973 'double-execut':972 'draft':786,799 'e.g':456,817 'effect':94 'element':359,383,394,468,493,514,573,583,597,707,746,768,879,909,921,989,1005 'els':136 'email':198,208,326,537 'enabl':840 'end':582,706,988,1004 'ensur':37,820,998 'entri':815,941 'error':511,560,994 'event':34,240,283,285,288,571,624 'eventu':292 'everi':53,492,697,919,999 'everyth':135 'exact':814 'except':885,899,911 'execut':864,974 'exist':535 'extern':540 'fail':357,392,496 'failur':340,681 'fault':16,489,502,506,517,553,554,557,591,599,905,916 'field':89,96,120,151,181,311,458,656 'fire':568,652 'first':800,961 'fix':369,400,877 'flow':3,6,9,35,45,54,63,71,134,137,143,171,175,233,248,273,350,485,504,580,587,630,694,702,720,759,771,810,830,868,931,971,983,985 'form':745 'formula':95,150 'friend':577 'genuin':163 'get':387,395,403,418,436,525,891 'goal':451 'governor':279,338,679,883,897 'graph':486 'guard':935,945 'guid':222 'guidelin':696 'handl':17,765 'handler':555 'high':128 'html':744 'http':538 'incorrect':952 'increas':860 'infinit':603,936 'input':731,740,749 'input/output':251,265 'insert':667 'insid':367,372,398,880,893 'instead':469 'inventori':685 'invoc':262,545 'invocablemethod':260 'invok':257 'ischang':818 'key':177 'legaci':639 'lighter':76 'lighter-weight':75 'lightn':730 'lightning-input':729 'limit':280,339,680,884,898 'log':559,565 'logic':125,244,256 'loop':355,358,368,374,386,390,393,399,408,410,426,440,448,472,604,882,890,895,903,938,947,963 'make':199,328 'map':457 'may':772 'messag':105,578 'might':533 'moment':318 'move':312,886 'multi':123,228,718 'multi-object':122 'multi-step':227,717 'must':263,499,703 'navig':714,724 'need':303,320,773 'never':588 'new':970 'object':124,462,566,621,634,648,688,850,859 'one':424,443,461 'oper':445 'option':79,715 'order':676,862,976 'order-of-execut':861 'orphan':709 'outsid':384,888 'overlap':616,671 'parent':115 'path':490,507,592,698,917 'pattern':336,417,474,556,871,875 'paus':767 'perform':401 'platform':33,284,287,570 'prevent':97 'problem':83 'process':231,271,640,964,978 'produc':483 'product':842 'provid':711 'queri':405,425,900 'queueabl':131 'quick':866 'raw':509 're':43 'reach':704 'record':27,100,112,185,194,204,207,214,239,308,324,361,363,365,371,388,396,404,419,422,437,442,520,522,524,526,531,562,585,628,790,794,808,892,925,950 'record-trigg':26,193,213,584,627,807 'recurs':220,677,934,944 'refer':867 'relat':203,206,323 'replac':147 'requir':84,161,491,516,530,748 'reshap':453 'resolv':1001 'respect':278 'respond':281 'reusabl':242 'review':25,59 'right':66 'risk':865,876 'roll':117 'roll-up':116 'rule':107,154,295,642,650,761 'run':216,274,290,380,637,662 'runtim':498,993 'safe':479 'safeti':13,333,783 'salesforc':2,5,44 'salesforce-flow-design':1 'sandbox':838 'save':101,189,192,212,299,316,930 'scale':342,955 'schedul':31,272,829 'score':847 'screen':29,232,572,579,693,701,752,764,984 'select':11,40,168 'send':197,325,536 'servic':541 'session':779 'side':93 'singl':858 'skill':21 'skill-salesforce-flow-design' 'slds':734 'slds-compliant':733 'small':834 'solv':81 'soql':397,896 'source-github' 'standard':18 'status':819 'step':60,166,229,330,487,605,691,719,780 'still':643,966 'stop':581 'stuck':996 'subflow':250,546,549 'sum':108 'summari':119,872 'surfac':508,912 'system':510 'test':787,791,802,811,822,831 'thorough':803 'throw':551 'time':268 'time-bas':267 'tool':67,86 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'touch':322 'transform':446,467,475 'trap':221 'trigger':28,195,215,236,289,307,586,623,629,659,809,825,924,937 'type':10,39,172,176 'ui':230 'unexpect':675,975 'unhandl':910 'unless':721 'updat':179,362,521,669,922 'use':19,173,465,728,743,758 'user':104,157,224,513,576,739,755,776,914,997 'user-friend':575 'ux':695 'valid':14,48,106,153,747,760 'valu':90,459 'variabl':252,266,378,414,430,946,960 'verifi':72,612 'volum':129 'vs':447 'weight':77 'without':505 'workflow':649 'would':725","prices":[{"id":"b1037bde-f6d2-4876-9016-4bfb2a06e114","listingId":"8c5963ca-41ef-4f42-8a98-1bc04b84eeb8","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T21:51:11.415Z"}],"sources":[{"listingId":"8c5963ca-41ef-4f42-8a98-1bc04b84eeb8","source":"github","sourceId":"github/awesome-copilot/salesforce-flow-design","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/salesforce-flow-design","isPrimary":false,"firstSeenAt":"2026-04-18T21:51:11.415Z","lastSeenAt":"2026-04-22T00:52:17.254Z"}],"details":{"listingId":"8c5963ca-41ef-4f42-8a98-1bc04b84eeb8","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"salesforce-flow-design","github":{"repo":"github/awesome-copilot","stars":30743,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-04-21T22:20:21Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"2eece0153a7cea27d7a7c734a7509ab6270aa703","skill_md_path":"skills/salesforce-flow-design/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/salesforce-flow-design"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"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."},"skills_sh_url":"https://skills.sh/github/awesome-copilot/salesforce-flow-design"},"updatedAt":"2026-04-22T00:52:17.254Z"}}