When to use a record-triggered flow
Use one whenever something should happen automatically after a record changes: updating fields, creating related records, sending emails or notifications. Flow has replaced Workflow Rules and Process Builder, which Salesforce has retired for new automation.
Step 1: Create the flow
- Go to Setup → Quick Find →
Flows. - Click New Flow, choose Record-Triggered Flow and click Create.
Step 2: Configure the trigger
- Object: Opportunity.
- Trigger the flow when: A record is created or updated.
- Entry conditions:
StageNameEqualsClosed Won. - When to run: Only when a record is updated to meet the condition requirements, so it fires once, not on every later edit.
- Optimize the flow for: Actions and Related Records, because we are creating a new record.
Step 3: Add the Create Records element
- Click the + below the Start element and choose Create Records.
- Label it Create kick-off task.
- Choose Use separate resources, and literal values and object Task.
- Set the fields:
Field Value Subject Kick-off call with customer WhatId (Related To) {!$Record.Id}OwnerId (Assigned To) {!$Record.OwnerId}ActivityDate (Due Date) A formula resource: TODAY() + 2Priority High
Step 4: Debug and activate
- Click Save and give the flow a name such as Opportunity – Closed Won Kick-off Task.
- Click Debug, pick a test opportunity and simulate the update to Closed Won. Check the debug log for errors.
- Click Activate.
- Test for real in a sandbox: mark an opportunity Closed Won and confirm the task appears under Activities.
Best practices
- One object, few flows: keep automation for each object organized so it is easy to maintain.
- Use entry conditions instead of decisions where possible, so the flow only runs when needed.
- Build in a sandbox, then deploy with a change set or your deployment tool.
- Add fault paths to elements that can fail, and notify an admin.
- Document each flow’s purpose in its description.
Free template
Troubleshooting
| If this happens | Do this |
|---|---|
| The flow never runs | Check it is Activated, the entry conditions match and “When to run” is set correctly. |
| Duplicate tasks are created | Use “Only when a record is updated to meet the condition requirements” so it fires once. |
| A validation rule error appears | The record created by the flow breaks a validation rule; populate the required fields or adjust the rule. |
| Admins receive flow error emails | Open the error email, find the failing element, and add a fault path with a clear notification. |
FAQ
Before-save or after-save: which should I use?
Use “Fast Field Updates” (before-save) to update fields on the same record; use “Actions and Related Records” (after-save) to create or update other records.
Can a flow run later, not immediately?
Yes. Add a Scheduled Path to run actions, for example, 3 days after a record changes.
How do I move a flow to production?
Build and test in a sandbox, then deploy with a change set or your deployment tool and activate it.
What about old Process Builders and Workflow Rules?
Use Salesforce’s Migrate to Flow tool to convert them, then test the new flows carefully.