Flow Integration Reference
AI funding and usage
AI included uses REDA credits. Bring your own AI uses your organisation’s provider account, billed directly by that provider. The licence selects one funding model for the organisation. In either model, REDA AI governs configured tools and actions in Salesforce. Set up your licence and AI accounts.
Where the Action Lives
In the Flow Builder, add an Action element, then search for “REDA AI” or filter to the Apex action category. The action label is Send Message to REDA AI Agent. It works in any Flow type that supports Apex actions: record-triggered, screen, scheduled, platform-event-triggered and autolaunched.
For step-by-step setup, see Invoking REDA AI from Flows. This page focuses on the contract.
Inputs
Three fields are required; six are optional.
| Field | Required | Type | Purpose |
|---|---|---|---|
| Agent Name | Yes | Text | The Agent ID of the agent that should handle this request (e.g. default-assistant). |
| Record ID | Yes | Text | The Salesforce record providing context. The agent reads this record (and its configured context fields) on the call. |
| Object API Name | Yes | Text | The API name of the Record ID’s object (e.g. Opportunity, Account, Case). |
| Message | Yes | Text | The prompt or instruction sent to the agent. This is what the model treats as the user’s message. |
| Conversation ID | Optional | Text | Pass an existing Conversation ID to continue a multi-turn thread. Omit to start a new conversation. |
| Auto-Execute Actions | Optional | Boolean | If true, the agent’s pending actions execute inline on this call instead of waiting for a confirmation card. Use only on trusted automations — there is no human in the loop on a Flow run. |
| Automated Source | Optional | Text | Free-text identifier (typically the Flow’s name) recorded on the Conversation for audit and analytics filtering. |
| Create Incident on Error | Optional | Boolean | If true, errors create an Incident Log record. If false, errors are returned in the output only and not logged. |
| File Content Version ID | Optional | Text | ContentVersion ID of a file the agent should process on this call. The file is treated like an attachment in a chat conversation. |
| File Content Version IDs | Optional | Text Collection | ContentVersion IDs of one or more files, up to five, for the agent to process on this call. If both this and the single File Content Version ID are supplied, this one takes precedence. |
Outputs
| Field | Type | Purpose |
|---|---|---|
| Success | Boolean | true when the call completed without errors. |
| Response | Text | The agent’s reply text. Empty when the call was routed to async processing. |
| Conversation ID | Text | The Conversation record ID. Pass back on the next call to continue the thread. |
| Credits Used | Decimal | Credits consumed by this call. |
| Action Results JSON | Text | JSON array of action execution results when Auto-Execute Actions was on and the agent proposed actions. |
| Error Message | Text | Populated when Success is false. Contains a user-readable error description. |
| Is Async | Boolean | true when the platform routed the request to background processing — for example, on heavy file workloads. Response will be empty in this case. |
| Async Request ID | Text | The Async Request record ID when Is Async is true. Use it to react to completion via a record-triggered Flow on Async Request status changes. See Async Agent Processing. |
Permissions
The action runs under the user the Flow itself runs under. The running user must be able to:
- Use REDA AI — assigned the REDA AI User permission set (or REDA AI Admin).
- Read the record passed as Record ID.
- Read the agent’s configured context fields on that record.
- Execute any tools the agent will call — tools run as the same user.
- If Auto-Execute Actions is on: write to whatever objects the agent will modify.
For record-triggered and platform-event Flows that run in system context, choose carefully whether system-mode is appropriate — the agent and any tools will inherit that elevated context. For sensitive automations, run the Flow as a specific service user with a tightly-scoped permission set.
Common Flow Patterns
Record-triggered automation
Fire on insert or update of a record (Opportunity, Case, Account, custom object), pass the triggering record’s Id and the agent’s instruction. Useful for AI-summarised case routing, opportunity scoring, lead qualification.
Scheduled automation
A scheduled Flow iterates a set of records and calls the action for each. Useful for daily summaries, periodic enrichment, batch classification. Be mindful of the daily Apex governor budget — one call per record can add up.
Platform-event triggered
A subscriber Flow on a platform event invokes the agent. The classic example is the messaging-channel pattern: an inbound message platform event fires a Flow that calls the agent, then posts the agent’s reply back through an outbound messaging tool. See Messaging Channel Integration for the full pattern.
Screen Flow
An interactive screen Flow lets a user trigger an agent on demand from a button or page action. The Flow runs in the user’s context; rendering the agent’s response back to the user happens through Flow display elements.
Multi-turn within a Flow
For Flows that need several conversational turns, capture the Conversation ID from the first call and pass it back on subsequent calls. The platform threads the turns into one Conversation record.
Error Handling
Always branch on Success after the action element:
true— proceed using Response.false— read Error Message and decide how to recover. Common patterns: retry on a later cycle, set a status field on the parent record, send a notification to an admin.
Use Create Incident on Error to control whether failures end up in the Incident Log:
- Turn it on for production automations where every failure is worth investigating.
- Turn it off for high-volume Flows where individual failures are tolerable and would otherwise create incident noise.
Async Path
For heavy workloads — particularly large file payloads — the platform may route the request to async processing. When that happens, the action returns immediately with Is Async = true and an Async Request ID. The Flow is done; the agent run continues in the background.
To react to async completion, build a record-triggered Flow on Async Request that fires when the record reaches Completed or Failed status, and process the agent’s reply from the linked Conversation. See Async Agent Processing for the full lifecycle.
Bulkification & Governor Considerations
- One agent call per Flow execution. Each invocation of the action is a callout to the model. Flows that fire on bulk DML should pass the records through a loop or a record-triggered Flow per record — bulkifying within a single Flow execution doesn’t batch the model calls.
- Callout governor limits apply. Salesforce caps callouts per transaction. For Flows that may be invoked in bulk, consider the daily callout limit and the per-transaction cap.
- Credit budget. Each call consumes credits. Plan retention and frequency so the org’s monthly credit budget isn’t exhausted by automation traffic.
- Async fallback. If a heavy file payload would exceed synchronous limits, the platform falls back to async automatically. Your Flow should still branch on Is Async for completeness.
Audit & Observability
- Every Flow-driven call produces a Conversation record. Filter the Conversation list by Automated Source equal to your Flow’s name to find runs from a specific automation.
- The Channel on the conversation reflects the agent’s configured channel (typically
APIfor Flow-driven agents). - Failures with Create Incident on Error on land in the Incident Log with the Flow name in the context.
- Use Conversation Debugger on any conversation that didn’t produce the expected outcome.
Configuring the Agent for Flow Use
For an agent to be reachable from Flows:
- Its Channel must include
API. - Tools you want the agent to use from Flow calls must include
APIin their channel scope. - If Auto-Execute Actions will be on, ensure the agent’s toolset is constrained to operations safe to run without human review.
- Consider a dedicated agent for each major Flow use case rather than one general-purpose agent — persona, prompts and toolset are easier to govern that way.
Best Practices
Always set Automated Source. It’s the single most useful field for tracing a conversation back to the Flow that produced it.
Be deliberate about Auto-Execute Actions. Without it, an agent that proposes a write returns a confirmation card — which a Flow has no way to render. Either turn on auto-execute or constrain the agent’s toolset to read-only and pre-approved write tools.
Branch on Is Async in every production Flow. Treating the response as synchronous when Is Async is true leaves the Flow waiting for an answer that never arrives in that call.
Use a service user for sensitive automations. The agent inherits the running user’s permissions. A dedicated service user with a narrow permission set is easier to audit than a Flow that runs as whoever happened to trigger it.
Pass Conversation ID when continuing a thread. Without it, every call looks like a fresh conversation and the agent has no memory across turns.
Test in sandbox before going live. Flows that drive AI calls have surprising failure modes — rate limits, credit exhaustion, async fallback — that don’t show up in unit tests. Run the Flow against representative records in sandbox and verify the Conversation transcripts before promoting.
Automation and reliability
Bulk Flow invocations can return deferred request IDs instead of immediate answers. Review downstream Flow elements that expect response, credits or action-result output in the same transaction. Automated action handling carries the configured channel and execution mode, and retains actual outcomes in conversation context; this does not guarantee an extra narrated turn. Explicit datetime offsets are preserved in supported event, scheduled-action, field-write and CSV paths. Offset-free values retain the running user's interpretation. Routine System-mode processing no longer raises warning incidents merely because it uses that mode; ERROR-level notifications and incident logs remain. File extraction respects the configured output limit, semantic status colours work across the supported Salesforce themes, and packaged tests avoid static Account record-type references that blocked installation in orgs without those record types.
Frequently Asked Questions
Send Message to REDA AI Agent. It’s an Apex action. Searching “REDA AI” in the Action picker also surfaces it.
The action is exposed as an invocable, so any Apex code in your org can call it as well. Process Builder and other tools that consume invocable actions can also use it.
The REDA AI User (or Admin) permission set, plus read access to the context record and the agent’s context fields, plus write access on any object the agent will modify when Auto-Execute Actions is on.
Build a record-triggered Flow on Async Request that fires when the record reaches Completed or Failed status. Read the linked Conversation for the agent’s actual reply and act accordingly.
Yes — each call to the action is independent. Watch governor limits: each call is a callout, so high-volume sequential calls in one Flow can hit per-transaction or daily limits.
Persist the Conversation ID from the first call — typically as a field on the parent record — and pass it back on subsequent calls. The platform appends each turn to the same Conversation record.
For high-volume automations where individual failures are expected and tolerable — e.g. enrichment workflows that simply skip records the model couldn’t classify. For production-critical automations, leave it on so failures are visible.
The action returns Success = false with an error indicating the credit limit. The Flow should branch on Success and either fall back to a non-AI path or surface the issue to an admin.
Next Steps
Read Invoking REDA AI from Flows for the step-by-step setup tutorial, or Messaging Channel Integration for the canonical pattern of using Flows as the bridge to external messaging systems.