Agentforce Flow Actions — Automate with Salesforce Flows 2026
Flow Actions —
Agent Starts Writing Salesforce Data!
Build Autolaunched Flows and connect them as agent actions. Your XYZ Sales Assistant will create Tasks, update Opportunities, and run multi-step business processes — all triggered by natural language.
1. What Are Flow Actions?
Autolaunched Flows that your agent triggers from conversation
| Aspect | Standard Actions | Flow Actions | Apex Actions (M9) |
|---|---|---|---|
| Who builds it | Salesforce (pre-built) | Admin / Developer | Developer only |
| Code required | None | None (visual Flow) | Yes (Apex) |
| Can write data (DML) | Limited | ✅ Yes — full DML | ✅ Yes — full DML |
| Best for | Common CRUD, email | Multi-step processes, DML with logic | Complex SOQL, callouts |
| Examples | Query, Get Record, Summarize | Create Task, Update Stage, Send notification | SOQL with aggregates, external API |
2. Flow Variables — How Agent Passes Data to Flows
The critical concept — inputs and outputs between agent and Flow
| Variable Setting | What It Means | Required For |
|---|---|---|
| Available for Input ✅ | Agent can pass a value INTO the Flow for this variable | All input parameters (Account name, due date, stage value, etc.) |
| Available for Output ✅ | Flow can pass a value BACK to the agent after running | Results (Task ID, success message, error message) |
| Data Type | Text, Date, Boolean, Record ID — must match what agent collects | All variables |
| Variable Name | This becomes the parameter name the agent sees in Agent Builder | Keep it descriptive: accountName, dueDate, outputMessage |
1. Mark as Required — agent asks user to provide the value if not mentioned
2. Mark as Optional — agent uses default value if user doesn't provide it
3. Auto-populate — agent extracts from conversation context automatically
Example: User says "Create task for ABC Pharma next Monday" — agent extracts accountName="ABC Pharma" and dueDate="next Monday" from the message automatically.
3. Build Flow 1 — Create Follow-up Task
Agent creates a Salesforce Task linked to an Account from conversation
• Label: Find Account
• Object: Account
• Filter: Name Equals {!accountName}
• How many records: First record only
• Store in: New variable "varAccount" (Record type: Account)
• Label: Account Found?
• Outcome 1: "Yes" — condition: varAccount Is Null → equals → False
• Default Outcome: "No" (account not found)
• Label: Create Task
• Object: Task
• Set field values:
• outputMessage = "✅ Follow-up task created for " + {!accountName} + " — due " + TEXT({!dueDate})
• taskId = {!varCreateTask} (the ID returned by Create Records)
• outputMessage = "❌ I couldn't find an account named " + {!accountName} + ". Please check and try again."
All variables visible in Manager panel on left. Flow status shows "Active" after Activate. ✅
๐ Task Details:
• Subject: Follow-up Call
• Account: ABC Pharma Pvt Ltd
• Due Date: Monday, May 25, 2026
• Priority: Normal
Shall I create this task?
You can view it in your Salesforce Activity list. Is there anything else you need?
๐ Stage Update:
• Deal: MedTech - Device Seals Annual Contract
• New Stage: Closed Won ๐
• Amount: ₹18,00,000
Shall I update this opportunity to Closed Won?
₹18,00,000 deal closed — great work! Would you like me to create a handover task or draft a thank-you email to Priya Sharma?
4. Advanced Flow Action Tips
Production-quality patterns for Flow Actions
| Tip | Why | How |
|---|---|---|
| Always return an outputMessage | Agent needs to tell user what happened. Without outputMessage, agent says nothing after Flow runs. | Create outputMessage Text variable (Available for Output). Set it in every Flow path — success AND error. |
| Handle "not found" cases | Users misspell names. Flow must handle missing records gracefully. | Decision element after Get Records → check if result is null → set friendly error in outputMessage |
| Use CONTAINS not EQUALS for name search | Users rarely type exact Salesforce record names. "ABC Pharma" vs "ABC Pharma Pvt Ltd" | In Get Records filter: Name CONTAINS {!accountName} — more flexible than exact match |
| Always require user confirmation | Agents can misinterpret requests — DML is irreversible in most cases | Set "Require Confirmation" = Yes in Action configuration. Agent shows what it will do → user confirms → Flow runs |
| Run Flow in User mode | Security — Flow should respect the current user's sharing rules | In Flow properties → select "Run as" → "User" (not System). This enforces Salesforce sharing model. |
| Keep Flows focused | One Flow = one action. Don't build a "do everything" Flow. | Create Task Flow, Update Stage Flow, Send Email Flow — separate Flows, each connected as separate Action |
5. Troubleshooting Flow Actions
Most common issues — solved
| Problem | Root Cause | Fix |
|---|---|---|
| Flow Action not appearing in Agent Builder picker | Flow is not Activated, OR Flow is not Autolaunched type | Setup → Flows → Find your Flow → Activate it. Verify Flow Type = "Autolaunched Flow" (not Screen Flow) |
| Agent calls Flow but inputs are blank/null | Variables not marked "Available for Input" | Flow → Manager → Variable → Edit → Check "Available for Input" → Save → Re-activate |
| Agent runs Flow but doesn't show result to user | outputMessage variable not marked "Available for Output" | Mark outputMessage as "Available for Output" in Flow variables. Agent reads this variable for the response. |
| Flow fails with "insufficient privileges" | Flow running in System context but underlying record not accessible | In Flow Properties → Run As → select "User" to run with current user's permissions |
| Get Records returns null even though record exists | Filter using EQUALS but user typed partial name | Change filter from "Name Equals" to "Name Contains" {!accountName} |
| Agent asks user for inputs already mentioned | Agent not extracting values from conversation context | In Action configuration, map inputs to "Collect from conversation" — agent extracts from what user said |
6. Flow Actions — Interview Questions
Common Agentforce Flow Action questions
| Interview Question | Best Answer |
|---|---|
| What type of Flow can be used as an Agentforce action? | Only Autolaunched Flows (screen-free). Screen Flows and Record-Triggered Flows cannot be used. Autolaunched = runs in background, receives inputs programmatically, returns outputs to caller. |
| How does an agent pass data to a Flow? | Via Flow Input Variables marked "Available for Input." Agent Builder shows all input variables — you configure each as Required or Optional. Agent extracts values from conversation and passes them to the Flow when calling it. |
| How does a Flow return results to the agent? | Via Flow Output Variables marked "Available for Output." Typically an outputMessage (Text) variable containing a human-readable result. Agent reads this variable and includes it in the response to the user. |
| Why should you always include an outputMessage variable? | Without it, the agent runs the Flow silently — user sees no confirmation. outputMessage provides the success/failure result that the agent communicates back to the user after Flow execution. |
| When would you use Flow Actions vs Apex Actions? | Flow Actions: DML operations, multi-step processes, email sends — no code required, admin-maintainable. Apex Actions: complex SOQL (joins, aggregates), external callouts, complex business logic that can't be expressed in Flow. Try Flow first — use Apex when Flow can't handle it. |
Module 8 Summary
Agent now reads AND writes Salesforce data!
- ✅Flow Actions — Autolaunched Flows called by agent. Agent reads Actions (M7) + writes data (M8). Full CRUD capability!
- ✅Input Variables — "Available for Input" lets agent pass values to Flow. Extract from conversation automatically.
- ✅Output Variables — "Available for Output" lets Flow return results to agent. Always include outputMessage!
- ✅Flow 1 Built — "Create Follow-up Task": finds Account → creates Task → returns confirmation
- ✅Flow 2 Built — "Update Opportunity Stage": finds Opportunity → updates Stage → returns confirmation
- ✅Both Flows Connected — added to Sales Assistant Topic as Flow Actions
- ✅Tested Live — agent created real Task + updated real Opportunity from natural language conversation
- ✅Always use CONTAINS, outputMessage, confirmation, User mode — production Flow Action patterns
✅ Generate AI follow-up emails | ✅ Summarize records | ✅ Create follow-up Tasks
✅ Update Opportunity stages
Module 9 adds Apex Actions — complex SOQL queries with multiple objects, aggregates, and custom business logic. Your agent gets even smarter!
๐ Ready for Module 9?
Next: Apex Actions — Write @InvocableMethod Apex classes your agent calls directly. Complex SOQL with multiple objects, aggregate queries, external callouts, and business logic that Flow can't handle. Your agent becomes a true developer-grade AI assistant!
Module 9: Apex Actions →