Jan 28
Order Coffee, Build Flows
Contents
-
Welcome to Flow Coffee
-
The Complete Journey: Your Morning Coffee
-
Variations: Other Ways Automation Happens
-
The Translation Table: Coffee Shop to Flow
-
Bringing It All to Salesforce
-
Summary: Your Flow Foundation
Introduction: Welcome to Coffee Flow
Write your awesome label here.
You walk into your favorite coffee shop on a Tuesday morning. You tap through a tablet screen to order a latte, the system creates your order, and the barista immediately starts making your drink following the exact recipe. Five minutes later, you're walking out with your coffee. Simple, right?
What if I told you that this everyday experience contains everything you need to understand Salesforce Flow?
In my years teaching Flow to thousands of Salesforce Professionals, I've noticed that the technical concepts make sense in isolation, but people struggle to see how Flow Types, Elements, and Resources work together. They understand that Record-Triggered Flows respond to data changes and that Variables store information - but they don't see the complete picture of how these pieces create automation.
That's where the coffee shop comes in. Every time you order coffee, you're watching a perfectly orchestrated automation system in action. The way orders are placed mirrors Flow Types. The steps to make your drink are Flow Elements. The ingredients and recipes are the same as Flow Resources.
You'll never look at your morning coffee the same way - and you'll understand exactly how to build Flows in Salesforce. Let's start with your complete coffee journey.
The Complete Journey: Your Morning Coffee
Write your awesome label here.
It's 6:47 AM. You push open the door to Flow Coffee. Instead of a traditional counter, there's a sleek tablet kiosk waiting for you.
Part 1: Placing Your Order (Screen Flow)
You walk up to the touchscreen kiosk and tap "Start Order."
The screen asks: "Do you have a Flow Coffee account?"
You tap "Yes" and scan your Flow Coffee QR Code. When you scan your QR code, something happens behind the scenes: the system uses a Get Records Element to retrieve your customer profile from the database. It finds your name (Vanessa), your loyalty status (Gold member), your favorite drinks, and your saved preferences.
This Get Records happens instantly as part of the Screen Flow - the system needs your information to personalize the rest of your experience.
Screen 2: Choose Your Drink
Now the magic happens. Because you logged in, the screen displays your favorite drinks at the top:
Below that, all other drinks appear: Cappuccino, Macchiato, Cold Brew, etc.
You tap "Grande Oat Latte."
Screen 3: Customize Your Drink
The system knows you always choose oat milk, so it's already selected. But you can change it if you want:
Screen 4: Enter Your Information
You just need to confirm they're correct.
Screen 5: Review & Pay
The screen shows your complete order with total price: $5.25
You tap "Place Order," complete the payment, and the Screen Flow creates a Coffee Order record in the system.
This is exactly what a Screen Flow does in Salesforce: guide users through multiple screens, collect information with pre-populated data when available, make decisions based on selections, and store input in Variables. When you tap "Place Order," the Screen Flow creates a record - and creating that record can trigger the next automation.
In this example, once the Coffee Order is placed, a Record-Triggered Flow kick in to process the order.
This is a Screen Flow in action. The kiosk guides you through a series of screens, collecting information step by step:
Screen 1: Login
The screen asks: "Do you have a Flow Coffee account?"
You tap "Yes" and scan your Flow Coffee QR Code. When you scan your QR code, something happens behind the scenes: the system uses a Get Records Element to retrieve your customer profile from the database. It finds your name (Vanessa), your loyalty status (Gold member), your favorite drinks, and your saved preferences.
This Get Records happens instantly as part of the Screen Flow - the system needs your information to personalize the rest of your experience.
Screen 2: Choose Your Drink
Now the magic happens. Because you logged in, the screen displays your favorite drinks at the top:
- ⭐ Grande Oat Latte (Your usual)
- ⭐ Iced Americano (Your second choice)
Below that, all other drinks appear: Cappuccino, Macchiato, Cold Brew, etc.
You tap "Grande Oat Latte."
Screen 3: Customize Your Drink
The system knows you always choose oat milk, so it's already selected. But you can change it if you want:
- Size? Grande (pre-selected based on your choice)
- Milk? Oat (pre-selected from your preferences)
- Extras? You add an extra shot today
Screen 4: Enter Your Information
Your details are already filled in because you logged in:
- Name: Vanessa (pre-populated)
- Phone: (555) 123-4567 (pre-populated)
- Email: vannessa@coffeelovers.com
You just need to confirm they're correct.
Screen 5: Review & Pay
The screen shows your complete order with total price: $5.25
You tap "Place Order," complete the payment, and the Screen Flow creates a Coffee Order record in the system.
This is exactly what a Screen Flow does in Salesforce: guide users through multiple screens, collect information with pre-populated data when available, make decisions based on selections, and store input in Variables. When you tap "Place Order," the Screen Flow creates a record - and creating that record can trigger the next automation.
In this example, once the Coffee Order is placed, a Record-Triggered Flow kick in to process the order.
Part 2: Making Your Coffee (Record-Triggered Flow)
Write your awesome label here.
The moment your Coffee Order record is created, automation kicks in.
You didn't have to tell anyone to make your coffee. You didn't press the "Start Making Coffee" button. The instant the Coffee Order record was created by the Screen Flow, a Record-Triggered Flow started automatically.
Behind the counter, the barista's screen lights up with your order:
- Order #247
- Customer: Vanessa
- Drink: Grande Latte with Extra Shot
- Milk: Oat
- Status: Order Confirmed
This is a Record-Triggered Flow - when one record is created or updated (your Coffee Order), it automatically triggers a process (making your coffee). The trigger is the data change itself, not a person clicking a button.
Now let's watch what happens as the Flow executes…
Assignment: Building the Order Values
Before the barista makes your latte, values are being assigned and calculated:
- varCustomerName = "Vanessa"
- varDrinkType = "Latte"
- varDrinkSize = "Grande"
- varMilkType = "Oat"
- varExtraShots = 1
- varTotalPrice = varBaseDrinkPrice + varMilkUpcharge + varExtraShotPrice
This is the Assignment Element - setting and modifying values as the Flow runs. You start with empty variables, assign information to them, calculate totals, and build up the data you'll need. Assignment is how Flows change data temporarily while executing.
Decision: What Type of Coffee?
The barista looks at the order: "Grande Latte." They check: "Is this a Latte, Cappuccino, or Americano?" Based on the answer, completely different steps execute:
- If Latte → Pull espresso shots, steam oat milk, combine, add thin foam layer
- If Cappuccino → Pull espresso shots, steam milk extra dry, equal parts espresso/milk/foam
- If Americano → Pull espresso shots, add hot water
This branching logic is a Decision Element. The Flow checks a condition (drink type) and follows different paths based on the value. Not every order goes through the same steps - that's the power of Decisions.
Constant: The Recipe
How does the system know a latte needs "2 shots + 8oz steamed milk + thin foam"? That recipe is stored as a Constant - a fixed value that never changes. Every latte follows the same recipe whether you make one or a hundred. Constants ensure consistency.
In Salesforce, Constants store things like standard processing fees ($50), maximum discounts (15%), default priorities ("Medium"), or tax rates. Set them once, reference them everywhere, change them in one place when needed.
Formula: Calculating the Price
While making your drink, the system calculates the total cost dynamically:
Base Latte Price + Extra Shot + Oat Milk Upcharge - Gold Member Discount
$4.50 + $0.75 + $0.75 - $0.75 = $5.25
This calculation uses current prices, not hardcoded numbers. If oat milk prices change tomorrow, the formula automatically uses the new price.
This is a Formula Resource - dynamic calculations based on other values. Formulas can do math (total price), manipulate text (FirstName + " " + LastName), work with dates (CloseDate + 30 days), or check conditions (IF amount > 1000, apply discount).
Update Records: Order Status Change
Your latte is ready. The barista places it on the pickup counter, and the system automatically updates your Order record:
Status: "Order Confirmed" → "Ready for Pickup"
Status: "Order Confirmed" → "Ready for Pickup"
This is an Update Records Element - modifying existing records in the database. The order record was created by the Screen Flow; now the Record-Triggered Flow is updating it when the work is complete.
Action: Send the Notification
Your phone buzzes: "Vanessa, your Grande Oat Latte is ready for pickup!"
This is an Action Element - specific operations beyond database changes. Actions can send emails, post to Chatter, submit records for approval, call external systems, or trigger custom code. The Action Element is how Flows communicate beyond just creating and updating records.
Text Template: The Notification Message
That notification wasn't manually typed. It came from a template:
{!varCustomerName}, your {!varDrinkSize} {!varMilkType} {!varDrinkType} is ready for pickup!
Vanessa, your Grande Oat Latte is ready for pickup!
This is a Text Template - formatted text with merge fields that automatically populate with current data. Write the message once, use it thousands of times with different customer names and drink details filling in the blanks. Perfect for emails, confirmations, and notifications.
{!varCustomerName}, your {!varDrinkSize} {!varMilkType} {!varDrinkType} is ready for pickup!
Vanessa, your Grande Oat Latte is ready for pickup!
This is a Text Template - formatted text with merge fields that automatically populate with current data. Write the message once, use it thousands of times with different customer names and drink details filling in the blanks. Perfect for emails, confirmations, and notifications.
Write your awesome label here.
Part 3: Handling Multiple Drinks (Collections and Loops)
But wait - you didn't order just one drink. Your colleague texted asking you to grab coffee for the team, so you went back to the kiosk and added:
- Grande Oat Latte (for you)
- Venti Americano (for your coworker)
- Tall Cappuccino (for your manager)
One order, three drinks. How does the system handle this?
Collection: One Order, Multiple Drinks
Your Coffee Order record contains a Collection - multiple drink line items stored together.
This is a Collection Variable - storage for multiple items of the same type. Collections hold multiple records (all line items on an order), multiple values (a list of email addresses), or multiple selections. You can Loop through Collections to process each item individually.
Loop: Processing Each Drink
The barista doesn't make all three drinks simultaneously. They Loop through the collection:
- Get first drink from collection → Make the Latte → Mark as complete
- Get next drink from collection → Make the Americano → Mark as complete
- Get next drink from collection → Make the Cappuccino → Mark as complete
- All drinks complete → Update order status to "Ready for Pickup"
This is a Loop Element - iterate through each item in a collection, performing the same actions on each one. In Salesforce, you might Loop through all Contacts on an Account to update their mailing addresses, or Loop through all Opportunity Products to calculate a total.
The key concept: Loop through items → process each one → continue until complete. Collections and Loops work together to handle multiple records efficiently.
Choice: What You Selected
Back when you were using the kiosk Screen Flow on Screen 3, how did the system know to offer you "Oat, Almond, Soy" for milk options? Those choices came from a Choice Resource.
The Screen Flow displayed:
- Label (what you saw): "Oat Milk - Plant-based option"
- Value (what system stored): "OAT"
When you selected "Oat Milk," the system stored "OAT" (matching the inventory system's codes).
Choice Resources provide selection options in Screen Flows - radio buttons, picklists, checkboxes. The label is user-friendly, the value is system-friendly. Choices can come from picklists, database records, or manual definitions.
Part 4: Behind the Scenes Maintenance (Scheduled-Triggered Flow)
Before Flow Coffee even opened this morning, automation was already running.
At exactly 5:30 AM, with no one in the building, the system automatically:
No one clicked "Run Morning Prep." No record change triggered this. It happens automatically every single day at the same scheduled time.
This is a Scheduled-Triggered Flow - automation that runs on a predictable schedule (daily, weekly, monthly, at specific times) processing records that meet certain conditions.
The Flow starts at 5:30 AM and processes:
In Salesforce, this might be: "Every Monday at 9 AM, find all Opportunities closing this week and create reminder Tasks" or "Every Friday at 5 PM, find all open Cases older than 7 days and escalate them."
Scheduled-Triggered Flows ensure critical maintenance happens consistently without relying on someone remembering to do it.
At exactly 5:30 AM, with no one in the building, the system automatically:
- Calculated yesterday's sales totals
- Generated today's prep list based on historical patterns
- Created reorder requests for items below threshold
- Sent the daily report to the manager's email
No one clicked "Run Morning Prep." No record change triggered this. It happens automatically every single day at the same scheduled time.
This is a Scheduled-Triggered Flow - automation that runs on a predictable schedule (daily, weekly, monthly, at specific times) processing records that meet certain conditions.
The Flow starts at 5:30 AM and processes:
- All sales records from yesterday (for the daily report)
- All inventory items where quantity < minimum threshold (for reorders)
- All scheduled maintenance tasks for today
In Salesforce, this might be: "Every Monday at 9 AM, find all Opportunities closing this week and create reminder Tasks" or "Every Friday at 5 PM, find all open Cases older than 7 days and escalate them."
Scheduled-Triggered Flows ensure critical maintenance happens consistently without relying on someone remembering to do it.
Variations: Other Ways Automation Happens
The three main Flow Types - Screen, Record-Triggered, and Scheduled - handle most automation needs. But there are two other types worth understanding through quick examples:
The Loyalty Points Calculator (Autolaunched Flow)
When your order completes, the system calculates loyalty points earned. This calculation is complex:
This calculation logic is used in three different places:
Rather than copying this calculation logic three times, it exists as one Autolaunched Flow. The other three processes call this Flow, pass in the order details, get the calculated points back, and continue.
Autolaunched Flows are reusable pieces of logic that other Flows, processes, or code can call. They don't have their own trigger - they're invoked when needed. Think of them as specialized functions: maintained in one place, used everywhere.
Base Points + (Size Multiplier) + (Premium Ingredients Bonus) - (Discount Applied Penalty)
This calculation logic is used in three different places:
- At order completion (to award points)
- In the mobile app (to show projected points)
- In the daily report (to calculate total points awarded)
Rather than copying this calculation logic three times, it exists as one Autolaunched Flow. The other three processes call this Flow, pass in the order details, get the calculated points back, and continue.
Autolaunched Flows are reusable pieces of logic that other Flows, processes, or code can call. They don't have their own trigger - they're invoked when needed. Think of them as specialized functions: maintained in one place, used everywhere.
The Inventory Reorder System (Platform Event-Triggered Flow)
The espresso machine has IoT (internet of things) sensors monitoring bean levels. When beans drop below 10%, the machine sends a signal to the ordering system:
The ordering system receives this event and automatically:
The espresso machine (external system) published an event. The inventory system (Salesforce) responded to it.
This is a Platform Event-Triggered Flow - real-time responses to external systems publishing messages. IoT devices, third-party applications, or other systems can trigger Salesforce automation without anyone manually creating records or clicking buttons.
EVENT: {Machine: "Espresso-01", ItemType: "Beans", Level: 8%, Timestamp: "2024-01-26T08:47:00Z"}
The ordering system receives this event and automatically:
- Creates a reorder request
- Notifies the manager
- Updates the inventory record with expected delivery date
The espresso machine (external system) published an event. The inventory system (Salesforce) responded to it.
This is a Platform Event-Triggered Flow - real-time responses to external systems publishing messages. IoT devices, third-party applications, or other systems can trigger Salesforce automation without anyone manually creating records or clicking buttons.
The Translation Table: Coffee Shop to Flow
Write your awesome label here.
Write your awesome label here.
Write your awesome label here.
Bringing It All to Salesforce
Now let's translate the coffee shop journey into actual Salesforce automation:
Coffee Shop: Customer uses kiosk (Screen Flow) to order → Order creation triggers coffee-making (Record-Triggered Flow) → Daily maintenance runs at 5:30 AM (Scheduled-Triggered Flow)
Salesforce Translation:
Screen Flow: Sales rep uses guided wizard to create Opportunity → Wizard retrieves Account info → Rep enters Products and Amount → Wizard creates Opportunity record
Record-Triggered Flow: Opportunity record creation triggers automation → If Amount ≥ $50,000, create Contract, notify Account Executive, update Account status to "Customer"
Scheduled-Triggered Flow: Every Friday at 5 PM → Find all Opportunities closing next week → Create reminder Tasks for owners
The pattern is identical:
Coffee Shop: Customer uses kiosk (Screen Flow) to order → Order creation triggers coffee-making (Record-Triggered Flow) → Daily maintenance runs at 5:30 AM (Scheduled-Triggered Flow)
Salesforce Translation:
Screen Flow: Sales rep uses guided wizard to create Opportunity → Wizard retrieves Account info → Rep enters Products and Amount → Wizard creates Opportunity record
Record-Triggered Flow: Opportunity record creation triggers automation → If Amount ≥ $50,000, create Contract, notify Account Executive, update Account status to "Customer"
Scheduled-Triggered Flow: Every Friday at 5 PM → Find all Opportunities closing next week → Create reminder Tasks for owners
The pattern is identical:
- Collect information (Screen Flow or external trigger)
- Create/update records (triggers Record-Triggered Flow)
- Automated maintenance (Scheduled-Triggered Flow)
- Elements execute the steps
- Resources store the data
Summary: Your Flow Foundation
Every time you order coffee, you're watching three fundamental Flow concepts in action:
Flow Types answer: "How does this start?"
Flow Elements answer: "What steps happen?"
Flow Resources answer: "What information do I need?"
The secret to mastering Flow isn't memorizing technical definitions - it's understanding how these pieces work together. When you face a business requirement in Salesforce, think about how a coffee shop would handle it:
You've built the foundation. Now every business process you encounter is just another coffee order waiting to be automated.
Flow Types answer: "How does this start?"
- Screen Flow = Guided interaction through screens (tablet kiosk with login and customization)
- Record-Triggered Flow = Automatic response to data changes (order created → process begins)
- Scheduled-Triggered Flow = Time-based automation (daily 5:30 AM maintenance)
- Autolaunched Flow = Called by other processes (loyalty calculator)
- Platform Event-Triggered Flow = External system trigger (machine sensor)
Flow Elements answer: "What steps happen?"
- Get Records = Retrieve customer profile when they login
- Decision = Check drink type, follow different recipe paths
- Loop = Process each drink in the order
- Assignment = Set values: varCustomerName = "Vanessa"
- Create Records = Create the order when kiosk submission completes
- Update Records = Change order: Confirmed → Ready for Pickup
- Action = Send notifications, trigger external processes
Flow Resources answer: "What information do I need?"
- Variables = Temporary data (customer name, order total)
- Collections = Multiple items (three drinks in one order)
- Constants = Fixed values (coffee recipes)
- Formulas = Calculated values (price with current costs)
- Text Templates = Formatted messages (notifications)
- Choices = Selection options (milk types on kiosk)
The secret to mastering Flow isn't memorizing technical definitions - it's understanding how these pieces work together. When you face a business requirement in Salesforce, think about how a coffee shop would handle it:
- How would the process start? (Choose Flow Type)
- What steps would happen? (Select Flow Elements)
- What information is needed? (Create Flow Resources)
You've built the foundation. Now every business process you encounter is just another coffee order waiting to be automated.
Ready to Master Flow Resources?
Understanding what Resources are and when to use each type is one thing. Building Flows that use Resources effectively - choosing the right type, naming them clearly, initializing them properly, and combining them with Elements to create robust automation - that's where real mastery lives.
In the Salesforce Flow Masterclass, you'll build real Flows that use Variables, Collections, Formulas, and Text Templates in practical business scenarios. I'll show you how to design Resource architecture, avoid common mistakes, implement advanced patterns, and debug when Resources don't behave as expected.
Enroll in the Flow Masterclass → Flow Masterclass
Stop guessing which Resource to create. Build Flows that handle data like a pro.
In the Salesforce Flow Masterclass, you'll build real Flows that use Variables, Collections, Formulas, and Text Templates in practical business scenarios. I'll show you how to design Resource architecture, avoid common mistakes, implement advanced patterns, and debug when Resources don't behave as expected.
Enroll in the Flow Masterclass → Flow Masterclass
Stop guessing which Resource to create. Build Flows that handle data like a pro.
Copyright © 2025
Company
-
About
-
Careers
-
Team
-
Contact
Legal
-
Privacy Policy
-
Terms of Use
-
Cookie Policy