We are continuing to dive deeper into the world of Salesforce Flows and explore their potential. đ¤
Learn how to supercharge your Salesforce Flows with Subflows. Discover how to create reusable building blocks and simplify your Flow design, while saving time and avoiding duplicating code. Perfect for admins looking to take their automation skills to the next level.
Watch the video recording here: https://youtu.be/z3SGNkmaiOY
To attend our Salesforce Women in Tech virtual events live - sign up here: https://trailblazercommunitygroups.com/salesforce-women-in-tech-group-columbia-united-states/
Women in Tech - Reuse your Flows with Subflow - May 2023
1. Reuse your Flows
with Subflow
Salesforce Women in Tech Group - Columbia, MD, USA
https://katiekodes.com/subflow-witmd23/
2. What is Flow Builder?
Flow Builder is a point-and-click tool for building flowchart-based code-like logic
(âFlowsâ) that do useful things in Salesforce.
There are 3 main types:
1. Screen
2. Triggered
3. Autolaunched
3. #1: Screen Flows
â Run interactively.
â Run in response to human clicks & typing.
5. #2: Triggered Flows
â Run in the background.
â Background. Via schedule, data edits, âplatform events.âInteractive.
â Run in response to:
â Schedules, or
â Data edits, or
â âPlatform eventsâ
7. #3: Autolaunched Flows
â Run in the background.
â You donât think about WHAT theyâll run in response to when you build them.
(Most commonly, though, they get run fromâŚ)
â other Flows (then itâs a âsubflow!â Thatâs all âsubflowâ means.)
â Apex code
8. Why Subflow / Autolaunched Flow?
To design with âmodularityâ (small, specialized logic clumps):
âAll cooking knives should live in a knife block, not mixed with the spoons.â
1. Tidiness / Readability
2. Maintenance / Reusability
â Edit once, update everywhere
Extreme Subflowing: âBuild every Flow first as autolaunchedâ
â Counterpoint: âD.R.Y. premature optimizationâ
â Counterpoint: (Fast Field Update record-triggered flows get tricky)
9. More âmodularityâ / reusability besides Subflow
â Fetching data (custom metadata, custom settings, or Salesforce object data)
â Packaging
â (If youâve ever installed something from the Unofficial Salesforce blog, thatâs what they do)
10. DEMO: Subflow
Redesign 2 Flows into 3 Flows
(2 parent Flows both calling 1 shared child Subflow)
11. Recognizing Subflow (âmodularityâ) opportunities
1. Copying & pasting inside/between Flows
2. Save As from another Flow
3. If-Then-Else branching with nearly-identical branches
I ⤠paper & 25 colors of highlighter play.
â đ âDRYâ Flows: âDonât Repeat Yourselfâ
â đ âWETâ Flows: âWrite Everything Twiceâ đ
Avoiding overthinking about âDRY:â
â 1 redundancy = life happens
â 2+ redundancies = time to Subflow
13. Advanced subflow: âservicesâ
Not all Autolaunched Flows / Subflows are âservices.â
(Not all tasty cakes are strawberry!)
Only the ones that make no assumptions about how theyâll be âcalledâ are.
1. They never edit data.
2. They avoid ârecordâ-typed input variables (stick to text / number / etc.)
â (Except some Custom Metadata & other very-unique âconfigâ record types can be OK)
3. They always have >= 1 output variable(s).
14. âServiceâ subflow benefits
1. Reuse an Autolaunched Flow in more kinds of Subflow + outside of Flow.
â (A street-address helper should be reusable for Lead, Contact, Account, or no record at all.)
â from a Screen Flow
â from a Record-Triggered Flow
â from an API-driven âfind your sales repâ public website that doesnât edit any data at all
2. Tidier testing. Separate out thinking about:
â âDoes it suggest a value correctly?â from
â âDoes it post the value to Chatter?â / âIs the value displayed beautifully in Screen Flow?â