# architect Fundamentals - Full Documentation
## Overview
### Purpose and Scope
Agents reason over goals, infer parameters from context, and select actions dynamically. As a result, every integration an agent touches must handle ambiguity, support safe repetition, and fail in ways the agent can recover autonomously.
Agentic systems invalidate several assumptions that traditional integration design takes for granted. Inputs won't always be well-formed. A single user action may spawn a chain of agents across organizational boundaries, each of which needs delegated authority to act.
This document maps the architectural shifts that follow from that reality: the new design principles, the agentic patterns, and how the Salesforce platform delivers them.
### Pattern Template
Each pattern in this document follows the same structure:
**Name**: The pattern identifier that indicates the type of integration contained in the pattern.
**Context**: The overall integration scenario that the pattern addresses. Context provides information about what users are trying to accomplish and how the application behaves to their needs.
**Problem**: The challenge (expressed as a question) that the pattern is designed to solve. When reviewing the patterns, read this section to quickly understand if the pattern applies to your integration scenario.
**Forces**: The constraints and circumstances that can make the problem difficult to solve.
**Salesforce Pattern Application**: The recommended way to apply the pattern to the scenario.
**Sketch**: A Unified Modeling Language (UML) sequence diagram that shows how the pattern application addresses the scenario.
**Results**: How the pattern resolves the forces associated with the scenario. This section also contains new challenges that can arise as a result of applying the pattern.
**Design Considerations:** Platform-agnostic guidance for applying the solution correctly, followed by Salesforce-specific implementation notes. These considerations cover action design principles and platform-specific configuration requirements.
**Error Handling and Recovery:** Guidance for managing failures during pattern application. This parameter covers four areas:
- How actions communicate failure to the agent through structured, actionable error responses that provide sufficient context for downstream decision-making
- How the agent determines whether to retry, self-correct, or halt execution
- How compensation actions address partial outcomes and mismatched cross-platform state
- Idempotency requirements for retired write operations
**Security Considerations:** Security requirements for applying the pattern safely. These considerations cover credential management, least-privilege scoping of integration users and connected apps, audit logging of agent-invoked actions, and input validation requirements for parameters that originate from user-provided or LLM-inferred content, among others.
**Example:** An end-to-end scenario that describes how the design pattern is used in a real-world Salesforce scenario. The example explains the goals and how to apply the pattern to achieve those goals.
### Pattern Summary
The following table lists the implementation patterns covered.
**List of Patterns**
| Pattern | What it Does |
| :--------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Sequential Action Invocation](#sequential-action-invocation-outbound) | An agent invokes a series of actions where each step depends on the verified result of the previous one. The agent maintains context across the chain like identifiers, status codes, intermediate data and uses it to decide whether the next step can proceed. |
| [Parallel Action Invocation](#parallel-action-invocation-outbound) | When a set of actions are independent of each other, the agent invokes them concurrently rather than in sequence. Total workflow time is bound by the slowest call rather than the sum of all calls. |
| [Asynchronous Action Invocation](#asynchronous-action-invocation-outbound) | An agent dispatches an operation to a downstream system via a platform event, message queue, or background job without waiting for the outcome. The agent's obligation ends at confirmed invocation; the downstream system takes ownership of execution independently of the agent session. |
| [On-Demand Agent Invocation](#on-demand-agent-invocation-inbound) | An external application or AI orchestrator calls an agent programmatically, supplies context, and waits for a structured response. The agent acts as an intelligent backend service that the caller initiates, the agent reasons and acts, and the result is consumed by the caller. |
| [Autonomous Event-Driven Agent Execution](#autonomous-event-driven-agent-execution-inbound) | A data condition like cart abandonment, payment failure, usage drop autonomously fires an agent without any human initiating the interaction. There is no caller waiting for a response; the agent receives the event payload as grounding context and executes a response workflow entirely on its own. |
| [Knowledge Grounding from Enterprise Content](#knowledge-grounding-from-enterprise-content-outbound) | Before generating a response, the agent retrieves relevant documents from an enterprise knowledge store and injects them into its context window. The LLM supplies the reasoning; the retrieval layer supplies the facts. |
| [Verified Customer Context Injection](#verified-customer-context-injection-outbound) | Verified, structured attributes from a unified customer profile are pre-populated as action inputs before the agent invokes an action. The agent receives facts like segment, tier, churn risk, and lifetime value rather than inferring them. |
| [Cross-System Tool Integration](#cross-system-tool-integration-outbound) | An agent connects to external systems outside the Salesforce platform through a uniform tool interface based on the Model Context Protocol (MCP) standard. Each external system exposes its capabilities as described, callable tools; the agent discovers and invokes them without needing to know each system's native API or schema. |
| [Business Capabilities as Callable Tools](#business-capabilities-as-callable-tools-inbound) | Enterprise business capabilities like business entities, processes, and insights are exposed as MCP tools that any external agent on any framework can discover and invoke. |
| [Cross-Agent Delegation](#cross-agent-delegation-outbound) | A calling agent decomposes a complex request and delegates domain-specific sub-tasks to specialized peer agents on different platforms or vendor systems using the Agent-to-Agent (A2A) protocol. The calling agent manages the task lifecycle and aggregates results from the remote agents. |
| [Agents as Callable Services](#agents-as-callable-services-inbound) | An internal Agentforce agent publishes its domain capabilities as a governed, discoverable A2A endpoint so external orchestrators or peer agents can delegate tasks to it. The agent manages the incoming task lifecycle and returns structured results to the remote caller. |
### Pattern Approach
The patterns in this document are classified into three categories. This categorization helps architects quickly identify which patterns are relevant to the integration challenge they are solving whether they are designing what an agent calls, what triggers an agent, or how an agent is grounded with knowledge before it acts. Rather than reading every pattern, you can navigate directly to the category that matches your design concern.
**Action Invocation:**
These patterns cover how an agent calls out to external systems to retrieve data or execute operations as part of its reasoning cycle. These are outbound patterns where the agent is the initiator. They address sequencing (when steps depend on each other), parallelism (when they don't), idempotency, and partial failure handling. Use these patterns when designing the tools an agent will invoke to get work done.
**Agent Invocation:**
These patterns address how external systems or events bring an agent into action. These are inbound patterns where external systems trigger these agents. The trigger may be a human-facing application making a programmatic call and waiting for a response, or an autonomous data condition that triggers the agent. Use these patterns when designing how and when an agent is triggered.
**Grounding with Enterprise Data:**
The patterns in this category cover how agents are grounded with accurate, current, organization-specific knowledge before it reasons or acts.
Choosing the right strategy isn’t trivial. Each pattern targets a specific concern: system capabilities, data volume, failure handling, and transactionality.
### Pattern Selection Guide
The selection matrix tables list the patterns and their key aspects to help you determine which pattern best fits your integration requirements. The patterns are categorized using these dimensions.
| Aspect | Description |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Type | Specifies the category of integration: **Action Invocation, Agent Invocation,** or **Grounding with Enterprise Data** **Action Invocation:** These outbound integrations range from simple single-step tool calls to complex multi-step sequences and parallel fan-outs, and require careful consideration of ordering constraints, idempotency, and partial failure handling across heterogeneous backends. **Agent Invocation:** Agent invocations are the ways external systems or events bring an agent into action. These inbound integrations span from synchronous programmatic calls made by human-facing applications that await a structured response, to fully autonomous event-driven executions where a data condition triggers the agent without any human initiating or waiting on the interaction. **Grounding with Enterprise Data:** Grounding integrations are the ways an agent is supplied with accurate, current, organization-specific knowledge before it reasons or acts. These integrations range from retrieving unstructured documents from enterprise content stores to injecting verified structured attributes from unified customer profiles, ensuring the agent operates on facts rather than hallucinated inference. |
| Timing | Specifies the style of integration based on timing: **Synchronous** or **Asynchronous** Synchronous vs. Asynchronous in this document refers to how the agent itself is triggered, or how it invokes the actions. It doesn’t cover what happens internally. But in general, a user waits during the time the agent is invoking actions and processing results. The agent won't address the next user message until it has finished the current turn. **Synchronous**: Blocking and real time requests are request/response operations. The result is returned to the caller immediately via this operation. **Asynchronous**: Nonblocking, queue, or message-based requests are invoked by a one-way operation which are near-realtime. The results and any faults are returned by invoking other one-way operations. The caller therefore makes the request and continues without waiting for a response. |
This table lists the patterns and their key aspects to help you determine which pattern best fits your requirements when your integration is from Salesforce to another system.
| Type | Timing | Key Pattern to Consider |
| :----------------------------- | :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Action Invocation | Synchronous | [Sequential Action Invocation](#sequential-action-invocation-outbound) [Parallel Action Invocation](#parallel-action-invocation-outbound) [Cross-System Tool Integration](#cross-system-tool-integration-outbound) [Cross-Agent Delegation](#cross-agent-delegation-outbound) |
| Action Invocation | Asynchronous | [Asynchronous Action Invocation](#asynchronous-action-invocation-outbound) |
| Agent Invocation | Synchronous | [On-Demand Agent Invocation](#on-demand-agent-invocation-inbound) [Agents as Callable Services](#agents-as-callable-services-inbound) |
| Agent Invocation | Asynchronous | [Autonomous Event-Driven Agent Execution](#autonomous-event-driven-agent-execution-inbound) |
| Grounding with Enterprise Data | Synchronous | [Knowledge Grounding from Enterprise Content](#knowledge-grounding-from-enterprise-content-outbound) [Verified Customer Context Injection](#verified-customer-context-injection-outbound) |
Each section of patterns describes how to build them. Each pattern is a repeatable solution to a specific integration problem in agentic architectures. It covers when to use the pattern, what forces shape the decision, and how the Salesforce platform delivers it.
## Sequential Action Invocation (Outbound)
**Context**
Many business workflows are inherently sequential – each step requires a verified result from the previous one before it can proceed. For example, a refund can't be initiated until eligibility is confirmed, a billing account can't be created until the order record exists, and a compliance check can't be logged until the check has passed.
In traditional automation, these dependencies are encoded as hardcoded flow logic. In an agentic system, the agent evaluates the result of each action and determines whether the preconditions for the next step have been met.
This pattern describes the foundational outbound integration model. Here, a single agent operates within one domain and invokes a sequence, where each action’s output gates the invocation of the next action in the chain. The orchestrating agent maintains transactional context across the chain, accumulating identifiers, status codes, and data returned by each step. It uses this context to drive subsequent decisions.
This pattern is the agentic counterpart to [Remote Process Invocation – Request and Reply](https://architect.salesforce.com/docs/architect/fundamentals/guide/integration-patterns#remote-process-invocation--request-and-reply) from the Integration Patterns guide which describes a single synchronous callout. The agentic pattern extends the pattern to an agent-driven chain of dependent calls within a single reasoning cycle.
**Problem**
When an agent executes a multi-step workflow that spans the host system and one or more remote systems, four challenges must be addressed:
- **Sequencing** \- Actions must be invoked in the correct order, with each step gated on the successful completion of the previous one.
- **Data Propagation** \- Response data from each step must be passed as input to the next.
- **Failure Isolation** \- Failures at any point in the chain must not produce partial or inconsistent state across systems.
- **Completion Verification** \- The agent must confirm that all steps have completed successfully before reporting a result.
**Forces**
When applying this pattern, answer the following questions:
- Does each action in the chain depend on data returned by the preceding action, or are the dependencies only on success or failure status?
Data dependencies require the agent to carry identifiers and attributes across steps.
- Are all remote endpoints capable of responding within the agent’s reasoning cycle timeout?
A slow external system at any step in the chain blocks the entire sequence.
- Does the chain require complete end-to-end success, or is partial completion acceptable?
- If full end-to-end success is required, define a compensation strategy for steps that need to be rolled back when a downstream failure occurs.
- Can any of the write operations in the chain be retried safely?
All write actions must be idempotent; the agent’s reasoning loop may invoke the same action more than once due to Large Language Model (LLM) retries or ambiguous confirmations.
- Is the chain invoked by a user interaction (conversational, low concurrency) or by an automated trigger (potentially high concurrency)?
This determines whether synchronous blocking is acceptable or whether an async pattern is required.
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| ---------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Apex Actions | Best for external callouts and complex logic | A step requires an HTTP callout to a remote system, custom data transformation, or error handling logic that exceeds Flow’s declarative capabilities. Apex actions expose the full platform for integration while remaining callable by the agent via the @InvocableMethod annotation. |
| Flow Actions (Autolaunched) | Best for business rule steps and lightweight CRM operations | A step applies declarative business logic, queries or updates CRM records, or orchestrates a process that does not require custom code. Autolaunched Flows are natively callable from Agentforce subagents and return typed output variables the agent uses to determine the next step. |
| External Services (OpenAPI Import) | Best for typed, discoverable external API integration | An external system exposes an OpenAPI specification. External Services generates strongly-typed Apex stubs that are directly callable as agent actions, eliminating manual schema mapping and making the external API’s operations visible to the agent as named capabilities. Each operation in the imported spec becomes a named, callable action. The agent selects actions based on their generated semantic labels. Register generated actions in the Agentforce Topic Center so the agent can discover them at reasoning time. **Note**: if the externally hosted service is RESTful, but OpenAPI spec is not available or viable, use Named Credentials in Apex or Flows to make the HTTP callout directly. Apex code is needed to parse the results. |
| MuleSoft connected actions | Best for complex middleware fan-out or legacy system integration | Use when the remote system requires protocol translation, data transformation, or orchestration across multiple backend systems before returning a response. The agent makes a single callout to MuleSoft, and MuleSoft handles the downstream complexity and returns a unified response. |
**Sketch**
_Sequence Diagram for Sequential Action Invocation_
**Results**
The agent executes a cross-system workflow as a coherent, supervised sequence and not a fire-and-forget script. Each step’s result is evaluated before the next step is invoked, so the agent detects failures at the earliest possible point instead of discovering partial completion after the fact.
The host system (Salesforce CRM) is updated only after the remote operation has confirmed the status (success or failure). Identifiers and state returned by external systems, like billing account numbers, transaction IDs, confirmation codes are propagated through the chain and persisted, creating a complete, traceable record of the workflow outcome.
The agent is responsible for reasoning over results and sequencing decisions. Each action is responsible only for its own operation and for returning a structured result. Neither layer encodes the other’s logic.
**Design Considerations**
Platform-agnostic Guidance
- Make sure that each action in the chain carries a semantic description written in intent-based language and not as a technical method signature. The agent selects actions based on these descriptions. A description that reads "calls the billing API" is less useful than one that reads "creates a billing account in the billing system and returns the new account identifier."
- Make all write operations in the chain idempotent. The agent’s reasoning loop may retry an action if it receives an ambiguous response. The action must produce the same outcome on repeated invocation.
- Validate all LLM inferred input parameters defensively at the action boundary. Never assume that parameters passed by the agent are well formed, within range, or of the expected type.
- Design each action for a single responsibility. An action that creates a billing account and sends a confirmation email in the same call is harder to retry, harder to test, and harder for the agent to reason over than two discrete actions.
Salesforce Implementation Notes
- **For Apex Actions**, annotate with @InvocableMethod(label=’...’ description=’...’). The “description” is read by the agent to determine when to invoke the action. Declare all input and output variables with @InvocableVariable using descriptive “label” and “description” fields. Return structured result objects with explicit success/failure indicators and human-readable error messages.
- **For Flow Actions**, use Autolaunched Flows exclusively; screen flows aren’t supported in autonomous agent contexts. Keep each flow atomic; one action, one responsibility. Configure fault paths on every external callout element to catch integration errors and return actionable error messages to the agent instead of letting uncaught exceptions terminate the session.
- **For External Services**, import the target system’s OpenAPI specification and register the generated actions in the Agentforce Topic. Wrap the generated stubs in Named Credentials to avoid hardcoding endpoints or credentials in the action definition.
- **For all external callouts**, set explicit callout timeouts. A callout that hangs without a timeout will block the agent’s reasoning cycle until the session limit is reached. Return a graceful failure with a descriptive error message when the timeout is exceeded. All external callouts have a configurable timeout of up to 120 seconds. They're also subject to Apex synchronous transaction governor limits, so make sure to mitigate the risk of instantiating more than 50 transactions that run for more than five seconds each.
**Error Handling and Recovery**
- The agent gates each step on the explicit success of the step’s predecessor. Actions must return a structured result that includes a clear success or failure indicator. The agent can't reliably infer failure from a missing or null response alone.
- When an action fails, the agent uses the error message returned by the action to determine its next move: prompt the user for corrected input, attempt a self-healing retry with adjusted parameters, or halt the chain and log the failure for human review. Therefore, error messages must be specific and actionable: "Invalid date range: endDate cannot precede startDate" is usable; 400 status code alone is not.
- For chains where partial completion creates inconsistent state (for example, the billing account was created but the CRM record was not updated), the agent invokes a compensation action to roll back or flag the partial state before surfacing the failure. Design compensation paths as named actions alongside the forward path.
- If a write action potentially succeeded, but returned an ambiguous response (network timeout, no acknowledgment), the retry must use the same idempotency key or external reference ID as the original call. Never issue an unchecked retry on a non-idempotent write.
**Security Considerations**
- Wrap all external callouts in named credentials. Never hardcode endpoints or credentials in Apex code or Flow configurations. These must be managed through the platform’s secure credential store and rotated without code changes.
- Apply the least-privilege principle to the integration user or connected app used by each action. An action that only reads order data shouldn't hold write permissions on the billing system. Scope credentials to the minimum operations the action requires.
- Log the invocation of each action in the chain with its session ID, input parameters (sanitized of sensitive values), and outcome. If the result is disputed, this audit trail is the primary mechanism for reconstructing why the agent executed a given sequence of actions.
- Sanitize all input parameters that originate from user-provided text before passing them to external systems. User input passed through the agent into an external API callout is a potential injection vector. Validate type, format, and range at the action boundary before the callout is made.
**Example**
A customer service agent handling a refund request executes a four-step sequential chain:
1. `GetOrderDetails` (Apex Action) retrieves the order record from the Order Management System using the order ID provided by the user. It returns order status, line items, purchase date, and payment method. The agent evaluates whether the order is in a refundable state before proceeding.
2. `ValidateRefundEligibility` (Autolaunched Flow) applies the business rules for refund eligibility, including return window, product category restrictions, and prior refund history. It returns an “eligible” boolean and, if ineligible, a plain-language reason the agent can surface to the user.
3. `InitiateRefund` (Apex Action) calls the external payment gateway API with the order ID and refund amount. Returns a “refundTransactionId” on success. This action is idempotent. If called a second time with the same order ID, it returns the existing transaction ID rather than creating a duplicate refund.
4. `UpdateCaseStatus` (Autolaunched Flow) updates the CRM case record with the refund transaction ID, sets the case status to "Resolved Refund Issued," and creates a follow-up task for the account owner. This step executes only after “InitiateRefund” has returned a confirmed transaction ID.
If `InitiateRefund` times out or returns an error, the agent halts the chain, does not invoke `UpdateCaseStatus`, and surfaces an actionable message to the user. The case remains open and unresolved, preserving accurate state in the CRM.
## Parallel Action Invocation (Outbound)
**Context**
Sequential action chains are efficient when execution steps are dependent on each other. One step gates the next. But many workflows contain a set of steps that have no interdependencies. For example, steps that include retrieving product inventory, fetching customer entitlements, and checking a shipping estimate can all happen simultaneously, as no step’s input requires the output of another. Executing these steps sequentially wastes time proportional to the number of steps.
In a parallel invocation pattern, the agent identifies that a set of actions are independent and invokes them concurrently rather than in sequence. The overall workflow time is bound by the slowest individual action rather than the sum of all action times. Once all results are returned, the agent aggregates them into a single coherent response or uses them together as inputs to the next stage of reasoning.
The key architectural challenge isn't the parallel invocation itself. It's managing fan-out within platform concurrency constraints and ensuring that the aggregation step handles partial failures gracefully, without discarding the results that did succeed.
**Problem**
How does an agent efficiently orchestrate the simultaneous execution of multiple, independent capabilities and aggregate the individual results into a single, cohesive response for the user or subsequent steps?
**Forces**
When applying this pattern, answer the following questions:
- What are the considerations for actions regarding thread safety and sharing of mutable state?
- How will the solution manage and avoid hitting Salesforce governor limits for parallel Apex callouts within a single transaction?
- Is there a need to use asynchronous patterns (like Queueable Apex or Platform Events) to avoid governor limits?
- Is synchronous aggregation of the results required before the agent can proceed?
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| ------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Middleware Approach | Best for high fan outs (\>5 endpoints) and cross-platform aggregation | You need a middleware layer. The agent makes one callout to the middleware. Then, the middleware fans that out to 10 systems in parallel, aggregates the data, and sends a single response back to the agent. This is preferred when the agent must call many heterogeneous external systems. The middleware absorbs fan-out complexity and returns a single aggregated response. |
| Queueable Apex | Best for Salesforce internal parallelism | You need to fire multiple queueable jobs. While Salesforce manages the queue, if you have enough "slots" in your concurrency limit, these can execute at the same time.Use when parallel operations are within the Salesforce org and concurrency slots are available. This isn't suitable when immediate aggregated response is required. |
| Platform Events | Best for fire-forget or eventual consistency | Results don't need to be aggregated synchronously. Each event triggers an isolated transaction, maximizing throughput but requiring downstream reconciliation. Use this mechanism when eventual consistency is acceptable and throughput is more important than response latency. |
**Sketch**
_Sequence Diagram for Parallel Action Invocation_
**Results**
When independent actions are executed in parallel, the end-to-end workflow time is bound by the slowest individual action rather than the sum of all actions. For a workflow with three independent callouts averaging 300 ms each, parallel execution completes in \~300 ms; sequential execution takes \~900 ms. At scale, this difference compounds across every agent session running concurrently.
**Design Considerations**
Platform-agnostic Guidance
- Confirm independence before parallelizing. Actions are safe to run in parallel only if neither action reads the state written by the other, and neither action's failure should cancel the other. If a dependency exists, even a soft one, use sequential chaining instead.
- Design the aggregation step explicitly. Define in advance what a complete result set looks like, what a partial result set means for downstream reasoning, and whether the agent should wait for all results or proceed once a threshold (for example, five out of seven total calls) has returned.
- All parallel write operations must be idempotent. Each operation runs in isolation without a shared transaction boundary, so retrying any individual branch cannot duplicate side effects.
Salesforce Implementation Notes
- **For Queueable Apex:** Submit all jobs within a single transaction to maximize the chance of concurrent execution. Be aware that available concurrency slots are shared across the org; design with the assumption that slots may not always be available and build a fallback to sequential execution when they’re not.
- **For Platform Events:** Write each operation's result to a dedicated staging record (keyed by a shared correlation ID) rather than updating the target record directly. A final aggregation Flow or Apex trigger reads all staging records once the expected count is reached, then applies the consolidated update atomically.
- **For Middleware Fan-Out:** Set an explicit timeout on the single callout that’s longer than the expected worst-case response time of the slowest backend, but still within the Salesforce callout timeout limit. The middleware returns partial results with a clear indication of which backends failed, rather than timing out the entire response.
**Error Handling and Recovery**
- Treat partial success as a first-class outcome. If three or four parallel operations succeed, the agent uses the three successful results and handles the failure explicitly surfacing it to the user, logging it for retry, or invoking a compensating action rather than discarding all results or proceeding as if the failure didn’t occur.
- For Queueable and Platform Event patterns, use a correlation ID (generated at the point of fan-out) to link all parallel branches back to the originating agent session. This ID is required to reassemble results and to trace failures back to their source in logs.
- If a parallel branch fails and the operation is safe to retry, re-queue only the failed branch using the original correlation ID and idempotency key. Don’t re-invoke all branches.
- Define a timeout threshold for the aggregation step. If not all results arrive within the threshold, proceed with available results and flag the incomplete set instead of waiting indefinitely.
**Security Considerations**
- Each parallel execution context, whether a queueable job, a platform event trigger, or a middleware callout, must apply the same access controls as a sequential callout. Parallelism does not relax data access rules. Each branch must operate under the same least-privilege credential as it would if invoked alone.
- For middleware fan-out, the middleware layer doesn't cache or log response payloads from individual backends beyond the aggregation window. Each backend's response may contain sensitive data that shouldn't persist outside the scope of the immediate operation.
- Ensure that the staging records used for platform event aggregation are not readable by the agent's end user. These records may contain intermediate, partially-formed data that is not yet fit for consumption.
**Example**
A service agent answers a complex fulfillment question: "Can you ship this order to me by Friday?" The answer requires data from all the independent systems simultaneously, as explained below:
1. The agent identifies three independent data needs: the current inventory level, the customer's active entitlements, and the carrier's estimated delivery window for the customer's location.
2. Three actions are invoked in parallel: `GetInventoryStatus` (from the external inventory system via middleware), `GetCustomerEntitlements` (from Salesforce CRM), and `GetDeliveryEstimate` (from the carrier API via middleware).
3. Each action returns independently. The agent waits until all three responses are received (or the aggregation timeout is reached).
4. With all three results available, the agent reasons over the combined data, assessing whether inventory is sufficient, the customer's entitlement covers express shipping, and the carrier confirms Friday delivery is feasible for the customer's postcode.
5. The agent returns a single, grounded answer to the user, drawn from three systems, in the time it took the slowest of the three calls to respond.
## Asynchronous Action Invocation (Outbound)
**Context**
Some agent-initiated operations do not produce a result the agent needs to continue its current reasoning cycle. Sending a notification, triggering a downstream batch process, publishing an event to a message queue, or submitting a long-running job are all operations where the agent's obligation ends at dispatch; the downstream system takes ownership and completes the work independently.
In traditional automation, these are modeled as fire-and-forget callouts or platform event publishes. In an agentic system, the agent decides during reasoning that the operation is non-blocking, dispatches it, records confirmation of dispatch, and continues or concludes the turn without waiting for the downstream outcome.
This pattern is the agentic counterpart to [Remote Process Invocation – Fire and Forget](https://architect.salesforce.com/docs/architect/fundamentals/guide/integration-patterns#remote-process-invocation--fire-and-forget) from the Integration Patterns guide. The agentic pattern extends it by making the dispatch decision part of the agent's reasoning, and by ensuring the dispatch is traceable even though no response is returned to the agent.
**Problem**
When an agent needs to initiate a downstream operation that runs beyond the agent's session or reasoning cycle, three challenges must be addressed:
- **Non-blocking Invocation:** The agent must fire the operation and confirm delivery without holding the reasoning cycle open waiting for a result.
- **Delivery Confirmation:** The agent must distinguish between a successful dispatch (the message was accepted) and a successful outcome (the downstream process completed). It can only assert the former.
- **Traceability:** Because the agent receives no result, the operation must be observable through logs, event records, or platform monitoring independent of the agent session.
**Forces**
When applying this pattern, answer the following questions:
- Does the agent need the result of this operation to complete its current turn?
If yes, this is not the right pattern. Use Sequential Action Invocation instead.
- Is the downstream system capable of receiving and reliably processing the dispatched message or event without a synchronous acknowledgment?
The target system must be durable. It must not lose the message if it is temporarily unavailable.
- Is the operation idempotent or does duplicate dispatch need to be guarded?
Network-level retries and agent reasoning retries can cause the same dispatch to be attempted more than once. If the downstream operation is not idempotent, the action must carry a deduplication key.
- Does the user or a downstream process need to know when the operation completes?
The agent can only confirm dispatch. If completion status is required, design a separate notification or follow-up mechanism. A Platform Event, a case update, or a callback \- which is outside this reasoning cycle.
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| ------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Pub/Sub API | Best for high-throughput or external event streaming | The agent invokes an Apex action that publishes an event to the Salesforce Pub/Sub API over gRPC. The action returns a `PublishResult` replayId to the agent as confirmation of dispatch. Use when the downstream consumers are external systems subscribing via the Pub/Sub API rather than Salesforce-native Flow or Apex triggers, or when high-throughput event streaming is required. |
| Platform Events (Apex Action) | Best for intra-Salesforce async dispatch | The agent invokes an Apex action that publishes a Platform Event. The event is delivered to all subscribers asynchronously. The action returns a publish confirmation to the agent; it does not return a processing outcome. Used when the downstream consumer is within the Salesforce platform. The agent invokes an Apex action that calls `EventBus.publish()`. The action returns a `SaveResult` confirming acceptance. |
| Apex Queueable / Batch (Apex Action) | Best for long-running background processing | The agent invokes an Apex action that enqueues a Queueable or Batch job. The job runs outside the agent's transaction. The action returns a job ID the agent can surface to the user as a reference. Used when the downstream work is a long-running Salesforce operation data processing, multi-object updates, or external callouts that exceed synchronous limits. `System.enqueueJob()` returns a job ID the agent records as a reference. |
| MuleSoft Async Flow | Best for external message queue dispatch | The agent invokes a MuleSoft-exposed action that places a message on an external queue (Kafka, JMS, SQS). MuleSoft handles protocol translation and delivery acknowledgment. The agent receives confirmation that the message was accepted by MuleSoft, not that it was processed downstream. |
| External REST Endpoint (Apex Action) | Best for external system event submission | The target system exposes an endpoint that accepts a submission and returns an acknowledgment ID immediately, completing processing asynchronously. The agent receives the acknowledgment ID and records it. |
**Sketch**
_Sequence Diagram for Asynchronous Action Invocation_
**Results**
The agent invokes a downstream operation without blocking its reasoning cycle on the outcome. The turn completes with confirmation that the operation was accepted, not that it completed. The downstream system takes full ownership of execution. The dispatched operation is traceable through platform event subscribers, job IDs, or external queue acknowledgment IDs that are recorded in the CRM at dispatch time. If the downstream operation fails, that failure is surfaced through the downstream system's own monitoring, not through the agent session that initiated it.
**Design Considerations**
Platform-agnostic Guidance
- Write action descriptions in intent-based language. For example, "Submits a renewal notification to the messaging queue and returns a dispatch reference ID" is more useful to the agent than "calls the notification endpoint."
- Never describe a dispatch action as "sends and confirms delivery of." The agent can only confirm acceptance. Downstream delivery and processing are outside the agent's observability.
Salesforce Implementation Notes
- Return a reference ID from every invocation action for example a Platform Event `ReplayId`, a Queueable job ID, a Pub/Sub API `PublishResult` replayId, or an external acknowledgment token. Record it in a CRM record at invocation time. This is the only audit trail the agent session will produce.
- For Pub/Sub API, the agent invokes an Apex action that makes a gRPC callout to the Pub/Sub API ‘/Publish’ endpoint. The action must handle the schema registration step \- events must be serialized in Avro format against the registered schema. Return the `PublishResult ‘replayId’` to the agent as the dispatch reference.
- For Platform Events, call `EventBus.publish()` inside the Apex action and check the SaveResult for errors before returning a success indicator to the agent. Do not assume publish success; validate it.
- For Queueable Jobs, implement the Queueable interface and call System.enqueueJob() from within the action. Return the resulting AsyncApexJob ID to the agent.
- For external async endpoints, the target endpoint must return an acknowledgment immediately (HTTP 202 Accepted) with a reference ID. If the endpoint blocks until processing is complete, it’s synchronous and this pattern does not apply.
**Error Handling and Recovery**
- An invocation action must distinguish between dispatch failure (the message was not accepted) and processing failure (the message was accepted but the downstream operation failed later). The agent can only handle the former.
- If invocation fails, the action must return a structured failure with a clear reason. The agent can retry the dispatch, escalate to a human, or log a failed dispatch record, but it cannot recover a downstream processing failure within the same session.
- For operations where downstream failure must eventually be surfaced, design a separate feedback loop like a Platform Event published by the downstream process, a scheduled flow that checks job status, or a follow-up case which are outside the agent session.
**Security Considerations**
- Wrap all external async callouts in named credentials. The invocation action doesn’t embed endpoint URLs or credentials in code.
- Validate and sanitize all parameters passed to the invocation action before they are embedded in the event payload or message body. User-supplied text passed into an async message is a potential injection vector in the downstream consumer.
- Log every dispatch with session ID, reference ID, and sanitized payload at the time of dispatch. Because no response returns to the agent, this log is the primary mechanism for reconstructing what the agent initiated.
- Apply least-privilege to the integration user or connected app. A dispatch action that publishes to a notification queue should not hold credentials that permit reads or writes on unrelated systems.
**Example**
A renewal management agent handling a contract approaching expiration determines that the customer qualifies for an auto-renewal notification. The agent does not need confirmation that the email was delivered before concluding the turn.
1. `CheckRenewalEligibility` (Autolaunched Flow) evaluates contract terms, customer tier, and opt-out status. Returns an "eligible" boolean and the preferred notification channel.
2. `DispatchRenewalNotification` (Apex Action) publishes a `RenewalNotification\_\_e` Platform Event containing the contract ID, customer ID, notification channel, and a generated idempotency key. Returns a ReplayId confirming the event was accepted by the platform.
3. `UpdateContractRecord` (Autolaunched Flow) writes the `ReplayId` and dispatch timestamp to the Contract record and sets a "Notification Dispatched" status flag.
## On-Demand Agent Invocation (Inbound)
**Context**
External applications like customer portals, mobile apps, third-party SaaS platforms, and partner systems, need to invoke agents programmatically to handle service requests, initiate workflows, or surface AI-driven responses within their own interfaces. The agent acts as an intelligent backend service. The external system provides context, the agent reasons and acts, and the caller consumes the response.
Increasingly, the caller is itself an AI agent or orchestrator rather than a human-facing application. In these AI-to-AI patterns, an orchestrating agent delegates a reasoning step, CRM lookup, or action to Agentforce as a discrete tool call. We need to expose a Model Context Protocol (MCP) server to support this pattern.
**Problem**
When an external system or AI agent needs to leverage an Agentforce agent's capabilities on demand, how does it authenticate, create an agent session, pass the necessary conversational and contextual data, and reliably receive the agent's structured response to drive its own downstream logic?
**Forces**
When applying this pattern, answer the following questions:
- Is the external caller expecting a synchronous, low-latency response, or is an asynchronous callback acceptable?
- How is the caller's identity established and propagated into the agent's execution context for data access and personalization?
- What’s the expected volume of concurrent API-triggered sessions, and how does that interact with Salesforce API rate and concurrency limits?
- Does the external system need to maintain session continuity across multiple turns (multi-turn conversation), or is each request stateless?
- How should the agent's response be structured so that the calling system can parse and act on it programmatically?
- Is the caller a human-facing application requiring direct REST integration, or an AI agent or orchestrator that can invoke Agentforce as a tool via a standard protocol, such as MCP?
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| ------------------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agentforce Agent API \- Single-Turn (Synchronous) | Best for stateless, request-response integrations | The calling system requires an immediate, structured response and the agent's reasoning is expected to complete within the caller's timeout tolerance. The calling system manages the full session lifecycle phases \- creation, turns, and termination. The external system authenticates, creates a session with context variables, sends a single message, receives the agent's response, and closes the session. This Agentforce API is the primary REST interface through which external systems create sessions, exchange messages, and close sessions programmatically. The entire exchange completes within one HTTP request-response cycle. Responses include the agent's natural-language output and any structured output variables produced by actions the agent invoked during reasoning. |
| Agentforce Agent API \- Multi-Turn (Session Continuity) | Best for conversational integrations requiring state across turns | The external interface is conversational (for example, a chat widget or voice interface) and the interaction requires multiple exchanges to reach a resolution. The external system creates a session once and reuses the session ID across multiple message exchanges. The agent retains conversational context between turns like prior questions, retrieved data, decisions made without the caller re-supplying it. |
| Asynchronous with Polling or Webhook Callback | Best for high-latency reasoning workflows or time-sensitive UIs | The agent processing time is non-trivial and holding an open HTTP connection would degrade the caller's user experience or trigger upstream timeouts. The external system submits the request and immediately receives an acknowledgment with a job or session ID. It then polls a status endpoint or registers a webhook to receive the agent's response when reasoning is complete. Currently, this pattern can be implemented with a wrapper API hosted on a middleware like MuleSoft. External consumer invokes this Wrapper API and registers the webhook endpoint. Wrapper API sends the acknowledgement back to the external system after invoking Agentforce agent. This wrapper API also maintains the Agentforce agent session, and returns the response back to the external system using the registered webhook endpoint once the agent responds. |
| Agentforce via MCP (AIforce\) | Best for AI-to-AI invocation where the caller is an MCP-compatible client | The calling MCP client invokes Agentforce as a tool through the out-of-the-box MCP server provided by AIforce\. Session lifecycle is managed transparently by the MCP server, and the calling agent interacts through standard tool-call without building a custom REST integration. Use this solution when the caller is an MCP client that needs to delegate reasoning, CRM context retrieval, or action execution to Agentforce as a discrete step in a broader agentic workflow. |
**Sketch**
_Sequence Diagram for On-Demand Agent Invocation_
**Results**
This pattern exposes Agentforce as a callable AI service. External systems gain access to the agent's reasoning, tools, and CRM context without replicating that logic. The caller remains responsible for session lifecycle management and rendering the response. The agent remains responsible for all reasoning, tool selection, and response synthesis.
When the caller is an AI agent or orchestrator, the Agentforce via MCP mechanism (available out of the box via AIforce\) removes the need for a custom REST integration entirely. The MCP server handles session lifecycle on behalf of the calling agent, enabling Agentforce to participate as a first-class tool in multi-agent workflows with no additional plumbing.
**Design Considerations**
Platform-agnostic Guidance
- Avoid making the external API call synchronous and blocking in time-sensitive UI flows. Adopt a polling or webhook callback pattern where agent response times are non-trivial, to decouple the user experience from the agent's processing time.
- Select the calling mechanism based on the nature of the caller, not availability. Human-facing applications and system integrations should use the Agent API directly. Tools that support MCPs should use the Agentforce MCP server. Mixing mechanisms for the same caller type adds unnecessary complexity without architectural benefit.
Salesforce Implementation Notes
- Inject session context in the session creation POST request, not in the first user message. When the external system creates the session, it has an opportunity to pass structured context variables (account ID, entitlement data, prior interaction summary) directly as named session parameters. These variables are available to the agent before it processes a single turn, so it begins reasoning from a grounded state without issuing lookup calls to establish who the customer is or what they’re entitled to. Passing the same data inside the message body instead forces the agent to parse unstructured text to extract facts it could have received as typed variables \- increasing latency, introducing extraction errors, and consuming reasoning steps that add no business value.
- Design agent responses to be structured and machine-parsable. Use output variable conventions and prompt instructions that guide the agent to return JSON-friendly or clearly delimited responses when the caller is a system instead of a human.
- Manage session lifecycle explicitly. Terminate sessions promptly after use `DELETE /einstein/ai-agent/v1/sessions/{sessionId}` to free concurrency slots and avoid stale context persisting across unrelated interactions.
- Account for Salesforce concurrent session limits. For high-throughput scenarios, implement a session pool or a queuing layer in the calling system to prevent request rejection during peak load.
- When invoking Agentforce via MCP, pass context as tool input parameters rather than as session variables. The MCP server manages the session lifecycle transparently, so the calling agent cannot set named session parameters directly at creation time. Ensure all required context (record IDs, user identity, entitlement data) is included in the tool call payload so the agent begins reasoning from a grounded state.
- Treat the MCP server's transparent session management as a convenience, not a concurrency bypass. Each tool invocation still consumes a Salesforce agent session slot. High-frequency orchestrators calling Agentforce via MCP at scale must account for the same concurrent session limits that apply to direct Agent API callers.
**Error Handling and Recovery**
- The Agent API returns standard HTTP error codes. The calling system must handle “429 Too Many Requests” (rate limit) with exponential backoff and “503 Service Unavailable” with retry logic.
- When the agent itself encounters an unresolvable tool failure, it returns a graceful natural-language error in the response body. The calling system detects these sentinel responses (for example, checking for an “error” status field in the response) and routes accordingly either by retrying with additional context, presenting a fallback experience, or escalating to a human.
- When invoking via MCP, errors surface at two distinct layers: MCP transport errors (malformed tool calls, server unavailability) and Agentforce reasoning failures (tool execution errors, unresolvable actions). The orchestrating agent must handle both layers independently. MCP transport errors should trigger retries at the protocol level; Agentforce reasoning failures returned in the tool response should be handled by the orchestrator's own fallback or escalation logic.
**Security Considerations**
- Use the narrowest possible OAuth scopes for the external client app. An integration that only needs to invoke an agent shouldn't hold scopes for data access beyond what the agent itself requires.
- Validate and sanitize all inputs from the external system before injecting them as session variables. External inputs are an attack surface for prompt injection. For example, a malicious caller can craft a “customerQuery” field designed to override agent instructions.
- Apply IP allowlisting on the external client app to restrict which external systems can authenticate and call the Agent API.
- Log all inbound API-triggered sessions with caller identity, session ID, and request/response metadata for audit and security purposes.
- When Agentforce is invoked via MCP, the MCP server authenticates to Salesforce on behalf of the calling user. Make sure the MCP server's connected app credentials are scoped to the minimum required permissions, and that the end user’s identity (using MCP tools like Claude) \- identity is propagated into the session context explicitly via tool input parameters.
**Example**
A financial services portal triggers an Agentforce agent to handle a mortgage inquiry.
1. The portal authenticates using the Client Credentials OAuth flow and obtains a bearer token.
2. It calls “POST /einstein/ai-agent/v1/sessions” with session variables: “{ "accountId": "001xx...", "productType": "mortgage", "loanAmount": 450000 }”.
3. The user submits their question: "What documents do I need to complete my application?"
4. The portal calls “POST /einstein/ai-agent/v1/sessions/{sessionId}/messages” with the user's text.
5. The Agentforce agent invokes a “GetDocumentChecklist” Flow action, retrieves the loan-type-specific requirements, and returns a structured list.
6. The portal renders the agent's response inline and closes the session on user exit.
## Autonomous Event-Driven Agent Execution (Inbound)
**Context**
Not all agentic workflows originate from a human request. Business-critical signals like a sudden drop in product usage metrics, a high-value cart abandonment, or a payment failure crossing a risk threshold, occur frequently in operational data. When these signals require intelligent, multi-step responses, waiting for a human to notice and act introduces latency that compounds into real business cost.
This pattern describes how real-time events serve as autonomous entry points for agents. The agent is invoked by a data condition rather than a user, reasons over the event context, and executes a response workflow all without human initiation.
**Problem**
When a real-time business event occurs in Data 360 or the Salesforce platform, how can that event autonomously instantiate an agent session, supply the event payload as grounding context, and drive a non-conversational action workflow to completion without a human initiating or guiding the interaction?
**Forces**
When applying this pattern, answer the following questions:
- Is a response required immediately at the moment the event fires, or is near-real-time processing (seconds to minutes) acceptable?
- Does the event payload contain sufficient context to ground the agent, or does the agent need to perform additional lookups before it can reason effectively?
- What’s the expected event volume and frequency? High-throughput event streams require rate management to avoid exhausting agent concurrency limits.
- Can the same event fire more than once for the same business entity (at-least-once delivery)? If so, actions must be idempotent.
- Is there a human escalation path if the agent can't resolve the event autonomously?
- How should failed event processing be surfaced? With a dead-letter queue, an alert, or case creation?
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| -------------------------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data 360-Triggered Flows | Best for behavioral and metric-based signals | This is best fit when the trigger condition is defined as a Data 360 segment membership change or metric threshold. Data 360 detects the business condition (for example, cart abandonment, usage drop) and fires a triggered flow. The flow maps event payload attributes to agent session variables and creates the Agentforce session. |
| Platform Events \+ Autolaunched Flow or Apex | Best for platform-internal and cross-system events | Use this solution when the event source is within the Salesforce platform or when a middleware layer publishes the event after detecting the condition in an external system. A platform event published by any Salesforce process or external system triggers an Apex trigger or Autolaunched Flow, which constructs the agent session with the event payload as context. |
**Sketch**
_Sequence Diagram for Event-Driven Agent Execution_
**Results**
Agents become reactive participants in real-time business operations, not passive responders to human requests. Event-triggered agents can execute recovery, triage, and escalation workflows at the speed of data instead of the speed of human attention.
The triggering system (Data 360 or platform events) remains responsible for event detection and payload formation. The agent remains responsible for reasoning over that payload and selecting the correct action chain. No conversational turn is required; the event payload is the complete input.
**Design Considerations**
Platform-agnostic Guidance
- Design all actions for non-conversational invocation. There is no user turn; the agent must reach a resolution from the initial grounding context alone. Actions should return structured, deterministic outputs rather than prompting for clarification.
- Make sure the event payload carries sufficient grounding context before the agent session is created. A lean payload that forces the agent to make multiple lookup calls before it can reason increases latency and concurrency consumption.
- Make all write operations triggered by event-driven agents idempotent. Event delivery systems typically provide at-least-once guarantees. Duplicate event processing cannot produce duplicate side effects.
Salesforce Implementation Notes
- In Data 360 Triggered Flows, map event payload attributes (for example, “accountId”, “eventType”, “metricValue”, “productIds”) directly to named session variables at session creation time. This grounds the agent from the first reasoning step without requiring a retrieval action.
- For platform event triggers, use an Autolaunched Flow rather than a screen flow. Screen flows are not supported in autonomous, non-conversational contexts.
- Set an explicit session timeout on event-triggered sessions. Unlike conversational sessions, there’s no user to extend the interaction; a session that stalls on a failed action shouldn't hold a concurrency slot indefinitely.
- Use flow fault paths to handle agent session creation failures. If the session can't be created, the fault path should publish a compensating event or create a case for human follow-up rather than silently dropping the event.
**Error Handling and Recovery**
- Events that fail to trigger an agent session successfully due to concurrency limits, session creation errors, or payload validation failures should be routed to a fault path that creates a case, fires an alert, or publishes the event to a dead-letter queue for reprocessing.
- Agent failures mid-execution (for example, time-out of a required action) should be logged with the originating event ID. Since the triggering is asynchronous and there is no waiting caller, the error surface is entirely observability based: logs, dashboards, and alert thresholds.
- Implement a retry ceiling. If an event reliably causes agent failure, unbounded retries will exhaust concurrency limits. After a configurable maximum number of attempts, route the event to a human review queue with full context attached.
- Track the event ID through the full agent session lifecycle. This tracking enables correlation between the originating data signal and all downstream actions for audit and debugging.
**Security Considerations**
- Validate and sanitize all event payload attributes before injecting them as agent session variables. Event payloads from Data 360 or external publishers are an attack surface for prompt injection. For example, a crafted payload field can be designed to override agent instructions.
- Run event-triggered agent sessions under a dedicated, least-privilege integration user rather than a high-privilege admin identity. The agent only holds the permissions required to execute its defined action set.
- Log all event-triggered sessions with the originating event ID, event type, and the session variables injected at creation. This audit trail is required to reconstruct why the agent took a given action if the outcome is disputed.
**Example**
A retail company uses Data 360 to track real-time cart behavior. When a cart with a value above a defined threshold is abandoned:
1. Data 360 detects the abandonment signal and fires a triggered Flow with the event payload: “customerId”, “cartValue”, “productIds”, and “abandonmentTimestamp”.
2. The Flow maps these attributes to Agentforce session variables and creates a new agent session. No user interaction is required.
3. The agent evaluates the customer's purchase history, current entitlements, and cart composition using its available retrieval actions.
4. The agent invokes a `SelectRecoveryOffer` action, which applies the appropriate discount tier based on customer segment, and `SendProactiveNotification` action to deliver the offer via the customer's preferred channel.
5. The agent invokes `CreateFollowUpTask` to log the interaction in the CRM for the account owner's visibility.
6. The session closes automatically after the action chain completes. The originating event ID is preserved in the session log for traceability.
## Knowledge Grounding from Enterprise Content (Outbound)
**Context**
LLMs are trained on public data. They have no knowledge of your organization's products, policies, case history, or contracts unless that information is explicitly supplied at reasoning time. Without grounding, an agent asked about a customer's service entitlement or the terms of a specific contract will either hallucinate an answer or admit it doesn't know. Neither outcome is acceptable in an enterprise context.
Retrieval-Augmented Generation (RAG) solves this by retrieving relevant documents from an enterprise knowledge store and injecting them into the agent's context window before it generates a response. The agent reasons over retrieved content like a knowledge article, a past case resolution, a product specification as if it had been given that information directly. The LLM supplies the reasoning; the retrieval layer supplies the facts.
For example, a service agent handling a complex warranty claim does not need to have warranty policy terms embedded in its instructions. Instead, when the customer describes their issue, the agent performs a semantic search or hybrid search (keyword search \+ semantic search) against a vector index of warranty documentation, retrieves the applicable terms, and uses them to determine eligibility and next steps. The answer is grounded in the current, authoritative policy document, not the model's training data.
**Problem**
An agent needs to answer a question or make a decision that depends on proprietary organizational knowledge like policies, contracts, product documentation, or historical case data that wasn’t part of the LLM's training data. How does the agent retrieve the most relevant content at reasoning time, ensure that retrieved content is current and authoritative, and inject it into context with sufficient precision to avoid noise?
**Forces**
When applying this pattern, answer the following questions
- Is the knowledge content static and infrequently updated (for example, product manuals), or does it change continuously (for example, case resolutions, inventory descriptions)? Update frequency determines the ingestion pipeline design.
- How large is the content? A small knowledge base can be retrieved exhaustively; a large one requires chunking, embedding, and semantic indexing to return only the most relevant passages.
- Does the query benefit from a single focused retrieval, or would combining results from multiple knowledge sources (for example, documentation and past cases simultaneously) produce a better-grounded answer? The latter requires ensemble retrieval.
- Is there a need to filter retrieved content by metadata before semantic ranking, for example, restricting results to documents relevant to the customer's product tier or geography?
- How sensitive is the knowledge content? Retrieved content is injected into the LLM context window and influences the agent's response; content that shouldn't be surfaced to certain users must be governed at the retrieval layer, not assumed to be filtered by the LLM.
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| -------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Retrieval-Augmented Generation (RAG) with Data 360 | Best for enterprise use cases | The agent performs a semantic search against Data 360 vector indexes before generating a response. The retrieved content like knowledge articles, past cases, product documentation is injected into the LLM context as grounding. This can be called using Retriever actions, Flow, or custom Apex. Note that Data 360 supports an integrated pipeline from raw content to agent-ready context, not just a vector store:
It provides multiple ingestion paths (unstructured file connectors from SharePoint/Google Drive/S3, CRM file attachments, and any data source where data can land in a custom Data Model Object (DMO)).
LLM-powered document parsing for complex formats (PDFs with tables, scanned docs).
Configurable chunking strategies.
All these features are offered in both turnkey fashion with full configurability. We have two types of retrievers for Data360: **Individual Retriever**: A configured Salesforce Retriever Action performs a semantic search against a single defined Search Index and returns the most relevant content chunks. Results are injected directly into the LLM prompt as grounding context. Use Individual Retriever Action when the query is best served by a single focused knowledge source. **Ensemble Retriever:** An Ensemble Retriever Action combines the results of multiple individual retrievers for example, a product documentation index and a resolved-cases index. Ensemble retrievers don't combine relevance scores from individual retrievers since those scores aren't comparable across heterogeneous indexes. Instead, all retrieved chunks are passed through a cross-encoder reranker model that independently scores each (query, chunk) pair, producing a unified ranking. This is architecturally significant: it means the quality of cross-source ranking improves with the reranker model, not with manual score calibration. After reranking them, it makes the unified result available to LLM prompts as grounding context. Use Ensemble Retriever Action when a more complete answer requires evidence from more than one knowledge domain. |
| RAG with third-party Vector Databases | Suitable when working within existing infrastructure constraints | This approach integrates third-party vector stores which might already exist in your infrastructure to index proprietary data embeddings, leveraging them for real-time semantic search and content retrieval. This can be implemented using Flow, or custom Apex. |
**Sketch**
_Sequence Diagram for Knowledge Grounding from Enterprise Content_
**Results**
The agent's responses are anchored to the organization's current, authoritative knowledge rather than the LLM's training data. Hallucination risk on factual questions like policy terms, product specifications, entitlement details is reduced because the model is reasoning over retrieved evidence, not generating from memory.
The knowledge content remains independently maintainable. Updating a policy document or adding a new case resolution to the index takes effect immediately for all subsequent agent interactions, without retraining or redeploying the model.
Retrieval also provides an implicit audit trail. Because the agent's answer is derived from specific retrieved documents, the source content can be logged alongside the response, making it possible to trace why the agent gave a particular answer.
**Design Considerations**
Platform-agnostic Guidance
- Chunk and embed knowledge content at the right granularity. Chunks that are too large dilute relevance. Chunks that are too small lose the surrounding context the LLM needs to reason correctly. For most enterprise document types, paragraph-level chunking with overlapping context windows produces the best retrieval quality.
- Treat retrieval precision as a first-class design concern. Injecting low-relevance content into the agent's context window isn't neutral. It introduces noise that degrades response quality. Tune retrieval thresholds and top-k limits to balance recall against precision for each knowledge domain.
- Ingestion latency is an operational SLA. If a policy document is updated but the vector index hasn’t been refreshed, the agent retrieves and acts on stale information. Define acceptable staleness tolerance for each type of content, and design ingestion pipelines accordingly.
Salesforce Implementation Notes
- Populate Data 360 vector indexes via the appropriate ingestion pipeline for the content update frequency. Use batch ingestion for static documents, and streaming or Change Data Capture (CDC) for records that change continuously.
- For Ensemble Retrievers, configure the relevance ranking weights per source. A resolved-cases index may need a recency bias; a policy documentation index may not. Tune weights based on the query types the agent is expected to handle.
- Use metadata filters in custom Apex or flow retrievers to scope retrieval before semantic search executes. Filtering by product line, region, or document type before ranking reduces noise and improves the precision of what is injected into context.
- Don't inject the full retrieved document into the LLM context. Pass only the relevant chunks or excerpts. Large context injections consume token budget, increase latency, and reduce the proportion of the context window available for the agent's reasoning.
**Error Handling and Recovery**
- If retrieval returns no results, return an explicit "no results found" status instead of proceeding ungrounded. The agent can then broaden the query, ask the user for clarification, or escalate to a human.
- Each returned chunk from the retrievers contains a relevance score. Depending on the use case, a certain threshold confidence/relevance value should be configured above which the agent should treat the retrieval as confident otherwise it should fall back to clarification or escalation.
- If the vector index or retrieval service is temporarily unavailable, the retriever action or Apex callout should return a structured error with a descriptive reason. Log the failure with the session ID and query so that retrieval gaps can be identified and the index or service can be monitored for availability.
- For time-sensitive knowledge domains, implement a freshness check as part of the retrieval response. If the most recent matching document was last updated beyond a defined staleness threshold, flag this to the agent so it can qualify its response or prompt for verification.
**Security Considerations**
- Retrieval must respect the data access permissions of the user on whose behalf the agent is acting. An agent session running in the context of a customer-facing interaction must not retrieve internal operational documents, pricing strategy notes, or records the end user would not otherwise have access to. Apply field-level and record-level security at the retrieval layer. Don’t rely on the LLM to withhold sensitive retrieved content.
- Retrieved content is injected into the LLM context window and may influence or appear in the agent's response. Treat every document in the retrieval content as potentially visible to the end user and govern content membership accordingly.
- Log all retrieval queries and the document identifiers of retrieved chunks alongside the session ID. This audit trail enables reconstruction of the evidence the agent used when responding, which may be required for compliance, dispute resolution, or explainability obligations.
**Example**
A financial services agent handles a customer query about early redemption penalties on a fixed-term savings product:
1. The customer asks: "What penalty would I incur if I withdraw my funds six months early?"
2. The agent invokes an Individual Retriever Action configured against a vector index of product terms and conditions documents.
3. The retriever performs a semantic search using the query context, like product type and customer account, and the specific question and returns the three most relevant document chunks \- the early redemption clause, the penalty calculation table, and the exceptions applicable to hardship cases.
4. The retrieved chunks are injected into the agent's context window alongside the customer's question.
5. The agent reasons over the retrieved terms, identifies the applicable penalty rate for the customer's product tier and redemption timeline, and returns a precise, policy-grounded answer, citing the effective date of the terms it used.
6. The document identifiers of the retrieved chunks are logged with the session record for auditability.
## Verified Customer Context Injection (Outbound)
**Context**
LLMs are probabilistic by nature. When asked to reason about a specific customer, they infer, estimate, or hallucinate facts they weren’t explicitly given. An agent invoking a pricing action without knowing that the customer is a high-value enterprise account on a preferred tier may apply the wrong discount logic. An agent escalating a support case without knowing the customer's churn risk score may deprioritize an account that is days away from churning.
Verified Customer Context Injection addresses this by pre-populating action input parameters with verified, structured attributes from the unified profile before the agent invokes an action. The agent doesn’t infer the customer's segment, lifetime value, or customer satisfaction (CSAT) trend. It receives those facts as grounding inputs and reasons over them. This pattern reduces hallucination risk on customer-specific decisions and eliminates redundant lookup calls during the reasoning cycle.
For example, before a pricing agent invokes a “GenerateQuote” action, the subagent configuration automatically injects the customer's segment, tier, and lifetime value from their unified profile. The action receives verified facts rather than LLM-inferred approximations, and the quote is anchored to the customer's actual commercial relationship.
This is not an alternative to the “Knowledge Grounding from Enterprise Content” pattern. A well-designed agent may use both: “Knowledge Grounding from Enterprise Content” provides document-based knowledge, while “Verified Customer Context Injection” establishes customer identity.
**Problem**
How do you make sure that an agent has accurate, customer-specific facts like segment, tier, lifetime value, churn risk, or other profile attributes before it takes an action, rather than guessing those facts on its own?
**Forces**
When applying this patter, answer the following questions:
- Which action input parameters represent customer-specific facts that, if inferred rather than sourced, would produce incorrect or inconsistent outcomes?
- Are the required profile attributes available as standard Data 360 unified profile fields, or do they require calculated insights derived from raw behavioral and transactional data?
- How frequently do the relevant profile attributes change? Attributes like churn risk score or CSAT trend require a freshness guarantee; stale profile data leads to the same incorrect outcomes as hallucinated data.
- Should profile attributes be injected at session creation time (constant for the session's duration) or fetched fresh at the point of action invocation (to reflect state changes mid-session)?
- Does the agent need to reason over the profile attributes directly, or are they consumed only by the action and opaque to the agent's reasoning loop?
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| --------------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Subagent Configuration \- Profile Attribute Mapping | Best for static session-level grounding | Best fit when the profile attributes are stable within a single interaction. Map Data 360 unified profile attributes (for example, “customerSegment”, “tier”, “lifetimeValue”) directly to action input parameters in the Agentforce subagents configuration. Attributes are resolved at session creation and held constant for the session's duration. |
| Data 360 Connected Flows | Best for dynamic or mid-session refresh | Use when profile attributes change frequently or when the action requires the most current state. Use a Data 360-connected flow as an action step to surface the latest profile state at the point of invocation.The flow queries the unified profile, applies any necessary transformation, and returns the attributes as output variables consumed by the next action in the chain. |
| Calculated Insights as Action Inputs | Best for complex derived metrics | Use when Agents need to reason over computed business metrics (churn risk score, CSAT trends, product adoption index) rather than interpreting raw data. Defined in Data 360 as derived metrics computed over behavioral, transactional, and engagement data. Calculated Insights are surfaced as queryable profile attributes and can be mapped to action inputs via topic configuration or a connected flow. |
**Sketch**
_Sequence Diagram for Verified Customer Context Injection_
**Results**
Actions receive verified, structured customer facts rather than LLM-inferred approximations. The agent's reasoning is anchored to the customer's actual profile state, reducing hallucination risk on decisions where factual accuracy determines outcome quality like pricing, entitlement checks, escalation routing, retention offers.
Profile grounding also reduces reasoning latency. When the agent doesn’t need to issue lookup calls to establish basic customer context, the reasoning cycle is shorter and concurrency is consumed for fewer turns.
The Data 360 unified profile remains the authoritative source of customer facts. The subagent configuration or connected flow is the integration seam. The agent is responsible for reasoning over those facts and selecting actions, not for sourcing the facts themselves.
**Design Considerations**
Platform-agnostic Guidance
- Identify all action inputs that carry hallucination risk—where LLM inference could produce a wrong outcome instead of a verified value. Inputs with hallucination risk are candidates for profile grounding. Not every input requires grounding; over-injecting profile data adds noise to the agent's context window.
- Treat profile freshness as a design decision, not an afterthought. Define the acceptable staleness tolerance for each grounded attribute and choose the injection mechanism accordingly: session-level mapping for stable attributes, flow-based refresh for volatile ones.
- Calculated Insights should encode business logic, not raw metrics. An agent reasoning over a “churnRiskScore” of 0.87 is more effective than an agent reasoning over 14 raw behavioral signals. Compute the interpretation in Data 360; pass the result to the agent.
Salesforce Implementation Notes
- Profile grounding is only as trustworthy as the unification behind it. For example, the value of the Unified Profile depends entirely on the quality of identity resolution upstream. If a customer has fragmented identities across source systems that haven't been unified, the profile attributes the agent receives will be incomplete or they represent only a partial view (for example, Lifetime Value computed with data from one channel but not another).
- For Data 360 connected Flows, use the Get Records element with a filter on the current session's “recordId” or “accountId” to retrieve only the relevant profile record. Return only the attributes required by the downstream action; don't return the full profile object.
- Calculated Insights must be kept current via Data 360 ingestion pipelines. Set up streaming or near-real-time refresh for insights used in time-sensitive decisions (for example, churn risk in a retention workflow). Batch-refreshed insights are acceptable for slower-moving attributes (for example, annual contract value tier).
- Validate that mapped profile attributes are non-null before action invocation. A null “customerTier“ passed to a pricing action is as harmful as a hallucinated value. Use flow decision elements to detect missing profile data and route to a fallback that either retrieves a default or prompts for clarification.
- In the subagent configuration, map profile attributes to action input parameters using descriptive, semantically clear variable names (for example, “customerTier”, “lifetimeValueUSD”, “churnRiskScore”). The LLM reads these names when selecting and composing actions; ambiguous names degrade selection accuracy.
**Error Handling and Recovery**
- If a required profile attribute is null or unavailable at the time of action invocation, the agent shouldn't proceed with a potentially incorrect default. The action should return a structured error indicating the missing attribute, and the agent should either prompt the user for clarification or escalate to a human if operating non-conversationally.
- If a Data 360-connected flow fails to retrieve profile data (for example, due to a Data 360 service interruption), the flow's fault path should return a structured error to the agent with the specific failure reason. The agent can then decide whether to retry, proceed with a degraded experience, or surface the failure to the user.
- Log all profile attribute values injected at session creation or action invocation alongside the session ID. This ensures that any disputed agent decision can be reconstructed with the exact customer facts the agent was given at the time.
**Security Considerations**
- Profile attributes injected into agent context are subject to the same data access controls as any CRM record. Make sure that the integration user or connected app used to resolve profile attributes holds only the field-level permissions required for the attributes being surfaced and not broader profile read access.
- Calculated Insights that encode sensitive derived metrics (for example, predicted health score, financial risk tier) should be treated as sensitive fields and governed by the same access controls as the underlying data. Surfacing a high churn risk score to an agent operating in a customer-facing context requires careful consideration of what the agent may communicate.
- Don't surface profile attributes that are not required by the action. Each additional attribute in the agent's context window is an additional data element that could be reproduced in the agent's response. Apply a minimum-necessary principle to profile grounding.
- Audit all sessions in which Calculated Insights or sensitive profile attributes were injected as inputs. These sessions represent decisions made on the basis of derived customer intelligence and may be subject to explainability or regulatory requirements in certain industries.
**Example**
A telecommunications company uses Agentforce to handle retention conversations with customers who have initiated a cancellation request.
- When a cancellation case is opened, the agent session is created with the customer's “accountId” as context.
- The subagent configuration maps three Data 360 Unified Profile attributes to session variables at creation time: “customerTier” (Enterprise), “lifetimeValueUSD” (42,000), and “contractRenewalDate” (60 days).
- A Calculated Insight like “churnRiskScore” (0.91, computed from usage decline, support ticket frequency, and NPS trend) is mapped as an additional session variable via a Data 360-connected flow invoked as the first action step.
- The agent, now grounded in verified customer facts, invokes a “SelectRetentionOffer” action. Because the inputs include “customerTier \= Enterprise”, “lifetimeValueUSD \= 42000”, and “churnRiskScore \= 0.91”, the action returns the maximum-tier retention offer rather than a standard one.
- The agent invokes “PresentOffer” to deliver the offer in the conversation and “LogRetentionAttempt” to record the interaction in the CRM with all grounded attributes preserved for auditability.
## Cross-System Tool Integration (Outbound)
**Context**
Enterprise data is fragmented. An agent that can only act on what lives inside the Salesforce platform is limited to a fraction of the information it needs to reason effectively. Answering a service question may require reading a customer’s open ticket in Service Cloud. Preparing a proposal may require retrieving a file from Google Drive. Analyzing product usage may require querying a data warehouse. Each of these systems has its own APIs, its own authentication model, and its own data schema and the cost of writing tailored integration code for each one is what has historically made agent-to-system connectivity expensive and fragile.
MCP is an open standard that addresses this directly. It defines a uniform interface through which an agent can discover and invoke tools exposed by any MCP-compliant server, regardless of the underlying system. Each MCP Server acts as an adapter: it wraps a target system’s native interfaces in a standardized, tool-centric interface that the agent can query, invoke, and compose without knowing anything about the system’s specific protocols or schemas.
From the agent’s perspective, connecting to Slack, a Structured Query Language (SQL) database, and a document management system looks identical, three MCP Servers, each exposing a set of described, callable tools. The agent selects and sequences them based on their semantic descriptions and the goal it's trying to achieve.
**Problem**
When an agent needs to retrieve information or trigger actions across multiple external systems- each with different APIs, authentication, and schemas \- how can it discover, invoke, and compose their capabilities without tailored integration code per system or tight coupling to any system's implementation?
**Forces**
When applying this pattern, answer the following questions:
- Does the agent need to reach systems outside the Salesforce platform like document stores, collaboration tools, databases, third-party SaaS, whose APIs are not natively represented as Agentforce actions?
- Is dynamic tool discovery required, where the agent identifies the right integration endpoint at reasoning time based on the current request, rather than having integrations hardcoded in its configuration?
- Does the integration landscape change frequently; new systems added, existing ones updated, and other changes may demand such that a tailored-per-system approach would create unsustainable maintenance overhead?
- Is there a need to decouple the agent’s reasoning layer from the implementation details of downstream systems, so that a change in a target system’s API does not require changes to the agent’s instructions or subagent configuration?
- Are the target systems owned by different teams or vendors, each responsible for exposing their own capabilities, making a provider-side MCP Server model more practical than a consumer-side integration per agent?
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| --------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce MCP Servers | Best for Salesforce-ecosystem targets | Use when the target system is within the Salesforce ecosystem and a first-party MCP Server is available. AIforce provides MCP Servers for its own platform capabilities, exposing CRM data, flows, and platform actions as MCP-compliant tools. Reduces implementation effort to configuration rather than development. **Note**: Currently, Salesforce MCP servers support only end-user credentials for authentication and authorization. |
| Custom MuleSoft MCP Servers | Best when no first-party MCP Server exists | Use for legacy systems, proprietary internal applications, or third-party SaaS platforms predate the MCP standard. When a target system doesn’t provide its own MCP Server, a MuleSoft integration layer can be wrapped in a custom MCP Server that exposes the system’s capabilities as tools. It can be also used with Salesforce APIs if MCPs are required for agents to be consumed with system user credentials only. MuleSoft handles protocol translation, authentication, and data transformation; the MCP layer makes the result discoverable by agents. |
| Third-Party MCP Servers | Best for commodity systems with active MCP ecosystems | A vendor-maintained MCP server exists for your platform (GitHub, Google Workspace) and meets security and maintenance requirements. An increasing number of enterprise platforms like GitHub, Google Workspace, and others publish their own MCP Servers. Where a production-ready, vendor-maintained server exists, prefer it over building a custom one. Evaluate for security posture and maintenance commitment before adopting. |
**Sketch**
_Sequence Diagram for Verified Customer Context Injection_
**Results**
The agent’s reachable surface area expands without growing its integration complexity. Adding a new external system means deploying or configuring an MCP Server for it and not writing tailored Apex callouts or flow integrations per agent. The agent’s reasoning layer remains unchanged; it discovers and invokes the new tools based on their semantic descriptions alone.
The MCP standard also creates a clean separation of ownership: the team responsible for a system exposes its capabilities as an MCP Server; the agent team consumes those capabilities without needing to understand the system’s internals. This boundary reduces coordination overhead as the number of integrated systems grows.
Tool composability is a direct outcome. Because all tools share the same invocation interface, the agent can chain tools from different systems, retrieve a file from Google Drive, extract data from it, and write the result to a CRM record as naturally as chaining actions within one system.
**Design Considerations**
Platform-agnostic Guidance
- Tool descriptions are the agent’s only basis for deciding whether and how to invoke a tool. Write descriptions in clear, intent-based language that states what the tool does, when it applies, and what it returns. A description that says "queries the CRM database" is less useful than "retrieves the account’s open cases, ordered by priority, for a given account ID." Poor descriptions produce poor tool selection.
- Scope each MCP tool to a single, atomic capability. A tool that retrieves a document and also writes a summary back to the source system is harder for the agent to reason about, harder to retry on failure, and harder to secure than two discrete tools. One tool, one responsibility.
- Design tools so that outputs are composable inputs. The result of a retrieval tool should be structured in a way that maps naturally to the input parameters of the action tools that typically follow it, reducing the transformation work the agent must perform between steps.
- Remote-host MCP Servers. Local binary installations create deployment and versioning complexity that grows with the number of agent environments. A remote-hosted server can be updated independently of the agents that consume it.
Salesforce Implementation Notes
- If you want consistent MCP authentication, rate limit, payload validations across all outbound MCP calls, use AI Gateway like MuleSoft Omni Gateway supporting MCP servers and configure it before exposing any MCP Server to agents.
- Use OAuth 2.0 credentials for all credentials required by MCP Server connections. Credentials must not appear in tool parameters, action configurations, or Apex code.
- Some MCP tools may need end-user credentials for taking some actions depending on the business use case (like fund transfer). To propagate end user identity tokens, use [OAuth 2.0 On Behalf Of Credentials Injection](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo?_ga=2.13731188.2103534092.1779677345-1473519780.1778951013) policy which is currently supported with MuleSoft Omni Gateway.
- For custom MuleSoft MCP Servers: define the MCP tool schema in MuleSoft’s API specification and register the server’s endpoint in the Agentforce tool catalog. Test tool descriptions against representative agent queries to verify that the agent selects the right tool for the right task before deploying to production.
**Error Handling and Recovery**
- When an MCP tool call returns an error, the agent inspects the machine-readable error code to determine the appropriate recovery action: requesting missing parameters from the user, retrying with corrected input, or escalating to a human. It never silently consumes errors or continues reasoning as though the tool call succeeded.
- The agent implements retry logic for transient failures directly.
- Log every MCP tool invocation from the client side with the tool name, sanitized input parameters, and the outcome. This client-side trace combined with server-side logs is the primary mechanism for diagnosing why an agent took a particular action path when a workflow doesn’t produce the expected result.
**Security Considerations**
- All outbound MCP server connections pass through the gateway. The gateway enforces authentication verification, rate limiting to prevent tool abuse, and payload inspection to detect prompt injection attempts in tool parameters. Direct, unmediated connections from agents to MCP Servers bypass these controls and aren’t permitted.
- Scope each agent's MCP server connections to only the servers whose tools that agent actually requires. An agent configured with access to all available MCP servers has a larger attack surface than one connected only to the tools its defined tasks demand.
- Validate and sanitize tool input parameters before passing them to the tool, particularly when parameter values derive from user-provided text or LLM-generated content. Don’t pass unvalidated LLM output directly as tool parameters; an attacker who can influence the agent's reasoning can use that path to inject malicious values into downstream system calls.
- Treat the agent’s list of connected MCP Servers and their tool inventories as sensitive configuration. An attacker who knows which tools an agent has available and what parameters they accept has a map for crafting prompt injection payloads designed to abuse those tools.
**Example**
A sales agent prepares a comprehensive account briefing before a high-value customer call:
1. The agent receives the request: "Prepare a briefing on Acme Corp ahead of tomorrow’s renewal discussion."
2. The agent queries the MCP tool catalog and identifies three relevant tools across two MCP Servers: `GetRecentEmails`, `GetOpenOpportunities`, and `GetSupportTicketSummary`.
3. The agent invokes all three tools in parallel. Each MCP Server translates the call to its target system’s native API, retrieves the relevant data, and returns a structured result.
4. The agent receives the three results. Recent email threads, the open renewal opportunity with deal size and stage, and a summary of open support tickets by priority, and synthesises them into a structured account briefing.
5. The agent invokes `CreateAccountNote` to save the briefing to the account record and returns a summary to the requesting user.
6. All four MCP tool invocations are logged by the gateway with tool names, server identities, and outcomes for the session audit record.
## Business Capabilities as Callable Tools (Inbound)
**Context**
The outbound MCP pattern describes an Agentforce agent consuming tools from external MCP Servers. The inbound pattern inverts this. Salesforce platform capabilities like CRM records, flows, Apex logic, and Data 360 insights are exposed as MCP tools that external agents, running on any LLM framework, can discover and invoke.
This pattern matters because enterprise AI deployments are rarely single-vendor. A partner's agent built on a different framework may need to look up a customer's account status in Salesforce. An internal data science team running a Python-based agent may need to trigger a Salesforce flow to kick off an approval process. Without a standardized exposure mechanism, each external consumer requires a tailored integration. Exposing Salesforce capabilities as an MCP Server gives every MCP-compatible agent a uniform, discoverable interface to the platform's tools regardless of how the calling agent is built.
For example, a partner's procurement agent, built on a third-party framework, needs to verify a supplier's contract status in Salesforce before approving a purchase order. Rather than building a direct REST integration, it invokes a `GetContractStatus` tool on the Salesforce MCP Server. The tool enforces the same access controls as any native Salesforce operation; the calling agent only sees the result.
**Problem**
When an external agent built on a different framework, owned by a partner, or otherwise running outside the Salesforce platform needs to invoke Salesforce capabilities as part of its own workflow, how can those capabilities be exposed in a standardized, discoverable, and securely governed way that does not require a tailored integration per external consumer?
**Forces**
When applying this pattern, answer the following questions:
- Are the external agents that need to consume Salesforce capabilities built on frameworks that support the MCP standard? If not, a REST API or a webhook approach may be more appropriate than MCP.
- Which Salesforce capabilities need to be exposed \- read-only data retrieval, write operations, flow invocations, or a combination? The scope of exposure directly determines the security surface area that must be governed.
- How should the identity of the external calling agent be verified, and what Salesforce permissions should its invocations run under? Agent-to-platform calls must not inherit broader permissions than the specific operation requires.
- Is the Salesforce MCP Server intended for internal consumers (other teams' agents within the same organization) or external consumers (partner and customer agents)? The trust model and authentication requirements differ significantly between these audiences.
- How will the set of exposed tools evolve over time? New Salesforce capabilities added to the MCP Server become immediately discoverable by all connected agents; unintended tool exposure must be governed through a deliberate publication process.
**Salesforce Pattern Application**
| Solution | Fit | Comments |
| --------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce as MCP Server (Native) | Best for exposing first-party Salesforce capabilities | Use when the tools to be exposed map directly to existing Salesforce platform operations and the calling agents are MCP-compatible. AIforce's native MCP server capability allows platform operations like record queries, flow invocations, and Apex actions to be declared as MCP tools and exposed to any MCP compatible external agent. Access is governed by the Salesforce permission model. Note that these AIforce MCP servers can be accessed only with end-user credentials currently. |
| MuleSoft as MCP Server Facade | Best when transformation or multi-system aggregation is required | Use when the calling agent needs a capability that requires data from more than one Salesforce object, transformation before delivery, or composition with data from other systems. The MCP interface remains clean and simple; the complexity is absorbed by MuleSoft. A MuleSoft MCP layer sits in front of Salesforce and exposes the aggregated result of multiple platform operations as a single MCP tool. This solution can be also used by agents where the end-user identity can’t be propagated for Salesforce authentication and authorization. For example, if Agentforce Agents need MCP servers with system credentials, we will have to rely on custom MCP servers like one built with and hosted on MuleSoft. |
**Sketch**
_Sequence Diagram for Business Capabilities as Callable Tool_
**Results**
Salesforce becomes a first-class participant in multi-vendor agent ecosystems. External agents can discover and consume platform capabilities without requiring a custom REST integration per consumer or per use case. The number of consumers can grow without proportional growth in integration maintenance overhead.
With AIforce, the Salesforce permission model governs every inbound tool invocation. External MCP clients don't bypass existing data access controls; they operate within them. This means the security posture of exposing capabilities via MCP is equivalent to exposing them via any other authenticated API surface.
Tool discoverability is a compound benefit. As new Salesforce capabilities are added to the MCP Server's tool catalog, they become immediately available to all connected external agents without requiring those agents to update their configurations.
**Design Considerations**
Platform-agnostic Guidance
- Publish only what external agents need. Every tool added to the MCP Server's catalog expands the attack surface and the governance burden. Audit the tool inventory deliberately. Define which capabilities are approved for external consumption, and treat unapproved exposure as a configuration gap, not a default.
- Write tool descriptions for external consumers. An external agent's operator has no knowledge of your internal data model or naming conventions. Keep descriptions self-contained: what the tool does, what each parameter means, what the result represents, and any constraints or prerequisites the caller must satisfy.
- Version tools explicitly when their input or output schemas change. An external agent that depends on a tool's current schema will break silently if the schema changes without notice. Treat breaking changes to an MCP tool's interface with the same discipline as a breaking change to a public REST API.
Salesforce Implementation Notes
- Run every inbound Salesforce Out-of-the-Box (OOTB) MCP (AIforce\) tool invocation under an end user whose permissions are scoped to only the operations the exposed tools require. Don't run inbound agent calls under a high-privilege admin identity.
- To apply authentication, rate limiting, schema validation, and personally identifiable information (PII) detection consistently across all MCP tools, use AI Gateway like MuleSoft Omni Gateway.
- For MuleSoft MCP Facades, define the MCP tool schema in MuleSoft independently of the underlying Salesforce API schema. The MCP interface should reflect the calling agent's conceptual need and not the shape of the Salesforce object that backs it. This decoupling allows the Salesforce implementation to evolve without breaking the external tool contract.
**Error Handling and Recovery**
- Tool invocation failures must return structured MCP error responses with a machine-readable code and a plain-language description. The calling external agent has no visibility into the Salesforce platform's internals like error messages must be self-contained and actionable without requiring knowledge of Salesforce-specific error codes or object models.
- Rate limit errors and authentication failures must be returned promptly with enough information for the external agent's operator to diagnose and remediate which rate limit was hit, or which credential was rejected without exposing internal configuration details.
- Log all inbound MCP tool invocations at the Omni Gateway with the calling agent's identity, the tool invoked, the input parameters (sanitized of sensitive values), and the outcome. This log is the primary evidence trail for diagnosing failures reported by external consumers and for auditing what external agents have accessed.
**Security Considerations**
- Every inbound MCP connection must authenticate before any tool is reachable. Don’t permit unauthenticated discovery of the tool catalog; the list of exposed capabilities is itself sensitive information.
- Apply tool-level authorization in addition to connection-level authentication. A registered external agent should only be able to invoke the specific tools it has been explicitly granted access to, not the full catalog. Enforce this at the gateway, not at the application layer.
- Validate and sanitize all inbound tool parameters before passing them to Salesforce platform operations. Parameters from external agents are an untrusted input surface–a maliciously crafted parameter could attempt to override query filters, inject Salesforce Object Query Language (SOQL) fragments, or influence flow variables. Validate type, format, and range at the MCP Server or facade boundary.
- Conduct a periodic access review of registered external consumers. Revoke credentials for agents that are no longer active or whose access scope has changed. A dormant but valid credential for a decommissioned partner integration is an unnecessary standing risk.
- Guard against violating platform limits by rate limiting inbound MCP messages in the gateway. Curtail the traffic of non-critical agents when under load using SLA based tiering policies.
**Example**
A procurement agent operated by a logistics partner needs to verify a supplier's contract and credit status before approving a high-value purchase order:
1. The partner's agent authenticates to the gateway using its registered OAuth 2.0 client credentials and receives a scoped access token.
2. The agent queries the Salesforce MCP Server's tool catalog and identifies two relevant tools: `GetSupplierContractStatus` and `GetAccountCreditSummary`.
3. The agent invokes `GetSupplierContractStatus` with the supplier's identifier. The MCP Server translates this to a Salesforce record query, applies the integration user's field-level security, and returns the contract's current status, expiry date, and any flagged compliance holds.
4. The agent invokes `GetAccountCreditSummary`, which routes through the MuleSoft MCP Facade. The facade aggregates the supplier's outstanding invoice balance and payment history from two Salesforce objects and returns a single composite credit summary.
5. With both results, the partner's agent determines that the contract is active and the credit position is within acceptable limits, and approves the purchase order in its own system.
6. Both tool invocations are logged by the gateway with the partner agent's identity, the tools invoked, and the outcomes creating an auditable record of what external access was granted and what data was returned.
## Cross-Agent Delegation (Outbound)
**Context**
Enterprise systems now rely on collaborative agent swarms or networks, where complex requests are decomposed and delegated to specialized agents across different domains or vendor platforms. These agents, each with its own role, capabilities, and tools, need a standardized, secure communication method to coordinate toward shared goals without requiring human intervention at every step.
**Problem**
How can a calling AI agent dynamically discover, securely interact with, and delegate complex or domain-specific tasks to a remote peer agent which may be built on a different framework or operated by a different vendor and receive structured results to complete a larger enterprise workflow?
**Forces**
When applying this pattern, answer the following questions:
- How do agents, developed using diverse frameworks or operating across siloed application estates, interoperate?
- How can agents collaborate and delegate tasks without exposing their internal logic, memory, or proprietary tools?
- How do agents support complex, long-running tasks while providing real-time state updates, streaming, and push notifications?
- How do agents enforce enterprise-grade security (authentication, authorization) and policy adherence for cross-agent communication?
- How do agents handle structured task workflows (initiation, progression, completion) that go beyond simple API calls?
**Salesforce Pattern Application**
The A2A Protocol is an open standard that enables agents to discover, delegate to, and collaborate with other agents as peers. It provides a common language for agents to securely exchange information and coordinate actions across different platforms and vendors. A2A focuses on peer-to-peer communication, complementing MCP, which focuses on connecting agents to tools and APIs.
| Solution | Fit | Comments |
| ------------------------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Single-Org Multi-Agent Orchestration (SOMA) | Best when all domain agents live in one org and no cross-vendor routing is required | A superagent (orchestrator) decomposes requests and routes to up to \~7 connected subagents using LLM-based routing (Atlas Reasoning Engine reads subagent descriptions) or deterministic routing (Agent Script). This is the default recommended pattern before reaching for A2A. Supported combinations: Agentforce Service Agent→Agentforce Service Agent Agentforce Employee Agent→ Agentforce Employee Agent Agentforce Employee Agent→Agentforce Service Agent Only the orchestrator can escalate to a human; subagents cannot. |
| Orchestrator-Led Multi-Agent Delegation | Best for complex workflows requiring multiple specialised agents | Use when the workflow spans multiple domains for example, sourcing, verification, and approval each owned by a different agent. An orchestrator agent decomposes the top-level request and delegates sub-tasks to two or more peer agents in sequence or in parallel. Each peer agent executes its specialised domain function and returns an artifact; the orchestrator aggregates results and drives the next step. |
**Sketch**
The architecture involves a calling agent initiating communication, facilitated by an agent catalog/registry for discovery:
_Sequence Diagram for Cross Agent Delegation_
The peer agent processes the request using its domain-specific logic, memory, and tools, then returns structured results to the calling agent.
**Results**
A2A delegation separates domain ownership from workflow orchestration. The calling agent doesn’t need to know how the peer agent is built, what platform it runs on, or what tools it uses internally; it delegates a task and receives a structured artifact. This boundary means that a specialist agent (background verification, financial risk scoring, logistics routing) can be developed, deployed, and improved independently of the workflows that invoke it.
The protocol's task lifecycle model (submitted, working, completed, failed) supports
long-running operations natively. The calling agent can register for state updates rather
than holding a blocking connection, which means A2A tasks can span minutes or hours
without requiring the orchestrating agent to remain active throughout.
**Design Considerations**
Platform-agnostic Guidance
- In complex scenarios, an agent broker can act as an intelligent routing service or "smart switchboard" to coordinate task delegation across specialized agents and manage multi-step processes.
- Since A2A supports long-running tasks, the communication must be oriented toward task completion, defining a lifecycle for the task object and providing real-time state updates and notifications.
- The protocol is designed to support various content types, including text, files, structured data, audio, and video streaming.
- The relationships and dependencies between agents and their capabilities are declaratively defined in a configuration file (for example, “agent-network.yaml”) and published to the agent registry.
Salesforce Implementation Notes
- For effective SOMA orchestration, keep connected subagents below 7 to preserve routing quality.
- Currently, only the single delegation layer is supported (superagent → subagent); deeper chains push latency to an "untenable rate". Currently, subagents cannot delegate to other connected subagents.
- Human handoff is supported only at orchestrator level; subagents cannot escalate.
- Within SOMA, use Agent Script when LLM-based routing produces misrouting on ambiguous inputs for deterministic routing. Agent Script enables curated shared context between agents.
**Error Handling and Recovery**
The A2A protocol defines comprehensive error codes to facilitate robust debugging and error management.
- **Recovery Logic:** Agents should incorporate retry policies (retries), failover logic to alternative capable agents, and explicit timeouts.
- **Task State Tracking:** The task management workflow ensures that agents can stay in sync with the latest status of a task, facilitating recovery in case of interruption.
- **Observability:** Logging interaction details, like latency, success rates, and error frequencies, is critical for monitoring quality and troubleshooting.
**Security Considerations**
- **Enterprise-Grade Authentication:** A2A is designed to align with enterprise-grade authentication and authorization standards, such as OAuth 2.0 and JWT, often managed by external platforms like Okta.
- **Gateway to protect A2A:** A gateway (for example, MuleSoft Omni Gateway) is essential to enforce policies on all A2A communications, acting as both an ingress and egress gateway to protect agents and control outbound traffic to external agents and services.
- **Policy Enforcement:** Agent Card Rewrite, Schema Validation, Spike Control, PII Detector, and other policies should be applied for A2A server and data protection.
**Example**
**Candidate Sourcing Workflow**
A hiring manager tasks their central orchestrator agent to find candidates matching a job listing and skill set.
1. **Discovery:** The orchestrator agent queries the agent registry and discovers a specialized recruiting agent and a background check agent (both peer agents).
2. **Delegation (A2A):** The orchestrator agent sends a structured task request (A2A message) to the recruiting agent to source candidates.
3. **Peer Processing:** The recruiting agent executes its own workflow (for example, calling an external LinkedIn tool via MCP).
4. **Artifact Return (A2A):** The recruiting agent returns a list of suggested candidates (the artifact).
5. **Sequential Delegation:** The orchestrator agent then delegates another task (A2A) to the background check agent for the top candidate. This agent performs the check and returns the result, completing the overall task.
## Agents as Callable Services (Inbound)
**Context**
Complex enterprise workflows often require specialized agents hosted on external platforms or partner systems to initiate tasks, delegate queries, or provide updates to internal agents (for example, those on the Salesforce platform). This pattern addresses how an internal Agentforce agent securely and reliably receives and processes requests from a remote, peer agent to execute a domain-specific capability.
**Problem**
How can an internal specialized AI agent (for example, a background check agent on Agentforce) securely expose its domain-specific functionality to external peer agents, process an incoming, structured A2A request, and manage the task lifecycle (including real-time status updates) to return structured artifacts to the remote calling agent?
**Forces**
When applying this pattern, answer the following questions:
- How do you securely expose internal agent capabilities to external agents without compromising internal logic or tools?
- How do you enforce enterprise-grade security policies to verify the calling agent's identity and delegated authority before processing requests?
- How do you handle long-running inbound tasks while providing structured, asynchronous state updates?
- How do you ensure seamless interaction with agents built on diverse, external frameworks?
**Salesforce Pattern Application**
The A2A Protocol provides the open standard for secure, peer-to-peer delegation and collaboration. The internal agent acts as the peer agent, advertising its capabilities through an Agent Catalog/Registry and using A2A over secure channels (HTTPS/SSE) to receive and respond to structured requests.
| Solution | Fit | Comments |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agentforce Connected Subagent (SOMA) | Best when the calling agent is another Agentforce agent in the same org | Use when both agents live in the same Salesforce org and the caller is an Agentforce orchestrator. The agent is connected as a subagent via Agentforce Builder and exposed to the orchestrator through its description and declared actions. The orchestrator routes tasks using LLM-based routing (Atlas Reasoning Engine) or deterministic routing (Agent Script). No A2A protocol, gateway, or external registration is required. Supported combinations: Agentforce Service Agent→Agentforce Service Agent Agentforce Employee Agent→ Agentforce Employee Agent Agentforce Employee Agent→Agentforce Service Agent Only the orchestrator can escalate to a human; subagents cannot. |
| Agent Broker Routing (Inbound) | Best when the organization hosts multiple Agentforce agents with complementary capabilities and the calling agent _can_ not or _should_ not select a specific target | Use when the calling agent is external to Salesforce or another Salesforce Org and should not need to know which specific internal agent (Agentforce or other vendor agents) handles its request. A MuleSoft agent broker sits between the MuleSoft Omni Gateway and the pool of internal Agentforce agents. It receives the inbound A2A task, evaluates the declared capabilities of available internal agents against the task's requirements, and routes the request to the best-fit agent. The broker also handles failover if the primary target agent is unavailable or returns a failure, the broker redirects to an equivalent agent without surfacing the retry to the external caller; the external caller is never aware of internal routing decisions or retries. |
**Sketch**
_Sequence Diagram for Agents as Callable Services_
**Results**
This pattern exposes internal agents as specialized services within a multi-agent network. External agents can securely delegate tasks to internal capabilities while the organization maintains control, auditability, and policy enforcement.
**Design Considerations**
Platform-agnostic Guidance
- A gateway (for example, MuleSoft Omni Gateway) must be positioned as an ingress point to enforce policies, including rate limiting, authentication, and payload validation, on all incoming A2A requests.
- Internal agents must manage the state of the task object from external initiation to completion, ensuring the remote calling agent receives consistent, verifiable status updates.
- Make sure the agent's published capabilities in the agent card are clear, intent-based, and include necessary security scopes for delegation.
**Error Handling and Recovery**
- **Structured Error Codes:** Upon failure, the internal agent must return A2A-compliant structured error messages to the calling agent to enable remote retry logic or alternative failover mechanisms.
- **Idempotency:** The agent must verify that any side effects triggered by a retried A2A request from an external agent (due to network interruption or recovery) are idempotent.
**Security Considerations**
- **Inbound Policy Enforcement**: The gateway must enforce policies for allowlisting/blocklisting external agents and validating JWT/OAuth 2.0 tokens to verify the identity and delegated authority of the _calling agent_.
- **Input Sanitization:** Validate and sanitize all incoming request payloads to mitigate potential prompt injection or malicious data attacks.
- **Identity Propagation:** Securely map the external agent's identity and its delegated authority to internal security contexts (for example, Salesforce user profiles) before executing actions against internal systems.
**Example**
_External System Inquiry_
1. **Request:** A Recruitment Agent on a partner system sends an A2A task request to an internal Employee Verification Agent (peer agent) on Agentforce to confirm the employment status of a new candidate.
2. **Processing:** The Employee Verification Agent receives the request via the gateway, verifies the partner agent's credentials, executes its internal workflow (for example, calling an internal HR system), and formats the response.
3. **Response:** The Peer Agent returns a structured A2A artifact (for example, employment start date and job title) to the remote Recruitment Agent, which then proceeds with its external workflow.
## Other Security Considerations
1. **Gateway for protection of MCPs, A2As, and APIs**
A gateway is required as the single enforcement point for all agent-to-system and system-to-agent traffic.
- **Secured Connections**: A gateway ensures only authenticated and authorized agents interact with MCP, A2A, and API endpoints by restricting access.
- **Enforced SLAs:** A gateway can enforce rate limits, helping organizations meet performance requirements and preventing MCP and A2A server overload.
- **Simplified Governance:** A gateway offers centralized visibility and control over all server interactions, simplifying agent activity management and monitoring.
- **Data Consistency and Protection:** Policies, like schema validation, enforce data consistency, and PII detection can protect sensitive information.
**MueleSoft Omni Gateway**
2. **Identity Propagation Chain**
As enterprises embrace the agentic paradigm, a new security challenge emerges: How does end-user identity flow through a network of autonomous AI agents? In traditional API architectures, a user authenticates once and the application calls backend services on the user’s behalf. The identity chain is short, well-understood, and typically managed within a single trust domain.
Agentic architectures, however, feature much longer chains where a single request fans out across various agents, services, and MCP servers, each potentially crossing service boundaries, trust domains, and even organizational borders. Without a deliberate strategy for identity propagation, enterprises face a choice between security and functionality–a dilemma no architect needs to address.
MuleSoft addresses the complexities of identity propagation with its [Trusted Agent Identity](https://www.mulesoft.com/ai/trusted-agent-identity/announcement) feature. This solution utilizes a policy-based, gateway-managed strategy to ensure end-user identity is maintained across various interaction types including A2A protocols, MCP tool calls, and REST API requests. By centralizing identity management at the Omni Gateway layer through [outbound authentication policies](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory), enterprises can secure their entire agent network without modifying backend services or agents. For more details, see [Trusted Agent Identity for the Agentic Enterprise](https://architect.salesforce.com/docs/architect/fundamentals/guide/end-user-identity-propagation).
3. **RAG security in Data 360**
Data 360 supports attribute-based access control (ABAC) at the object, field, and row levels via Data Governance Policy settings. This is the primary way to control what data is visible to whom, including within RAG search indexes. For structured data, user access conditions are implemented using user attributes and permission sets. For unstructured data, metadata filtering (pre-filters on search indexes) can restrict what gets retrieved.
Communication with the LLM goes through the Einstein Trust Layer, which masks confidential/PII information before it reaches the model protecting data privacy not just during search but also before generation.
To protect against RAG poisoning, ensure strict data governance and validation rules are applied before data becomes available for vector search. The Einstein Trust Layer can also enforce prompt masking/toxicity checks. You can apply strict Permission Sets on the Agent User profile.
4. **New Named Credential Model**
Salesforce has revamped its authentication architecture by introducing a two-tier Named Credentials model that cleanly separates concerns between connectivity and identity. Use this whenever making callouts through Apex and avoid creating your own authentication protocol. This model also provides extensibility and enhanced security.
External Credentials sit at the foundation of this model. They store the actual authentication details and support a rich set of protocols including OAuth 2.0 Client Credentials, JWT Bearer, and AWS Signature V4, while also defining how principals are mapped: either as a single Named Principal (shared across all users) or as Per-User Principals (where each user authenticates with their own identity).
Named Credentials, in turn, act as the endpoint layer. They define the callout URL and reference an External Credential to handle the authentication handshake, keeping endpoint configuration cleanly decoupled from credential management.
To enable per-user authentication flows, administrators map Permission Sets to the appropriate External Credential principal, so that only users with the right Permission Set assignment can invoke callouts under their own identity. This two-tier design not only simplifies secure callout configuration but also gives architects far greater flexibility and governance control over how integrations authenticate across Salesforce-connected systems. For more details, see the [Named Credentials documentation](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm&type=5).
## Compliance Considerations
This section maps the architecture's data handling patterns to the compliance obligations most commonly encountered in regulated enterprise deployments.
**Access control:** The least-privilege integration user model described throughout the integration patterns (scoped Named Credentials, per-agent OAuth 2.0 scopes, gateway allowlists) maps directly to logical access controls. Maintain evidence that each agent's credential scope is reviewed and approved.
**Audit logging:** Per-pattern audit logging requirements (session ID, tool invocations, input parameters sanitized of sensitive values, outcomes) satisfy the monitoring and logging controls. Make sure logs are tamper-evident, retained for the required period, and accessible to the security team without requiring access to production systems.
**Change management:** MCP tool schema changes and A2A agent card updates that affect consumers constitute interface changes and should be subject to change management controls. Version tools explicitly (mentioned in MCP inbound pattern) and treat breaking changes as configuration events that require approval.
**Availability:** Agent concurrency limits, retry ceilings on event-triggered patterns, and dead-letter routing for failed events constitute availability controls. Document the expected throughput envelope and failure behavior for each deployed pattern as part of the availability evidence package.
**Note**: This list doesn’t represent a complete guide for ensuring the compliance of your agentic solutions. All applicable regulatory requirements must be met.
## Resources
- [Get Started with Agent API](https://developer.salesforce.com/docs/ai/agentforce/guide/agent-api-get-started.html)
- [Enable Trusted Agents with Data 360](https://trailhead.salesforce.com/content/learn/modules/data-cloud-powered-agentforce/enable-trusted-agents-with-data-cloud)
- [MuleSoft Omni Gateway Overview](https://docs.mulesoft.com/gateway/latest/)
- [OAuth 2.0 On-Behalf-Of Credential Injection Policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo)
- [Trusted Agent Identity for the Agentic Enterprise](https://architect.salesforce.com/docs/architect/fundamentals/guide/end-user-identity-propagation)
## About the Authors
Gulal Kumar is a Software Engineering Architect at Salesforce with over 20 years of experience. His expertise spans AI, integration, APIs, and enterprise architecture, with a focus on driving business transformation through secure, resilient, and innovative AI solutions. Connect with him on [LinkedIn](https://www.linkedin.com/in/gulal/).
# Abstract
The paradigm of software is shifting from direct manipulation to goal-oriented delegation. At the forefront of this transformation are AI agents—autonomous, intelligent entities capable of understanding, reasoning, and acting on behalf of users. This whitepaper provides a technical exploration of the primary types of AI agents: Conversational, Proactive, Ambient, Autonomous, and Collaborative. It defines each type, presents specific Customer Relationship Management (CRM) use cases, and provides an architectural blueprint for building these agents on the Salesforce _Agentforce_ Platform, complete with technical examples leveraging Flow, Apex, Data 360, Agent2Agent (A2A) communication, and Model Context Protocol (MCP) interoperability.
## Chapter 1: A Taxonomy of AI Agents
An AI agent is a system that perceives its environment and takes actions to achieve specific goals. While the concept is not new, the advent of powerful Large Language Models (LLMs) has supercharged their capabilities. We can categorize agents based on their primary mode of operation and interaction.
### 1.1 Conversational Agents
**Definition:** Conversational agents are the most familiar type of agent. They operate in a reactive, request–response manner, primarily through natural language interfaces (text or voice). Their core function is to understand user intent and provide a relevant response, whether it's answering a question, fetching information, or executing a simple command.
**Importance:** Conversational agents are the digital front doors to an organization. They excel at handling well-defined, repetitive tasks, thus freeing up human resources. Their effectiveness is measured by their ability to resolve user intent quickly and accurately, and to take actions on behalf of users.
### 1.2 Proactive Agents
**Definition:** Unlike conversational agents that wait for a prompt, proactive agents act as vigilant observers. They are triggered by specific events, data changes, or predefined conditions within a system. When triggered, they execute a task or initiate a workflow without requiring direct user interaction.
**Importance:** Proactive agents transform a system from a passive repository of data into an active participant in business processes. They identify opportunities and risks as they emerge, enabling businesses to act on critical signals in real time.
### 1.3 Ambient Agents
**Definition:** Ambient agents are a specific type of proactive agents that operate continuously in the background of a user's workflow without requiring explicit commands. Users often benefit from their actions without being consciously aware of their operation, because they are designed to augment human capabilities while maintaining a low profile.
**Importance:** The goal of an ambient agent is to reduce the cognitive load on users by automating the mundane "work about work." They make processes more efficient by seamlessly integrating into the tools employees use every day, capturing and structuring information automatically.
### 1.4 Autonomous Agents
**Definition:** Autonomous agents represent a significant leap in complexity. They are given a high-level goal and are capable of independently planning and executing a sequence of steps to achieve that goal. They can reason, make decisions, and even learn from their actions to improve performance over time.
**Importance:** This is the closest we get to a true digital employee. Autonomous agents can be delegated a complex, multi-step objective, such as "Generate 50 new qualified leads in the manufacturing sector this quarter," and be trusted to formulate and execute a plan to achieve it.
### 1.5 Collaborative Agents (Agent Swarms)
**Definition:** Collaborative agents, often called "agent swarms," are a collection of specialized agents that work together to solve a problem that is too complex for any single agent to handle. An "orchestrator" or "master" agent often decomposes a large task, delegates subtasks to the appropriate specialized agents, and then synthesizes their outputs. A robust Agent2Agent (A2A) communication protocol achieves this.
**Importance:** This approach mirrors a human team. By breaking down a complex problem, each specialized agent can bring its unique skills to bear: one specializes in data analysis, another in customer communication, and a third in system integration, leading to a more robust and comprehensive solution.
## Chapter 2: Agentforce Architecture Patterns
Having explored the taxonomy of AI agents, a crucial question remains: how do we combine these elements to solve real-world business problems efficiently and reliably? This chapter answers that question by providing a repository of common agentic design patterns. Each pattern is a proven solution to a recurring challenge, offering a blueprint for everything from simple, single-purpose agents to complex, collaborative agent swarms.
### 2.1 Conversational Agent Patterns
Conversational agents are often the front door to an organization's AI capabilities. They are defined by their ability to engage in a stateful, multi-turn dialog, acting as the primary interface through which users perform tasks and retrieve information using natural language. This section presents two essential recipes for building conversational agents, each tailored to a specific channel: one for the rapid, interactive exchanges of messaging clients, and another for the structured, asynchronous nature of email.
A conversational agent's intelligence is derived from its ability to access and reason over the right data at the right time. This pattern relies on a sophisticated data foundation that connects to customer records, knowledge articles, and business analytics. The complete, reusable recipes for these integrations are available in [Chapter 4: Integration Patterns](#chapter-4-integration-patterns-for-agents).
#### 2.1.a Conversational Agent: Interactive Messaging Client Pattern
**Problem**
Customers engage across many digital channels and expect **instant, contextual, and intelligent responses.** Traditional chatbots are either **scripted** or **data-blind,** which leads to poor personalization, early escalations to humans, and high service costs.
**Context**
- Your organization has multi-channel digital engagement (WhatsApp, SMS, Slack, and Salesforce Experience Cloud).
- Your organization's customers interact with your organization in [multiple languages](https://help.salesforce.com/s/articleView?id=ai.service_agent_considerations.htm&type=5).
- Your organization needs to augment service and sales workflows with agents that:
- Pull from real-time, trusted customer data
- Respect guardrails and compliance requirements
- Escalate to human agents only when necessary
**Key Components**
- **Channel abstraction:** The Service Cloud Enhanced Chat (formerly Messaging for In-App and Web) allows the agent to communicate across multiple channels through a single experience.
- **Agentforce Service Agent:** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Defines the agent's persona and conversational purpose for direct user interaction. This includes its core mission (for example, "You are an expert at solving customer support issues"), instructions on maintaining an empathetic and professional tone, and clear guardrails on the scope of inquiries it's authorized to handle.
- **Actions:** Service-oriented actions that are tools the agent uses to diagnose and resolve customer issues in real time. These tools are designed to execute tasks like checking an order's status, searching a knowledge base for solutions, or creating a new support case directly from the conversational interface.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt Templates:** Reusable templates that are dynamically populated with live CRM data via merge fields or semantic data from Data 360 RAG Retrievers. These templates allow agents to generate contextual, on-brand content while the Einstein Trust Layer securely masks sensitive information before the instructions are sent to the LLM.
- **Data 360**
- Data 360 components, including DLOs, DMOs, vector store, and RAG retrievers, provide the agent with a unified view of all relevant enterprise data, from structured customer records to unstructured knowledge articles, ensuring responses are accurate and contextually grounded.
- **Service Cloud**
- **CRM data:** Connects the agent to the complete case history, providing crucial context on account details, contact records, and entitlements
- **Live Agent queue:** Support for escalation and routing to a human service rep with the full conversation context injected
**Interactions**
1. Your organization's customer initiates conversation via a channel.
2. The message routes to **Agentforce,** which determines scope (topics) and applies guardrails.
3. AI composes responses using **prompt templates,** while Flow or Apex may trigger backend logic.
4. Context is retrieved from **Data 360 objects, vector store, and CRM** via RAG retriever.
5. AI returns a contextual answer.
6. If AI cannot resolve, the conversation escalates to the **Service Cloud Live Agent.**
**Trade-Offs**
Aspect
Gain
Cost
Response Speed
Always-on instant replies
2+ seconds latency for complex queries
Accuracy
Grounded in real data via RAG
Requires curated, up-to-date vector store
Scalability
Near-infinite concurrent conversations
Costs must be optimized through caching, qualifying, and filtering
Flexibility
Handles open-ended queries
Requires sophisticated prompt engineering
Human Touch
Human service reps handle only complex cases
Customer frustration if escalation thresholds are wrong
Conversation Diversity
Large number of intents that requires different knowledge, skills, and tools
Requires continuous topic and instructions tuning to optimize accuracy and latency
**Related Patterns**
[Greeter pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#greeter-pattern): A simple and easy to implement pattern that uses natural language to understand user intent and then routes the user to the appropriate service rep
[Operator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#operator-pattern): Builds on the Greeter to route requests to the appropriate specialist AI agent or human service rep, negotiating intent if needed
[Orchestrator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#orchestrator-pattern): Manages an AI agent swarm. It receives a user request, determines intent, creates a plan, passes the necessary data to one or more specialist agents, and then aggregates the responses for the user. Unlike the Operator, it remains the first point of contact.
#### 2.1.b Conversational Agent: Interactive Email Conversational Pattern
**Problem**
Your customers largely use email-based asynchronous conversations, and this is still the best way for outreach. Your organization needs to reach these customers via email, but your sales development representatives can't reply to inbound emails within the SLA, leading to lead loss. Additionally, your workforce spends time on unqualified leads.
**Context**
- Your organization has email as a primary lead engagement channel.
- Your SDR has limited capacity to qualify leads at scale.
- Your sales process has multi-touch lead nurturing before they meet with SDRs or business development representatives (BDRs).
- Your organization needs to augment service and sales with agents that:
- Pull from real-time sales enablement and sales product and marketing data
- Respect guardrails and compliance
- Schedule meetings based on lead qualification criteria
**Key Components**
- **Email channel:** Handles capturing inbound messages, parsing their content and attachments, and maintaining thread continuity to enable asynchronous conversations.
- **Agentforce SDR Agent:** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Defines the agent's mission to engage and qualify inbound leads through conversation. This includes instructions for understanding prospect needs, gathering key qualification data (for example, budget, authority, and timeline), and guiding the conversation toward a clear next step, such as scheduling a meeting with an account executive.
- **Actions:** Specialized sales actions that enable the agent to manage the lead lifecycle. These tools are designed to execute core SDR tasks, such as enriching lead data, sending templated follow-up emails, or integrating with calendar systems to book discovery calls.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt templates:** Reusable templates that are dynamically populated with live CRM data via merge fields or semantic data from Data 360 RAG Retrievers. These templates allow agents to generate contextual, on-brand content while the Einstein Trust Layer securely masks sensitive information before the instructions are sent to the LLM.
- **Data 360**
- Data 360 components, including DLOs, DMOs, vector store, and RAG retrievers, provide the agent with a unified view of all relevant enterprise data, from structured customer records to unstructured knowledge articles, ensuring responses are accurate and contextually grounded.
- **Sales Cloud**
- **CRM data:** Connects the agent to the complete case history, providing crucial context on account details, contact records, and entitlements
- **Schedule meeting between customer and SDR:** SDR Live Agent handoff can be configured to set up a live meeting using Task and Meeting Scheduling (Next Actions).
- **Activity logging:** Capture events, tasks, and email activities, and relate it to leads, accounts, and opportunities as a result of SDR agent interactions.
**Interactions**
1. The customer sends and receives email through the channel, which routes to Agentforce.
2. Agentforce applies topics, actions, and guardrails to parse intent.
3. Agentforce drafts contextual responses using prompt templates enriched with CRM and Data 360 context.
4. A multi-turn email conversation continues until resolution or policy guidelines.
5. For qualified leads, Agentforce schedules a meeting and updates CRM.
6. If intent exceeds AI scope, Agentforce escalates to Sales Cloud SDR for a human service rep response.
**Trade-Offs**
Aspect
Gain
Cost
Response Speed
<5 min first response (vs. 8–24 hrs)
Less personalized initial outreach when compared to phone
SDR Capacity
2–5x increase in lead coverage
Loss of early relationship-building touchpoints
Qualification Consistency
Asynchronously acquire budget, authority, need, and timeline (BANT) coverage
May miss nuanced signals
Content Accuracy
RAG ensures up-to-date info
Requires curated sales product and enablement library. Multi-turn can be strenuous
Meeting Conversion
Significantly higher conversion
Some meetings with lower-quality leads if there are BANT gaps
Cost Efficiency
More cost-efficient than human SDR
Development and maintenance costs
**Related Patterns**
[Answer Bot pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#answerbot-pattern): An effective pattern for self-service that uses generative AI to understand natural language for knowledge retrieval, and not just keywords
### 2.2 Proactive Agent Patterns
While the conversational agents in the previous section excel at reacting to user commands, proactive agents represent a paradigm shift: they act without being asked. This section provides the architectural patterns for building agents that autonomously monitor data and events originating both outside and within Salesforce.
#### 2.2.a Proactive Agent: External Event Response Pattern
**Problem**
Your organization generates critical business events within and outside Salesforce. There is trouble translating them into timely contextual action because they are scattered across applications and departments.
**Context**
- Your business processes span across several systems for CRM, payment processing, shipping, marketing automation, telemetry, and CDP.
- Your organization events occur 24/7, but your workforce availability is limited outside business hours. Systems are always on, but humans are not.
- The events lack context awareness—they miss customer context available in Salesforce, forcing multi-step conjoining of information. Today, implementation either exists as discrete complex automation or is performed manually.
- Humans act as a compiler to gather the data (in different formats) and _intelligently_ react to disjointed events.
- Your target actions are applied to multiple systems.
**Key Components**
- **Event source**
- Data Action triggered events after external data has been ingested into Data 360
- Third-party or Salesforce Heroku MCP servers capable of sending events to Salesforce via the Salesforce Pub/Sub API
- External application capable of sending event notifications via the Salesforce Pub/Sub API
- **Optional middleware:** MuleSoft or Data 360 for transformations
- **Agentforce Agent:** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Specifies the agent's core mission and its triggers, including defining its primary objective (for example, "Monitor all high-priority cases and prevent SLA breaches"). Contains the specific events or data conditions that the agent should listen for to initiate its tasks
- **Actions:** Event-triggered and scheduled actions designed to respond to external events. While these actions operate autonomously for routine tasks, they often include the ability to orchestrate workflows that involve human intervention, escalating to users for review, approval, or handling scenarios that require human judgment.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt Templates:** Reusable templates that are dynamically populated with live CRM data via merge fields or semantic data from Data 360 RAG Retrievers. These templates allow agents to generate contextual, on-brand content while the Einstein Trust Layer securely masks sensitive information before the instructions are sent to the LLM.
- **Data 360**
- Data 360 components, including **DLOs and DMOs,** that store event data [generated by external systems and sent to salesforce](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-create-eventbusconnector-data-stream.html), transforming and building streaming or real-time insights
- **Calculated, streaming, and real-time insights** supply agents with immediate, pertinent data regarding customers. This enables preemptive problem resolution, mitigating escalation. **Data graphs** proactively surface relationships and insights from disparate data sources, enabling early detection of patterns or anomalies relevant to the customer engagement, activity, and profile.
- **Data 360 vector store and RAG** retrievers provide the agent with a unified view of all relevant enterprise data and unstructured knowledge articles, ensuring responses are accurate and contextually grounded.
- **Event targets**
- Proactively notify employees or reach out to customers
- Extensible to agents (see [Ambient Agent](#23-ambient-agent-patterns) and [Autonomous Agent](#25-autonomous-agent-patterns) patterns)
**Interactions**
1. A notable change occurs in the external system.
2. The external system emits an event and publishes it to Salesforce Event Bus via API (creates a platform event) or Pub/Sub API, or Event data is streamed to Data 360.
3. Subscribers of the event are triggered. A Flow is triggered.
4. The Flow calls [Agent Action](https://help.salesforce.com/s/articleView?id=platform.automate_flow_ref_elements_actions_generate_ai_agent_response.htm&type=5) with the event data. The agent determines the right course of action and executes it.
5. The outcome is a notification or a workflow being triggered. Notifications are delivered to a user in a collaboration tool (such as Slack). Tasks or events are also generated. Further, actions can call external systems. The events, therefore, are not lost but are proactively executed, signaled, and actioned, removing human overhead or complex automation to discover them.
**Trade-Offs**
Aspect
Gain
Cost
Real-Time Integration
Events trigger actions within seconds.
API ingress complexity (partner SLA variability)
Intelligent Response
AI-powered decisions with CRM and external context
Enrichment adds latency and stale data (such as out-of-order events).
Loose Coupling
External systems independent of Salesforce logic
Async processing leads to eventual consistency.
Scalability
Handles burst events
API limits, event storage costs
Bidirectional
Salesforce can respond to external systems.
External API dependencies, failure scenarios
Security
Signed verified events, least (or zero) privilege access by external systems
Replay protection, key rotation, and operational overhead
**Related Patterns**
[Judge & Jury pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#judge--jury-pattern): Can be used in conjunction with this pattern to ensure the accuracy and reliability of AI-powered decisions by leveraging multiple "juror" agents and a "judge" agent for congruence assessment
[Model of Models pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#model-of-models-pattern): This pattern embraces diverse viewpoints from multiple expert agents to generate richer insights, which can complement the proactive AI's intelligent responses.
#### 2.2.b Proactive: Internal Platform Event Response Pattern
**Problem**
Your organization's Salesforce ecosystem generates a constant stream of signals but has trouble translating them into timely contextual action, as they require business logic, governance, and humans to triage and act. Many times, the signals are lost without any action leading to lost opportunity.
**Context**
- Your organization uses one or more Salesforce clouds: Sales, Service, Marketing, Commerce, Health, Manufacturing, and others.
- You need intelligent triaging beyond simple routing or rule-based triaging. Your organization maintains hundreds of complex business rules.
- You require real-time or near-real-time response to events.
- Occasionally, your most privileged admins become the weakest link in the chain for not seeing the signals.
**Key Components**
- **Event source layer**
- CRM data, Platform Events, Change Data Capture (CDC) data, and Real-Time Event Monitoring (RTEM) data from low-level platform activity
- **Data 360**
- Data 360 components, including **DLOs and DMOs,** that store event data [generated by CRM or platform events](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-create-eventbusconnector-data-stream.html), transforming and building streaming or real-time insights
- **Calculated, streaming, and real-time insights** supply agents with immediate, pertinent data regarding the customer, employee activity, or metadata changes in the system. This enables preemptive problem resolution, mitigating escalation. This real-time situational awareness empowers agents to deliver timely interventions for governance and compliance operational throughput.
- **Data Graphs** proactively surface relationships and insights from disparate data sources, enabling early detection of patterns or anomalies relevant to the customer engagement, activity, and profile.
- **Data 360 vector store and RAG** retrievers provide the agent with a unified view of all relevant enterprise data and unstructured knowledge articles, ensuring responses are accurate and contextually grounded.
- **Agentforce Agent:** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Specifies the agent's mission to enforce business rules and automate processes based on data changes within Salesforce. It defines the agent's objective (for example, "Ensure all opportunities are updated with a primary contact before reaching the negotiation stage") and the specific record creations, field updates, and so on that trigger the agent.
- **Actions:** Event-triggered and scheduled actions designed to respond to internal Salesforce events. While these actions operate autonomously for routine tasks, they often include the ability to orchestrate workflows that involve human intervention, escalating to users for review, approval, or handling scenarios that require human judgment.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt Templates:** Reusable templates that are dynamically populated with live CRM data via merge fields or semantic data from Data 360 RAG Retrievers. These templates allow agents to generate contextual, on-brand content while the Einstein Trust Layer securely masks sensitive information before the instructions are sent to the LLM.
- **Event targets**
- Proactively notify employees or reach out to customers.
- Extensible to call other agents (see [ambient AI](#23-ambient-agent-patterns) and [autonomous AI](#25-autonomous-agent-patterns) patterns)
**Interactions**
1. A notable change occurs within the internal system, such as an update to a CRM record, a metadata modification, or a data action triggered from Data 360.
2. The internal system emits an event and publishes it to Salesforce Event Bus via API (creates a platform event) or Pub/Sub API, or event data is streamed to Data 360.
3. Subscribers of the event are triggered and activate a Flow or Apex.
4. The activated Flow or Apex calls [Agent Action](https://help.salesforce.com/s/articleView?id=platform.automate_flow_ref_elements_actions_generate_ai_agent_response.htm&type=5).
5. The outcome is a notification or a workflow being triggered. Notifications are delivered to a user in a collaboration tool (such as Slack). Tasks or events are also generated. Further, actions can call external systems.
6. The events, therefore, are not lost but are proactively executed, signaled, and actioned, removing human overhead or complex automation to discover them.
**Trade-Offs**
Aspect
Gain
Cost
Real-Time Integration
Events trigger actions within seconds.
More layers may cause latency for simple event handling.
Intelligent Response
AI-powered decisions with CRM and external context
Enrichment adds latency and stale data (for example, out-of-order events).
Loose Coupling
Fan out (more subscribers) and extensible
Async processing leads to eventual consistency across subscribers.
Scalability
Handle burst events
API limits
Security
Platform-provided Trust layer
Non-negotiable operational overhead
**Related Patterns**
[Listener/Feed pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#listenerfeed-pattern): Can be combined with the Listener pattern to trigger proactive actions based on internal Salesforce events
[Data Steward pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#data-steward-pattern): Proactive AI can utilize data stewards to ensure data quality and consistency when responding to internal events
[Zen Data Gardener pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#zen-data-gardener-pattern): For scheduled, proactive data grooming and standardization triggered by internal events or at regular intervals
### 2.3 Ambient Agent Patterns
We began with agents that respond interactively in a conversation channel and then progressed to agents that react to specific events. Moving beyond the event-driven model of proactive agents, ambient agents represent a paradigm shift from direct interaction to proactive, background assistance. These are headless agents that observe the digital environment in the background. They act as the "eyes and ears" of the system, perceiving context from user activity or data streams and then coordinating with other agents or humans to complete tasks, surface insights, or provide guidance.
#### 2.3.a Ambient Agent: Background Stream Observer Pattern
**Problem**
Your organization's business activities generate continuous streams of valuable information (calls, meetings, chats, sensor data, and more), but this data disappears in real time without capture or analysis. By the time humans manually document these interactions, critical insights are lost and the moment for timely intervention has passed. Organizations miss the majority of actionable intelligence **needed in real time** and buried in ephemeral streams, leading to gaps, lost coaching opportunities, and decisions made without complete context.
**Context**
- Your business activities generate continuous streams from various sources, including voice and video meetings, live chats, sensor telemetry, screen activity, and transactional data.
- You require real-time or near-real-time insights (within seconds or minutes, and not hours or days) to effectively respond to and act upon these streams.
- Manual documentation processes are failing, characterized by low compliance and refresh rates, high cognitive burden on employees, and incomplete capture of critical information.
- You need multi-modal understanding, combining data from audio, video, screen share, chat, and other metadata to create a complete and accurate context of interactions and events.
- You require both immediate analysis for real-time coaching and alerts and historical analysis for post-interaction summaries and long-term trend identification.
- Temporal context (episodic memory) is crucial for your analysis, including understanding the sequence, timing, transitions, and patterns across various time windows within your data streams.
**Key Components**
- **Stream source**
- Voice and video: Video conferencing tools (like Slack Huddle, Zoom, Google Meet, and Microsoft Teams) and telephone systems
- Collaboration tools: Slack, Teams, and others
- **Stream capture connectors**
- Native SDK: Vendor-provided SDK that helps retrieve transcripts or messages that support real-time stream segments or transcripts
- **(Optional) Stream processing layer**
- For audio streams, if transcripts are not available real time, a speech-to-text capability that translates audio to text. You can also use a managed provider like Amazon Transcribe.
- For other data streams, optionally, a stream processing engine like Data 360 or Apache Flink
- **Data 360**
- Data 360 components, including **DLOs and DMOs,** that store event data, transforming and building [streaming or realtime insights](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-create-eventbusconnector-data-stream.html)
- **Calculated, streaming, and real-time insights** supply agents with immediate, pertinent data regarding customers, their activity, and critical insights. This enables preemptive problem resolution, mitigating escalation. This real-time situational awareness empowers agents to deliver timely interventions and personalized support to employees, thereby optimizing customer satisfaction and operational throughput.
- Data 360 components, including **DLOs and DMOs,** that store customer data, transforming and building real-time insights
- **Data 360 vector store and RAG** retrievers provide the agent with a unified view of all relevant enterprise data and unstructured knowledge articles, ensuring responses are accurate and contextually grounded.
- **Agentforce Agents.** This pattern focuses on an ambient agent that observes a continuous data stream, such as a live call transcript or a video feed. It acts as a real-time listener, interpreting unstructured data as it happens. For example, an agent listening to a live call might invoke a Data Discovery agent to enrich a lead's record based on new context shared in the conversation. Here is an example of such a headless agent:
- **Feedback Agent.** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Defines the agent's primary mission to analyze conversational streams and extract structured feedback and performance metrics. This includes instructions to monitor for customer sentiment, identify mentions of key products or competitors, and assess whether the human agent is adhering to company best practices or a sales playbook.
- **Actions:** Actions to transform unstructured conversational data into actionable business intelligence. These actions enable the agent to create a "Feedback Summary" record, log product feature requests, flag calls with negative sentiment for manager review, and update a dashboard to track overall agent performance against key metrics.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt Templates:** Structured, templated LLM instructions that can receive input and provide an LLM-generated output
- **Ambience targets**
- Notify users on the surface where the agent and user are, such as in a video call or a desktop application
**Interactions**
1. When a stream is activated (such as when a user joins the video call), the agent attaches itself as an observer.
2. The agent starts to receive stream data, incrementally detects intents, makes decisions, and calls actions.
3. The agent contextualizes based on intent and fetches additional data (structured or unstructured).
4. The agent provides just-in-time real-time responses without user prompting: it can detect an objection in a sales call and provide important information to handle the objection.
5. Agents can compile a consolidated summary and actions and share them with other agents and users.
**Trade-Offs**
Aspect
Gain
Cost
Window Size
Small window—lower latency, faster coaching
Also has less context, lower accuracy
Processing Mode
Real-time presents an immediate assistant opportunity.
Resource intensive
Stream Resolution
High quality audio and video can have better accuracy but increase latency.
More storage and compute
Retention Period
Vast amounts of data can be used for training and compliance.
More storage costs, can lead to noise
Multi-Modal
Richer context, holistic understanding
Sync complexity
Ambience
Can provide consistent support to the human user
Privacy/policy enforcement
**Related Patterns**
[Listener/Feed pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#listenerfeed-pattern): Can be combined with the Listener pattern to process real-time streams of conversation and user interaction data and surface relevant context and insights
[Interrogator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#interrogator-pattern): Can be used in conjunction with this pattern to assemble context from multiple sources within the stream and answer questions
#### 2.3.b Ambient Agent: User Activity Interception Pattern
**Problem**
Your employees perform hundreds of business-critical activities daily across email, calendar, calls, and applications, yet these activities remain invisible to organizational systems until they are manually logged—which rarely happens. This activity blindness means CRM data is incomplete, AI models lack the signals needed for intelligent recommendations, and managers have no real-time visibility into customer engagement. Manual activity logging creates a productivity tax while still missing most of the actual work.
**Context**
Just like the stream observer, this is a data and content observer that provides actionable tasks or performs actions on behalf of the user.
**Key Components**
- **Data layer**
- **CRM data**: Customer data available in CRM that provides context to the agent (for example, when the user is on an Opportunity page, the agent can retrieve information about the opportunity and the associated account from CRM).
- Data 360 components, including **DLOs and DMOs,** that store relevant customer data ingested from different sources
- **Calculated, streaming, and real-time insights** supply agents with immediate, pertinent data regarding customers, their activity, and critical insights. This enables preemptive problem resolution, mitigating escalation.
- **Data 360 vector store and RAG** retrievers provide the agent with a unified view of all relevant enterprise data and unstructured knowledge.
- **Agentforce Agent:** This pattern focuses on an ambient agent that observes a user's actions directly within the UI. It acts as a real-time assistant, understanding the context of the user's workflow to provide guidance. For example, an agent might monitor a service representative filling out a case record and proactively surface a relevant knowledge article. Here is an example of such a headless agent:
- **Feedback Agent.** The agent's behavior and purpose are defined by the following components.
- **Topics and instructions:** Defines the agent's mission to monitor a user's actions within the UI and provide contextual assistance. This includes its objective (for example, "Guide a service rep through the case resolution process") and the specific UI events or data entry patterns it should watch for to proactively offer help.
- **Actions:** Actions, built using Apex or Flow, to surface relevant information and next best actions directly within the user's workflow. These actions enable the agent to fetch and display a relevant knowledge article, suggest a valid next step in a process, or flag a data entry field that may violate a business rule, all in response to the user's real-time activity.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Prompt templates:** Reusable templates that are dynamically populated with live CRM data via merge fields or semantic data from Data 360 RAG Retrievers. These templates allow agents to generate contextual, on-brand content while the Einstein Trust Layer securely masks sensitive information before the instructions are sent to the LLM.
- **Ambience targets**
- Notify users on the surface where the agent and user are, such as on a web page or an admin page
**Interactions**
1. When a user visits a page or app, the agent attaches itself as an observer.
2. The agent starts to inspect data and actions, incrementally detects intents, makes decisions, and calls actions.
3. The agent contextualizes based on intent and fetches additional data (structured or unstructured).
4. The agent provides just-in-time real-time responses without user prompting and can suggest next best actions or offer to perform them on behalf of the user.
5. Agents can seamlessly share this with other agents and users.
**Trade-Offs**
Aspect
Gain
Cost
Scope
Wide set of activity coverage, agent can share the context in different modals (email, calendars, app pages)
Computation cost
Intelligent Automation
Can be a module and extend to fully autonomous AI and can eliminate humans out of the loop where policy is clear
More agent evaluation. Risk of false positives or errors, can go undetected in a reasonable timeframe
Interception Complexity
Can benefit from real time analytics. For example, can detect fraud or threat and stop transactions from occurring
Need agent and human workflows synchronized
Context Depth
Deeper context leads to intelligent decisions
Need to be context-complete
Agent Autonomy
Headless agents work in the background without user prompting, so reduces friction
Less transparency into agent decision-making, more audit trails
Multi-agent
Headless agents can work together to form specialized agents
Headless orchestration and additional complexity
**Related Patterns**
[Listener/Feed pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#listenerfeed-pattern): Can be combined with the Listener pattern to trigger proactive actions based on observed activity
[Data Steward pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#data-steward-pattern): Activity interception AI can utilize data stewards to ensure data quality and consistency when logging intercepted activities.
[Generator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#generator-pattern): Can be used to automatically generate activity summaries or follow-up tasks based on intercepted activities
### 2.4 Collaborative Agent Patterns
This section details patterns for collaborative agents, where one or more agents work in concert with a human user to achieve a shared goal. These recipes focus on creating a seamless partnership: agents handle complex data gathering and task execution while keeping the human in the loop for decisions, approvals, and strategic guidance.
In this model, agents handle the automatable parts of a workflow. The process becomes a dynamic feedback loop.
- A human might initiate a task through a Conversational Agent, which triggers a Proactive Agent to manage the backend steps.
- Concurrently, an Ambient Agent might observe their actions to provide real-time guidance.
This process creates a seamless fusion of human and digital labor. This pattern showcases how Agentforce facilitates a multi-agent, human-in-the-loop system to tackle complex jobs that no single agent—or human—could manage alone.
**Problem**
Your business processes require collaboration among workers from different organizations— both internal and external— each with distinct jobs to be done involving different skills and priority. Process bottlenecks can occur anytime and anywhere due to resource capacity, skill constraints, or due to the amount of information exchanged.
**Context**
- Processes span across teams and need multiple team members to collaborate for a successful outcome.
- Agent assistants already help your workforce in one-to-one scenarios as conversational, proactive, and ambient agents.
- Processes use agents in appropriate segments of your business processes. However, processes also need human–agent collaboration. This collaboration may involve human-to-human with assistance by agents or human—agent—human collaboration.
- Skill gaps are filled by agents.
- Agents help improve collaboration by reducing human effort in tasks such as follow-ups and exchanging critical information to aid decision-making.
- Agents can also collaborate and delegate based on policies and guidelines.
**Key Components**
- **Collaboration surface**
Agentic collaboration requires a shared space where all participants, both humans and agents, can interact. These collaboration surfaces are no longer static, human-only environments. Instead, they are channels where agents can be invited to join, contribute, and even initiate conversations, fundamentally changing the nature of teamwork. For example, an agent can create and initiate a case swarm in Slack inviting human subject matter experts and other agents to collaborate on the case.
- **Agentforce Agents**
This pattern moves beyond individual agent patterns to demonstrate how they converge in a Collaborative Agent model, orchestrating complex processes that intelligently augment human capabilities. The preceding patterns—Conversational (2.1), Proactive (2.2), and Ambient (2.3) \- define the Agentforce Agent components.c direction. A **Conversational Agent** acts as the primary interface, working alongside the human and acts as the interface between humans and all agents involved in the collaboration. When a task is too multifaceted the conversational agent initiates a collaborative session, bringing together the human users and the necessary headless agents to work on the problem concurrently.
The process becomes a dynamic feedback loop where a human might initiate a task, which then triggers a **Proactive Agent** to manage the backend steps, while an **Ambient Agent** might observe to provide real-time guidance, creating a seamless fusion of human and digital labor.
- **Data Layer**
In the collaborative agent model, the data layer serves a more dynamic role than simply providing information; it becomes the persistent memory and shared workspace for the entire human-agent team. While each agent involved has its own specific data needs, as defined in its respective pattern, their collaboration on a complex task hinges on a shared data foundation that tracks the state of the overall job.
This shared state is crucial. As a task is handed off from a conversational agent to a proactive agent, and then to a human for approval, the data layer must track the progress, context, and decisions made at each step. This ensures that every participant has a consistent and up-to-date view of the episode.
**Interactions**
1. Humans initiate a collaborative session with other humans and agents.
2. Context, goals, jobs, and outcomes are defined.
3. The agent enriches the context by bringing in additional information and proactively plans the steps required to complete the job, along with owners who are humans or agents.
4. Progress is observed, context is updated, and actions are performed.
5. Where agents perform the job, the agent provides detailed information to help human stakeholders understand reasoning, provide feedback, and allow interceptions.
6. Agents complete the work with full transparency and compliance.
**Trade-Offs**
Aspect
Gain
Cost
Native Collaboration Surfaces
Agents can participate and immediately contribute to human flow of work
User adoption requires additional training and enablement
Bidirectional context sharing
Agents can surface and share context with all parties, making information available to all.
Intentional asymmetric sensitive information requires additional safeguards.
Faster resolutions means more active work in the queue for humans potentially leading to fatigue
Specialization
Domain specific agents offer high-value assistance.
Increased bounded context needs and domain specificity. Complexity to adapt to changes
Observability
Provide reasoning, audit trails, Agent Evaluations build trust
Increased telemetry costs
**Related Patterns**
[Operator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#operator-pattern): Collaborative agents often act as operators, routing requests to the appropriate specialist AI agents or human service reps and negotiating intent.
[Orchestrator pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#orchestrator-pattern): In scenarios involving collaboration, an orchestrator agent manages a swarm of AI agents, aggregating their responses for a seamless user experience.
[Workspace (Radar O'Reilly) pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#workspace-radar-oreilly-pattern): Collaborative agents use this pattern to manage a responsive, single-pane-of-glass UX, updating relevant content in real-time within a conversation flow.
### 2.5 Autonomous Agent Patterns
In contrast to collaborative patterns that assist a user, autonomous agents are designed for full delegation. This section provides the architectural blueprints for agents that can independently plan and execute complex, multi-step tasks to achieve a high-level goal without requiring human intervention. The focus here is on creating a system you can task with an objective and trust to carry it out from start to finish.
**Problem**
Your organization realizes value through a highly complex set of processes, each with distinct policy-driven jobs, playbooks, and specific skills needed for execution. These are often programs that require significant investment of time and resources.
Setting up a new program has high overhead and can take months before realizing value. Implementing feedback and improvements often requires additional time and effort. Complexity is primarily driven by your organization's structure, where distributed applications and processes can cause dependencies requiring humans to manage the program.
**Context**
- Agents can operate independently from start to finish. Agents are designed and configured so the goal, plan, and strategy are preestablished.
- Agents can make all decisions without seeking human approval. Agents are provided with policy and compliance guidelines.
- Agents can access the necessary context and data it needs and can perform necessary actions without needing humans.
- Humans are notified but are not "in the loop."
**Key Components**
- **Goal and strategy definition layer**
- **Process playbooks:** Detailed descriptions of autonomous execution with deterministic rules that agents must follow
- **Autonomous decision criteria:** Rules that enable agents to make decisions without requiring human approval
- **Fallback rules:** Predefined actions for handling default or exception scenarios when an agent's primary process fails
- **Scopes:** Clearly defined boundaries outlining what agents can and cannot do, including how out-of-scope situations must be handled
- **Success criteria and definition of done:** The metrics and conditions that determine when an agent's task is successfully completed
- **Agentforce Agents**
- **Agent orchestrator or choreographer:** The principal agent that owns the goal, reasons, and plans execution
- **Topics and instructions**: Once a goal is defined, the orchestrator or choreographer agent takes the lead in breaking down that overarching objective into smaller, manageable jobs or sub-tasks. It devises a comprehensive plan, outlining the sequence of jobs and identifies the specific agents or tools required for each step. Finally, the orchestrator agent ensures the seamless execution of the plan, monitoring progress, managing dependencies, and making adjustments as needed to achieve the goal efficiently and effectively. In the case of a choreographer agent, it passes the context and state to the downstream agents to carry the job through to completion.
- **Actions:** Actions call tools to perform a function, retrieve data, or delegate to other headless agents, enabling a broader range of capabilities and more complex workflows.
- **Guardrails:** Guardrails act as a set of configurable rules and runtime checks that constrain the agent's behavior. Acts as a safety layer that can intercept prompts, validate the agent's proposed actions, and filter its final response to prevent harmful content, enforce business rules, and ensure the agent operates within its designated scope.
- **Data Layer**
- **CRM Data:** Customer data available in CRM that provides context to one or more agents
- Data 360 components, including **DLOs and DMOs,** that store relevant customer data ingested from different sources
- **Calculated, streaming, and real-time insights** supply agents with immediate, pertinent data regarding customers, their activity, and critical insights. This enables preemptive problem resolution (like handling email bounces), mitigating escalation.
- **Data 360 vector store and RAG** retrievers provide the agent with a unified view of all relevant enterprise data and unstructured knowledge
- **Slack channel message or conversation data** such as case history and conversational agent history that provide conversation context
- **Monitoring and oversight**
- **Agent goal progress monitoring:** Tracks the progress of autonomous agent sessions to measure outcomes and ensure alignment with objectives
- **Agent operations monitoring:** Tracks the real-time status of autonomous agents for intervention and troubleshooting, ensuring smooth operation
- **Agent governance monitoring:** Tracks trace and audit logs to ensure autonomous agents comply with predefined goals, objectives, and ethical guidelines
**Interactions**
1. The job is defined with clear outcomes.
2. The job is initiated through one of the following methods:
- An agent is tasked.
- An agent proactively picks up the job based on qualifications.
- An agent performs the job in the background.
3. The agent clearly establishes expectations and informs humans, detailing the goal, plan, and strategy. The plan details step-by-step processes, agents used, data used, scope, agent evaluation plan, and checkpoints for humans to monitor progress, operations, and governance.
4. The agent begins execution. At each milestone, it updates the state and progress. Humans have the ability to provide feedback or intercept the agents as needed.
5. The agent completes the job. The outcome and results are available in the monitoring dashboard.
**Trade-Offs**
Aspect
Gain
Cost
Speed
Agents complete the tasks in hours to days rather than weeks to months
Requires enablement for autonomous agentic operation
Autonomy
Agents achieve full execution without human intervention
Intervention is limited and costly during execution
Scalability
Agents scale easily
Rate limits must be established to prevent locking of resources.
Consistency
Agents adhere to policies via guardrails
New scenario handling requires inspection to ensure the correct outcome.
Cost
Agents avoid human in the loop
The process is expensive to build
Human resources
Agents free up critical and expert resources
Experts lack experiential visibility through doing, reducing ability to identify process improvements
Quality control
Can monitor and review
Remediation costs are high if agent errors are not caught immediately
Accuracy
Agents can use context and policies to make the right decision.
Context and data must be curated and maintained to remove any ambiguity or staleness.
**Related Patterns**
[Project Manager pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#project-manager-pattern): Autonomous agents often embody this pattern, overseeing long-running, multi-step processes from initiation to completion with minimal human intervention.
[Configurer pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#configurer-pattern): Autonomous agents can use this pattern to automatically generate and validate configurations based on natural language requirements or predefined policies, ensuring compliance and accuracy without manual oversight.
[Zen Data Gardener pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#zen-data-gardener-pattern): This pattern can be used by autonomous agents for scheduled, background data grooming and standardization, ensuring data quality and consistency over time to support accurate agent decision-making.
## Chapter 3: Common Agentic AI Use Cases
Now, we will bring the agent taxonomy and agent patterns to life by exploring how they are implemented on the Salesforce Platform. For those unfamiliar with the core components of Agentforce, the [Appendix](#appendix) provides a helpful refresher on the key technologies referenced throughout this chapter and the next.
This section takes the taxonomy of agents and illustrates each one with a common use case to show how they are used in real-world applications.
### 3.1 Conversational Agent Use Case: Instant Order Status
A customer, Jane, visits a company's website to check the status of her recent order.
- **Interaction:** Jane opens the chat window (the Agentforce Chat Client).
- **Agent Action:** The conversational agent greets her and asks how it can help. Jane asks, "Where is my latest order?"
- **Process:**
1. The agent, grounded with Jane's customer information from Salesforce, identifies her most recent order.
2. It queries the shipping system (via a MuleSoft connector) for the latest tracking information and provides Jane with a real-time update and a tracking link.
3. It then looks up the policy and automatically upgrades to expedited shipping.
4. When Jane asks a complex question the agent can't handle, it seamlessly escalates the chat to a human service agent, providing the full transcript for context.
**Recipe**
Patterns used: [Conversational AI pattern](#21-conversational-agent-patterns), [Integrating transactional data to agents](#42-data-integration-patterns)
**Design Time**
Set up a conversational agent.
Set up Enhanced Chat
→
Create Service agent
→
Define Support Orders topic
→
Create Get Order action
↓
Add outbound escalation Omni-Channel flow
←
Create Escalate topic
←
Add actions to topics
←
Create Get Status action
↓
Publish the agent
Set up Enhanced Chat as Jane's chat entry point so she can open the Agentforce window in the web page.
Enable Agentforce and create a Service Agent in Agentforce Builder to handle conversations and trigger custom actions.
Define a Support Orders topic with a description and instructions so the agent naturally recognizes "Where is my latest order?".
Get Latest Order for Contact action to retrieve Jane's most recent order
Get Shipping Status by Order ID action to fetch tracking information via MuleSoft
Optionally orchestrate both actions in Flow—fetching the latest order and calling MuleSoft—using external service actions.
Add both actions to the Service Agent in the builder, link them to the Orders & Tracking topic, and publish.
Define an Escalation topic with a description to escalate to a service rep.
Create and activate an outbound Omni-Channel flow.
Add it to the Connections tab in the builder for escalation with an escalation message.
Set up Omni-Channel.
Configure Omni-Channel
→
Define escalation rules in instructions
→
Set priorities and capacity
→
Test and validate
Enable seamless escalation to human service agents when the AI agent cannot resolve the query. Configure Omni-Channel routing to assign chats to service reps and transfer the full transcript for context.
Integrate escalation logic into the Agentforce instructions and an escalation action so the agent knows when to transfer complex cases. Manage routing priorities and capacity through Omni Supervisor.
Test the full experience: Jane opens the chat, and the agent greets her, identifies her order, retrieves shipping data, and escalates seamlessly when human intervention is required (see also Enable Enhanced Event Logs).
Add the PDFs of policy documents that contain the shipping policy exceptions.
Behind the scenes, the documents are automatically chunked, indexed, and made ready to use.
**Agent Runtime Process Flow**
Once the agent is set up and deployed, the following sequence of steps occurs at runtime.
1. **Chat launch:** Jane opens the Agentforce chat (embedded service). Session and contact context load after Jane is logged in.
2. **Greeting and intent:** The agent greets Jane. Jane asks for the status of an order, and intent detection maps "latest order" to the Orders & Tracking topic.
3. **CRM lookup:** The agent triggers the Get Latest Order action and queries Salesforce (order summary/orders) for Jane's most recent record.
4. **Shipping query:** The agent calls the MuleSoft API via a named credential, and /shipping/status/{orderId} returns a real-time status and a tracking URL.
5. **Response composition:** Agentforce merges results and composes a response: "Your order \[OrderID\] shipped via \[Carrier\], arriving tomorrow — \[Track Here\]."
6. **Fallbacks:** If there is no match or an API failure, the agent apologizes and offers to retry to fix any data issues.
7. **Escalation:** Complex or emotional queries automatically transfer to a human via Omni-Channel, passing on the full chat and context.
8. **Logging:** All intents, actions, and outcomes are stored in interaction logs. API latency is monitored in Anypoint Monitoring.
9. **Continuous improvement:** Escalations feed Agentforce retraining; common flows are refined in the subsequent release.
### 3.2 Proactive Agent Use Case: High-Value Cart Abandonment
A high-value customer, John, has added over \$1,000 worth of products to his online cart but doesn't complete the purchase within 60 minutes.
- **Trigger:** A Salesforce Platform event, Cart_Abandoned\_\_e, is fired from the ecommerce system, containing John's contact ID and the cart value.
- **Agent Action:** A proactive agent, subscribed to this event, immediately springs into action.
- **Process:**
1. The agent checks John's record in Salesforce and sees he is a VIP customer.
2. It creates a high-priority task for John's account manager, Sarah, with all the details of the abandoned cart.
3. It sends a notification to Sarah via Slack, urging her to follow up.
4. Simultaneously, it enrolls John in a targeted Marketing Cloud journey that sends a reminder email with a limited-time 10% discount code to encourage him to complete the purchase.
**Recipe**
This recipe details the implementation of a proactive AI agent on the Salesforce Platform to address high-value cart abandonment by VIP customers. The solution leverages Salesforce Platform Events, Data 360 for knowledge retrieval, and Agentforce to orchestrate timely and intelligent follow-up actions, thereby transforming passive data into active business engagement.
**Design Time**
Set up an abandoned cart event to trigger when John, a VIP customer, leaves the cart abandoned.
Create custom Contact field
→
Define new platform event
Create a Cart_Abandoned__e platform event with the fields Contact Id, Cart Value, Cart Last Updated DateTime, and Cart Details.
Configure the abandonment event: Using Commerce Cloud, create a platform event for checkout event notifications. Abandonment is detected when the cart checkout session state is in an intermediate state and the session times out after a threshold. Alternatively, if your ecommerce is an external system, publish the event to Salesforce using any of these methods: Flows, Apex, Salesforce APIs, or Pub/Sub API.
In the Contact object, create a new field, Customer_Tier__c, with the picklist values Standard, Premium, and VIP.
Set up unstructured data ingestion in Data 360: Add a discount policy document sourced from a document repository to Data 360 via Amazon S3.
Create AWS S3 credentials
→
Create new S3 Data Stream
→
Configure and deploy stream
→
Create Search Index
↓
Test retrieval function
←
Configure and deploy index
Create external credentials to access S3: Create a new set of access keys and secrets for an IAM user or IAM Amazon Resource Name (ARN) for an IdP.
Create a new S3 data stream: On the Data Streams tab, create the data stream Policy Documents Stream, select the S3 source, choose the PDF file type, set the refresh frequency, map the metadata fields (file name and size), and then deploy.
After the data stream is complete, create a search index: Use passage extraction for chunking, the E5-large-v2 embedding model, and the hybrid search type, and then deploy the index.
Add a new topic, Recover VIP Cart, with the description that this agent handles high-value cart abandonment for VIP customers.
Add topic instructions to validate VIP status, qualify the cart, notify the account manager in Slack, recommend a discount offer, and enroll the customer in the cart recovery email journey.
Create actions and a task.
Alert Account Manager action: Sends a proactive Slack notification
Recover Abandoned Cart task, assigned to the manager with cart details
Get Discount Offer action: Analyzes policy and previous purchase history. Create a prompt template with grounding, reference the retrieval function in the prompt template, and use the data.
Enroll in Recovery Journey action: Enrolls in the Marketing Cloud recovery journey via the API and takes in all subscriber data and the discounted offer email message generated from the agent.
Create a new platform-event-triggered flow, VIP Cart Abandonment Recovery.
Select the Cart Abandoned event the flow should subscribe to.
Set up a custom agent invocable action in Flow Builder, and select the VIP Cart Recovery agent. Send the request to initiate a VIP abandoned cart recovery for the customer and send the platform event payload.
**Agent Runtime Process Flow**
Once the agent is set up and deployed, the following sequence of steps occurs at runtime.
Customer abandons cart
→
Commerce Cloud publishes event
→
Platform event triggers Flow
→
Flow invokes Employee Agent
↓
Analyzes for discount offer
←
Creates task for manager
←
Alerts manager in Slack
←
Agent executes Recovery topic
↓
Enrolls customer in journey
→
Customer redeems the offer
→
Agent analyzes outcome for feedback
1. **Cart abandonment detection:** John adds \$1,200 to his cart, and no checkout or stage progression after 60 minutes triggers abandonment.
2. **Platform event publication:** Commerce Cloud publishes the Cart_Abandoned\_\_e event with John's contact ID, cart value of \$1,200, cart modified date, and other details.
3. **Flow initialization:** The platform event triggers the VIP Cart Abandonment Recovery Flow.
4. **Employee Agent activation:** When the Flow runs, the VIP Cart Recovery agent gets invoked.
5. **Topic execution:** The agent resolves to the Recover VIP Cart topic and executes the instructions.
6. **Notification creation:** The agent alerts John's account manager Sarah in Slack.
7. **Task creation:** The agent creates a task for Sarah, advising her of the follow-ups it will perform.
8. **Discount analysis:** The agent runs the discount analysis by calling the Data 360 retriever function to ask for "max allowed discounts" based on the cart value, customer tier, and purchase history. In this case, the function recommends a discount offer of 10%.
9. **Email preparation and journey enrollment:** The agent prepares a discount offer email and enrolls John in the Marketing Cloud journey VIP Customer Cart Recovery with the new cart price.
10. **Logging and attribution:** John redeems the offer, which creates a log attribution and conversion metrics.
11. **Feedback analysis:** The outcome is analyzed to further determine offers, time to recovery, and other optimization factors.
### 3.3 Ambient Agent Use Case: Real-Time Sales Call Assistance
A sales representative, David, is engaged in a discovery call with a new prospect. An intelligent agent actively monitors the call in real time, providing immediate support to David by answering the prospect's questions.
**Example:** If the prospect inquires about a specific product specification, the agent automatically retrieves the relevant details and delivers them to David via Slack or a private message.
- **Trigger:** A prospect asks a question requiring specific product information during a discovery call with a sales representative (David).
- **Agent Action:** The ambient agent continuously analyzes call logs and messages, intelligently identifying and fetching required information.
- **Process:**
1. The agent parses the call transcript in real time.
2. It automatically identifies key action items and retrieves relevant information.
3. In this instance, the agent fetches product information directly from Salesforce.
4. It then automatically presents the retrieved information to David via Slack or a private message.
**Recipe**
There are prerequisites in this recipe that require real time speech-to-text capabilities, and we assume they are available through your communication provider. For example, here is a recipe to integrate Zoom calls.
**Prerequisite:** Example real-time transcription of a Zoom call:
- Create a Zoom app in the Zoom Developer Platform with required scopes for reading recording, webhook send, and meeting stream. Enable required product features such as Realtime Media Streams (RTMS).
- Set up an intermediate signaling server ([Zoom RTMS sample](https://github.com/zoom/rtms-samples/tree/main/audio/send_audio_to_aws_transcribe_service_sdk)) that receives the audio stream, forwards it to the Amazon Transcribe service, and gets back the transcribed text. The transcripts are then published to Salesforce as a platform event.
**Design Time**
Add the knowledge articles that contain the product information.
Behind the scenes, the documents are automatically chunked, indexed, and made ready to use.
Use the grounding in the Get Product Spec action.
Publish the real-time transcript to Salesforce via Pub/Sub API.
Server receives audio transcript
→
Server publishes platform event
Create a platform event, Transcript_Segment__e, with the fields Call Id, Sequence, Speakers, Segment Start Time, Segment End Time, Duration, and Transcript Data.
In your signaling server (see the prerequisite section), once you receive the transcribed text from audio, immediately publish the data via the Transcript_Segment__e event. You can publish the event to Salesforce using any of these methods: Flows, Apex, Salesforce APIs, or Pub/Sub API.
Wire Flow to subscribe to the published Transcript_Segment__e event.
Create event-triggered flow
→
Subscribe to Transcript event
→
Add agent invocable action
→
Send payload to agent
↓
Agent sends Slack DM
Create a new platform-event-triggered flow, Discovery Call Insights.
Select the Transcript_Segment__e event that the flow should subscribe to.
Set up a custom agent invocable action in Flow Builder, and select the Sales Call Realtime Response agent. Send the event payload to route to the Assist Call topic. After the question is derived from the topic, the question is sent to the Get Product Spec action for an answer.
The final answer is compiled and sent immediately to the user via a Slack DM.
**Agent Runtime Process Flow**
Once the agent is set up and deployed, the following sequence of steps occurs at runtime.
User starts Zoom call
→
Server transcribes and publishes
→
Flow invokes Response agent
→
Agent queries knowledge base
↓
Analytics refine agent performance
←
Agent compiles call summary
←
Agent continues listening
←
Agent sends Slack DM
1. **Call initiation:** David starts a discovery call with a prospect in a Zoom call. Zoom RTMS streams the live audio to the signaling server transcription endpoint.
2. **Real-time transcription:** The signaling server receives the audio, transcribes the audio to text, and publishes a Transcript Segment platform event in Salesforce Platform.
3. **Agent listening and context classification:** Salesforce receives the platform event and triggers the Discovery Call Insights Flow.
4. The flow initiates the Sales Call Realtime Response agent that receives the segment, identifies questions (such as "Does the Toaster 2XP integrate with mobile devices?"), and classifies them under the Assist Call topic.
5. **Knowledge retrieval:** The agent triggers the Get Product Spec action and queries the knowledge data for matching answers.
6. **Send private Slack DM:** The agent executes Send Slack Insight, posting to David's Slack DM: "Product _Toaster 2XP_ can be integrated with Apple and Android devices and can connect via Bluetooth. Once the app is installed, simply connect via Bluetooth and operate the toaster. Here is the link to the manual."
7. **Real-time continuation:** The agent continues receiving transcript text; if multiple insights emerge, it threads contextual Slack replies without disrupting the call flow.
8. **Post-call summary:** At the end of the session, the agent automatically compiles a summary: key questions, actions taken, and referenced products.
9. **Continuous improvement:** Agentforce Analytics evaluates transcript–response latency, product match accuracy, and sales outcomes to refine topic instructions over time.
### 3.4 Autonomous Agent Use Case: Regional Lead Generation
A sales manager, Bob, tasks an autonomous agent with a goal: "Increase our sales pipeline in the California manufacturing sector by \$5M in the next 60 days."
- **Trigger:** The manager assigns the goal through a command in Slack.
- **Agent Action:** The autonomous agent begins its planning and execution loop.
- **Process:**
1. **Research:** The agent queries Salesforce Data 360 and external data sources (via MuleSoft) to identify companies in California's manufacturing sector that are not current customers.
2. **Qualify:** It analyzes these companies, looking for buying signals like recent funding rounds, new executive hires, or relevant job postings. It scores and prioritizes the top 20 prospects.
3. **Identify Contacts:** It finds key contacts (such as VPs of operations and plant managers) at these companies.
4. **Outreach:** It drafts personalized outreach emails for each contact, referencing specific company news or pain points. It schedules these emails to be sent over the next week.
5. **Follow-up:** It tracks email opens and replies. A positive reply from a prospect triggers an analysis of their calendar to suggest meeting times, automatically generating a Salesforce event and a new Opportunity upon confirmation.
6. **Report:** It provides weekly progress reports to the sales manager in Slack.
**Recipe**
This is a multi-agent scenario where each agent performs a specific task and hands the context, data, and control off to the next agent. We will use a few custom headless agents for research and qualification, and the out-of-the-box Sales Development Rep (SDR) agent for prospect outreach and monitoring. We will also assume that Bob's company uses ZoomInfo for its market research. The company also receives supplier network data that is persisted in a database and contains valuable information about the companies they partner with.
**Design Time**
Set up multi-agent architecture.
Research agent gathers intelligence
→
Qualification agent scores lead
→
SDR agent begins outreach
Research agent: Queries Data 360 and external sources via MuleSoft
Qualification agent: Prioritizes, scores, and enriches leads
SDR agent: Gets lead assignments, executes outreach, follows up, and schedules meetings. Monitor SDR agent activity and progress with Agentforce Analytics for SDR agent.
Discover and ingest new company data.
Create new Data Space
→
Ingest Salesforce CRM data
→
Ingest ZoomInfo data
→
Ingest supplier database data
Setup a new Data Space called Sales and Marketing. This new data space will hold all the data needed for autonomous agents.
Use Salesforce connectors to flow the Lead, Account, Contact, and Opportunity CRM data into the data space.
Configure a Data 360 connector for ZoomInfo. Flow the data into the Data 360 Sales and Marketing Data Space.
Configure the Anypoint Salesforce Data 360 connector to connect to the supplier database and ingest the data into Data 360.
Set up a platform event to initiate the headless Research and Qualification agent.
Create new platform event
Create a new AgentGoal__e platform event with the field goal that captures the human user's high-level goal.
Set up a Goal Orchestrator agent, a conversational AI agent that receives the user's goal and orchestrates it to other agents.
Add a new topic, Parse Goal, with the description that this agent understands the goal intent and is able to call additional agents as needed.
Add topic instructions to parse the goal and trigger events to other agents.
Create a Goal event, AgentGoal__e.
Set up a Lead Research and Qualification agent, which is triggered by an orchestrating agent.
Create Research topic
→
Create deduplication action
→
Create lead enrichment action
→
Create lead scoring action
↓
Add actions to topic
←
Create lead qualification action
Create a Prospect Research topic with the description "Research new leads in a region or state."
Create actions.
Deduplicate Lead Apex action: Check and validate new leads against existing customers
Enrich Lead Apex action, which uses a prompt template: Looks into the unstructured marketing insight and supplier database data to enrich lead data
Score Lead action: Proactively score a lead with updated lead data
Qualify Lead for Agent action: Based on the scoring, assign parameters that qualify the lead for an SDR agent
Set up an Agentforce SDR agent to perform outreach, lead nurturing, and meeting scheduling.
Create SDR agent from template
→
Configure agent knowledge base
→
Configure agent email settings
→
Set lead assignment rules
↓
Define qualifying lead criteria
Create a new SDR agent from the Setup page using the preconfigured Lead Nurture Agent template. Configure the email settings and lead assignment rules, selecting the Lead object or Contact object and defining the qualifying criteria (threshold lead score and new lead) for assignment rules.
Set up Agentforce Lead Nurturing by configuring the agent, assigning permissions, and setting up the cadence and assignment rules.
Set up a new flow to subscribe to the published AgentGoal__e event.
Create event-triggered flow
→
Subscribe to Agent Goal event
→
Add agent invocable action
Create a new platform-event-triggered flow called Route Goals to Agents.
Select the Agent Goal event that the flow should subscribe to.
Set up a custom agent invocable action in Flow Builder, and select the Lead Research and Qualification agent.
**Agent Runtime Process Flow**
Once the agent is set up and deployed, the following sequence of steps occurs at runtime.
User assigns high-level goal
→
Orchestrator agent creates event
→
Flow routes goal to agent
→
Research agent qualifies lead
↓
Monitor agent with analytics
←
SDR agent schedules meeting
←
SDR agent begins outreach
- **Goal assignment:** Bob tasks an autonomous agent to "increase pipeline in California manufacturing by \$5M in 60 days."
- **Goal orchestration:** The autonomous Goal Orchestrator agent receives the goal, parses the intent, and creates a platform event, AgentGoal\_\_e. The Goal Orchestrator agent is designed to continuously expand its capabilities to handle multiple goals. You can expand it to add additional orchestration capabilities or ask the user for clarification to better understand the intent and initiate the goal.
- **Routing:** The Flow Route Goals to Agents gets triggered and calls the Lead Research and Qualification agent.
- **Research:** The Lead Research and Qualification agent queries Data 360 for new lead information, deduplicates against existing customers, pulls additional market research data from Data 360, and enriches the lead. It further scores the lead, identifies key contacts, and qualifies the lead.
- **Outreach:** Once the lead is qualified, the lead becomes eligible for the SDR agent via the lead assignment rules. The SDR agent does the initial outreach and maintains conversations with the contact by answering questions related to the product.
- **Follow-up:** At the end of the cadence or at the request of the lead, the agent prompts for a meeting schedule if the lead is qualified for service rep engagement. It then schedules the meeting and exits the flow.
- **Agent Analytics:** The [SDR Agent Analytics](https://help.salesforce.com/s/articleView?id=sales.sales_agent_sdr_analytics.htm&type=5) dashboard provides insights into how effectively the agent performs.
### 3.5 Collaborative Agent Use Case: Complex Service Escalation
A long-time customer is experiencing a multifaceted issue: they were overbilled, the replacement part they received was incorrect, and their service is now disconnected.
- **Trigger:** The customer initiates a chat, and the initial conversational agent quickly recognizes the complexity and escalates to an agent swarm.
- **Agent Action:** An orchestrator agent takes charge.
- **Process:**
1. **Orchestrator:** Maintains the conversation with the customer, providing updates
2. **Orchestrator delegates:** Using the A2A protocol implementation, the Orchestrator discovers "related agents" (Billing, Logistics, and Provisioning) with the required capabilities and dispatches tasks.
- To **Billing Agent:** "Investigate invoice #INV-7890 for customer X. Are there discrepancies?"
- To **Logistics Agent:** "Check tracking number #TN-12345 for customer X. Confirm the part number shipped and the current inventory for the correct part."
- To **Provisioning Agent:** "Check service status for account #ACC-5678. If disconnected, what is the reason code?"
3. **Specialized agents execute:** Each agent receives the A2A request, queries its respective system, and formulates a response.
4. **Synthesis:** The agents report their findings back to the Orchestrator via A2A responses. The Orchestrator synthesizes the information: "The customer was indeed overbilled by \$50. The wrong part was shipped due to a warehouse error. The service was disconnected automatically due to the billing issue."
5. **Acknowledgement:** The Orchestrator informs the customer about the issue and offers to escalate the issue to a human service rep with clear guidance on the next steps.
6. **Resolution:** It then proposes a complete solution to the service rep for approval. The service rep joins the conversation. The service rep quickly looks at all the data relevant to the issue, including the agent's recommended solution: "Create a new shipping order for the right part with expedited shipping. Initiate a return for the wrong part. Approve 10% discount on the new order and upsell the part with the latest improved version. Update payment information and offer to set up a recurring billing arrangement."
**Recipe**
This recipe outlines the implementation of a collaborative agent system designed to tackle complex customer service issues involving multiple facets. By using an orchestrator agent to delegate tasks to specialized agents (Billing, Logistics, and Provisioning) via an A2A protocol and then synthesizing their findings, the system provides comprehensive solutions and seamlessly integrates service reps for final approval and customer interaction.
**Design Time**
Set up Enhanced Chat as the customer's chat entry point so they can open the Agentforce window in the web page.
Set up an Agentforce Billing Agent, a headless specialized agent that can take an order or invoice and perform a billing inquiry.
Define a topic, Billing Inquiry, with the description "Investigate invoice discrepancies, payment issues, and billing errors."
Add a custom flow action, Check Invoice Discrepancy, with an input of Invoice Number, Customer ID, and Date Range, and an output of Discrepancy Amount, Root Cause, and Affected Transactions.
Set up an Agentforce Logistics Agent, a headless specialized agent that can verify shipments, track shipping, and check inventory.
Define a topic: Shipping Verification, with a description to verify shipping for invoice.
Add a custom Flow action, Verify Shipping Details, with an input of Invoice Number, Customer ID, and Date Range, and an output of Shipped Part, Date, and Inventory Status.
Set up an Agentforce Provisioning Agent, a headless specialized agent that can verify provisioning and service status.
Use Anypoint Agent Fabric for orchestration of agents.
MuleSoft Agent Broker can help in orchestrating any agent across platforms based on agent capabilities mentioned in the agent cards.
Set up an Agentforce Help Agent, conversational AI agent that interacts with customers, assesses complexity, and coordinates with multiple specialized agents to resolve the issue.
Create Service Agent
→
Define Investigation topic
→
Create notification action
→
Define Orchestration topic
↓
Define Escalation topic
←
Create Create Case action
←
Create Call Agent action
←
Create agent orchestration flow
↓
Create Omni-Channel flow
→
Connect flow for escalation
Enable Agentforce and create a Service Agent in Agentforce Builder to handle conversations and trigger custom actions.
Define a topic, Service Investigation, with a description and instructions so that the agent naturally recognizes a complex topic with, typically, multiple simultaneous issues.
Status Notification action to acknowledge the issue and provide progress updates
Define an Orchestration topic that can call other agents via actions.
Create a Call Agent action that calls a Flow action. The Flow action has several agent actions and can initiate each of the headless agents: the Billing Agent, the Logistics Agent, and the Provisioning Agent.
Create a Create Case action that creates a case, adds details, and sets the status.
Define an Escalation topic with a description to escalate to a service rep.
Create and activate an outbound Omni-Channel flow.
Add it to the Connections tab in the Agent for escalation with an escalation message.
**Agents Orchestration Process Flow**
Anypoint Code Builder now supports building agent brokers. An agent broker is an intelligent routing and orchestration layer that connects agents across domains and engages the best-fit agents and tools. MuleSoft Dev Agent generates the code to set up a foundation for the broker.
Based on agent capabilities mentioned in the agent cards (A2A servers), which were previously registered with Agent Registry, further configurations are done automatically by Anypoint Code Builder. Lastly, we can deploy this agent broker to the cloud.
Once the agent broker is available for consumption, these requests are routed to the proper agents. A broker receives a prompt and uses the LLM to decompose it into tasks and determine which agent to call first. In each iterative loop, it determines if it has successfully addressed the original prompt or if it needs to work with additional agents to complete the job.
Agentforce Help Agent
→
MuleSoft Agent Broker
→
Billing Agent as A2A server
→
Logistics Agent as A2A server
↓
Help Agent gets response
←
Broker aggregates response
←
Procurement Agent as A2A server
**Agent Runtime Process Flow**
Once the agent is set up and deployed, the following sequence of steps occurs at runtime.
Customer starts chat
→
Customer states multiple issues
→
Agent investigates order details
→
Orchestrator calls specialist agents
↓
Orchestrator synthesizes resolution plan
←
Provisioning Agent finds issue
←
Logistics Agent confirms error
←
Billing Agent finds discrepancy
↓
Agent escalates to service rep
→
Service rep offers resolution
→
System agent executes tasks
→
Agent updates and closes case
1. **Chat launch:** A customer opens the Agentforce chat (embedded service). Session and Contact context load after the customer is logged in.
2. **Greeting and intent:** The agent greets the customer. The customer, with clear frustration, notifies about overcharges, the wrong part, and disconnected service.
3. **CRM lookup:** The agent triggers the Get Latest Order action and queries Salesforce (order summary/orders) for the customer's most recent record. The agent then confirms the order in context and notifies the customer that it will investigate. It further looks up the invoice ID, the tracking number associated with the invoice, and the asset ID related to the service.
4. **Orchestrator activation:** The orchestrator agent receives the escalation and order ID and then creates a case. It passes the context data to and communicates with three agents: the Billing Agent, the Logistics Agent, and the Provisioning Agent.
5. **Billing Agent response:** The Billing Agent returns with details on the part, unit cost, and the total cost. It also notes a discrepancy between the part in the order and the part in the invoice. The Billing Agent looks up the price for the part in the order and reasons for the overcharge.
6. **Logistics Agent response:** The Logistics Agent returns with details on the shipped part and the exception notes created by the logistics system that state the wrong part could have been sent due to tagging issues. The Logistics Agent also verifies that the issue is now fixed and the correct part is available in original and newer versions.
7. **Provisioning Agent response:** The Provisioning Agent returns with details on the service disconnect and the issue about the expired payment information. It also provides the notifications sent to advise the customer to update the payment information.
8. **Orchestrator synthesis:** The orchestrator agent synthesizes the responses from all these agents and composes a solution by looking at knowledge articles for each of the issues. First, it looks up information on the wrong part and initiates a return. Second, it offers a discount for the issue based on the resolution policy documents and also recommends an upgrade to a newer version that the customer can buy (but there is a price difference). Third, it needs new payment information from the customer, so it escalates to the service repo to communicate the resolution.
9. **Escalation:** The orchestrator agent escalates to the service rep—providing all the necessary context, investigation notes, and resolution recommendations along with necessary approvals—and brings the service rep into the call.
10. **Human in the loop:** The service rep thanks the customer for their patience, apologizes for the trouble, and explains the issue. The service rep then offers a 10% discount for the part as compensation and also informs the customer of a new upgraded part and its benefits. Lastly, they explain about the disconnect, get the new payment information, and update the system.
11. **Proactive restoration:** The AI agent watches the conversation and proactively acts on restoring the service, ordering the upgraded part, and creating a new invoice with the discount and adjusted price.
12. **Case closure:** Finally, it compiles the summary, updates the case, and closes the case.
## Chapter 4: Integration Patterns for Agents
For an agent to be effective, it must be able to integrate with a broad set of enterprise data and tools. This provides the essential context an agent needs to perform its configured goal. The Agentforce framework provides a sophisticated integration architecture that integrates data that is both **internal** to Salesforce and **external** to Salesforce.
This section explores the patterns for connecting agents to these resources. These patterns are built upon two foundational approaches for integration.
- **Internal integration (data access and tool access):** For resources within the Salesforce ecosystem, an agent has two ways to operate.
- **Data access:** The Agentforce core runtime is deeply integrated with Data 360, allowing it to _directly_ query internal data services. It can natively formulate and execute queries against **Data Graphs** to get a 360-degree view of the customer, perform semantic searches via **RAG** to understand unstructured knowledge, and access bulk information using the **Data 360 Query API.** This direct path is optimized for speed and flexibility in data retrieval.
- **Tool access:** When a task involves complex business logic or multi-step processes, or when it requires strict governance, its capabilities are encapsulated in **Actions**. Built with Apex or Flow, these actions provide a secure and reusable interface for the agent to do more than just read data—they allow it to update records, trigger platform events, or execute any established business process.
- **External integration (MCP/A2A):** When an agent needs information outside of Salesforce (for example, from an external application, a microservice, or another agent), it uses the **Model Context Protocol (MCP).** This open standard provides a common language for interoperability. MCP Servers can be added from [AgentExchange](https://agentexchange.salesforce.com/) or an admin can add in Agent Registry or an Apex callout to the MCP server. Then the action initiates the request to an external MCP server, bridging the internal and external worlds in a structured way. Similarly, when an agent needs to communicate with another agent, the **Agent2Agent (A2A)** protocol facilitates this interaction. This allows for the creation of complex, multi-agent systems where specialized agents can collaborate to solve intricate problems, promoting modularity and reusability.
The following patterns are organized around the specific data integration themes agents need. We will demonstrate how these patterns are applied to solve distinct data challenges, from **connecting to external applications** using MCP to accessing **high-volume bulk data** in Data 360, real-time **transactional records**, and **unstructured content** using the powerful combination of direct access and formal actions within Data 360.
### 4.1 Tool Integration Patterns
**Problem**
An agent's effectiveness depends on its ability to operate external tools. However, these tools—from legacy ERPs to modern SaaS applications—lack a shared language. Each has a unique API, authentication model, and data format. This forces developers into a brittle and unscalable cycle of building and maintaining custom, point-to-point integrations for every new tool the agent needs to use.
**Context**
Consider an agent tasked with resolving a damaged shipment case. To succeed, it must interact with three different external systems: it needs to query a **supplier's API** to check for replacement inventory, call a **logistics partner's service** to arrange a new delivery, and access a **financial system** to process a credit. Without a common protocol, the agent would require three separate, bespoke integrations, each a potential point of failure. [MCP](#2-agent-interoperability-a2a-and-mcp) provides a standardized communication layer to make these interactions seamless and reliable.
Following are recipes for how you integrate external services exposed via MCP to your agent.
**Recipe 1:** **Enabling External Tools with MCP**
**Problem**
Organizations run on a mix of legacy ERPs and modern SaaS, but integrating them with an agent is hard because there's no common protocol—each tool has its own APIs, authentication, and data model. Developers end up building and maintaining custom point-to-point connectors for every tool, producing fragile, unscalable, and costly integrations.
**Pattern**
The agent invokes an external tool (exposed via MCP) through a structured action, allowing it to use specialized tools beyond the Salesforce platform.
**Context**
- The agent acts as a proxy for a set of tools that exist outside the Salesforce platform.
- These external tools may have diverse APIs, authentication mechanisms, and data formats.
- A standardized communication protocol is required to enable seamless interaction between the agent and these external tools.
- Reusability is a key concern, as the same external tools may be utilized by multiple agents for different purposes.
**Interactions**
1. **Trigger:** A user request or an internal event within Agentforce necessitates the use of an external tool.
2. **Intent to act:** The Agentforce Agent identifies the intent and determines that an external MCP-based tool is required.
3. **Planner (internal):** The Agentforce Agent's planner selects the appropriate MCP tool or action based on its configured instructions and available tools.
4. **Execution:** The Agentforce Agent sends an MCP-compliant request to the external MCP server (for example, via an Apex callout to a MuleSoft endpoint, which then routes to the external MCP server).
5. **External processing:** The external MCP server processes the request, interacts with the underlying external application, and prepares an MCP-compliant response.
6. **Result**: The external MCP server returns the response to the Agentforce Agent.
7. **Follow-up:** The Agentforce Agent processes the response, updates its internal state, and continues its task or provides feedback to the user.
**Trade-Offs**
Aspect
Gain
Cost
Flexibility
Access to diverse external capabilities
Initial development for MCP server/integration layer
Modularity
Agent capabilities are decoupled from external tools
Requires careful API design and versioning
Scalability
Uses external system's scalability
External system's performance becomes a dependency
Standardization
Standardized protocol (MCP)
Adoption and/or wrapper
Security
Centralized security for external access
Management of credentials and access policies for external systems
Maintainability
Updates to external tools do not require agent changes. MCP can signal changes
Cost of frequent changes
### 4.2 Data Integration Patterns
An agent's decision-making logic is only as sound as its underlying data. For an agent to act intelligently, it must have a rich, real-time understanding of the world around it. Without a defined data ingestion architecture, the agent cannot access or process the high-volume, real-time information that is essential for it to function.
**Integrate Transactional Data with Agents**
**Problem**
Agents frequently need to perform low-latency read/write operations on individual records residing in systems of record (for example, updating a case or fetching an order status). These actions require data integrity and reliability to ensure consistency of the underlying data model. The core architectural challenge is providing a secure, real-time, and scalable pattern for this transactional data access without creating brittle point-to-point integrations.
**Context**
Successfully connecting an agent to these records requires a robust architecture composed of several **core components.**
- **Transactional systems:** These are the authoritative sources of the data, such as systems of record, like **Salesforce**, **Workday** or **SAP,** or services hosted on platforms like **AWS.**
- **Integration layer:** A powerful integration layer, typically handled by **MuleSoft,** is crucial for securely connecting to these disparate systems, transforming data, and exposing it to the Agentforce platform.
- **MCP servers:** To ensure interoperability, agents communicate with these external systems using the MCP standard. The integration layer may connect to various **MuleSoft, Heroku, or third-party MCP servers** that host the external services or agents.
- **Agent Exchange:** This component acts as a directory or switchboard, allowing the Salesforce agent to discover and securely connect to the correct external service or agent to complete its task.
**Recipe 1: Direct Record Operations via MCP**
**Pattern**
The agent uses MCP to connect to a transactional data system and performs stateful CRUD operations on specific, identified records with immediate consistency requirements.
**Context**
- Conversational, collaborative agents must transact system-of-record data in the flow of work.
- The system of record is an external system.
- Transactions need to be idempotent.
**Key Components**
- **Agentforce Agent:** With topics and instructions to make a transactional update. Actions calls an external MCP server or Agentforce Exchange–registered MCP server.
- **MCP server:** The MCP server that exposes the transaction data and function (for example, tool=billing.update_record with input data)
- **External system of record:** The system where the stateful change occurs
**Interactions**
1. **Trigger:** A command or event occurs requiring a transaction on a record.
2. **Intent to act:** An Agentforce Agent identifies a state change intent.
3. **Planner (internal):** The planner chooses an MCP tool.
4. **Execute:** The tool is executed after policy-, record-, and field-level access checks pass.
5. **Result:** The MCP server returns a response
6. **Follow-up:** The Agentforce Agent processes the response.
**Trade-Offs**
Aspect
Gain
Cost
Speed
One tool call
More governance overhead
Idempotency and Safety
Safe retries
Implementation to support dedupe and idempotency
Scalability
Can scale easily
Connection overhead
Consistency
Clear and explicit
Atomic
Safety
Guardrails and policies can be implemented.
Operation overhead to cascade policy changes
Observability
Correlation and audit are available for operation.
Increased telemetry costs
**Recipe 2: Complex Orchestration via MuleSoft API**
**Pattern**
The agent leverages MuleSoft API for complex, multi-step, cross-system atomic transactions. This provides a single, governed endpoint, ensuring reliable end-to-end processing and avoiding the consistency, reliability, latency, and data issues associated with direct calls to individual systems.
**Context**
- Conversational and autonomous agents often need to perform several operations reliably.
- There are multiple transactional systems and operations in a transaction.
- Workflows require transaction/rollback, retries, and policy enforcement.
- Transaction needs are real-time, idempotent, observable, and compliant.
**Interactions**
1. **Trigger:** A command or event occurs, requiring a complex transaction to be completed.
2. **Intent to act:** The Agentforce Agent identifies the intent.
3. **Planner (internal):** The planner chooses an [invocable action for API or API action](https://help.salesforce.com/s/articleView?id=platform.api_catalog_activate_agent_topics_and_agent_actions.htm&type=5).
4. **Execution:** The API is executed and a response returned.
5. **Follow-up:** The Agentforce Agent processes the response.
**Trade-Offs**
Aspect
Gain
Cost
Speed
One call for multiple distributed operations
Development and operational overhead
Idempotency and Safety
Safe retries/SAGA support
Complexity
Scalability
Can scale easily, can be async
Eventual consistency for Async
Safety
Policies in API layer
Operation overhead to cascade policy changes
Observability
Correlation and audit available for tracing
Increased telemetry costs
**Integrate Analytical Data with Agents**
**Problem**
Organizations have invested heavily in analytical infrastructure—data warehouses and lakes, real-time analytical systems, and business intelligence platforms—yet AI agents remain disconnected from these systems. This creates a gap in an agent's ability to get an enriched context (for example, that a customer had returned parts three times in the last quarter) to help make better decisions (in this case, escalation).
**Context**
An agent's operational intelligence is derived from its ability to synthesize information from fundamentally different data formats and sources. This architectural pattern, therefore, is not designed for a single use case but as a foundational data ingestion framework. An effective agent must be equipped to process structured sources to perform logical, data-driven analysis; an agent requires access to high-volume, structured feeds. This includes integrating with enterprise **data lakes** (via zero copy integration with Data 360), processing **middleware-transformed** data streams, or ingesting batch files such as **CSVs**.
**Recipe 1: Data Lakes Integrated via Data 360 Zero-Copy**
**Problem**
Organizations face high costs when using traditional data pipelines to copy, manage, and transform analytical data stored in data lakes (for example, Snowflake). Historically, analytics have been largely offline, resulting in missed opportunities for timely action.
**Pattern**
The agent queries zero copy data (and calculated insights) available in Data 360 rather than querying external data warehouses for critical insights. This helps agents ground both transactional and analytical data for better decision-making.
**Context**
- Your organization stores customer and operational data in data warehouses and lakes.
- Your agents need access to aggregated metrics, historic trends, and analytical insights.
- Your agent's context needs both transactional and analytical data (consider a research agent's need for historical trend data).
**Interactions**
1. **Trigger:** An agent receives a query regarding an insight that requires access to analytical data or a calculated insight.
2. **Execution:** The agent executes an action that calls Data 360 Calculated Insights via Query API, and the calculated insight is returned.
3. **Follow-up:** The Agentforce Agent processes the response.
**Trade-Offs**
Aspect
Gain
Cost
Data Movement
None; zero copy
Compute cost
Latency
From days or weeks to near-real-time
SLAs
Scalability
Unlimited data volume
Compute cost
**Recipe 2: Triggering Actions from Data Streams**
**Problem**
Organizations continuously generate valuable information from business activities like web site visits, calls, meetings, chats, and sensor data. However, by the time these interactions become available or retrieved from data warehouses, critical insights are lost, and the opportunity for timely intervention has passed. Consequently, organizations miss the majority of actionable intelligence needed in real-time, which is often buried in these ephemeral streams. This leads to gaps, missed coaching opportunities, and decisions made without complete context.
**Pattern**
The agent receives real-time or near-real-time insights from [streaming insight](https://help.salesforce.com/s/articleView?id=data.c360_a_create_streaming_insight.htm&language=en_US&type=5) or a [real-time insight](https://help.salesforce.com/s/articleView?id=data.c360_a_create_real_time_insight.htm&language=en_US&type=5) in Data 360 via a data action, or the agent accesses a streaming insight in real time by querying an MCP server that interfaces with a real-time processing engine like Apache Flink.
**Context**
- Streaming systems such as platform events, Pub/Sub API, and RTEM generate enormous amounts of stream data.
- Stream processing systems like Data 360 and Apache Flink process these individual events as they arrive.
- Agentforce needs to query the stream systems (for example, the most recent 30-second transcript for the live meeting with additional context) or gets triggered by data action (for example, fraud detection).
- There's a need for near-real-time, low-latency action.
**Interactions**
1. **Stream emit:** The source system emits a continuous stream of data.
2. **Stream processing:** Stream processing engines like Data 360 or Apache Flink processes the information.
3. **Transform:** Insights are aggregated, transformed, and synthesized into agent-aware data in middleware (for complex transformation) or in Data 360.
4. **Stream insight event:** A Data 360 Data Action is triggered for synthesized data (for example, a transcript of a 30-second audio stream).
5. **Enrich:** An agent adds context and detects intent.
6. **Execute:** The agent executes action.
7. **Follow-up:** The agent waits for the next streaming insight.
**Trade-Offs**
Aspect
Gain
Cost
Latency
Available in seconds
Compute and implementation cost
Coupling
Producers are independent of consumers.
Harder to debug and trace
Scalability
Can scale
Limits
Ordering
Incremental context build
Out-of-order arrival
Value
Near-real-time insight
Governance and compliance overhead
**Integrate Semantic Data with Agents**
Organizations have business artifacts—catalogs, manuals, policies, knowledge graphs, relationship maps—in different formats and shapes. To move beyond simple task execution and engage in sophisticated reasoning, agents must be able to comprehend this data where most human knowledge is stored.
**Recipe 1: RAG: Unlocking the Power of Unstructured Data for Agents**
**Problem**
Organizations frequently possess unsearchable information that hinders agents' ability to access it with confidence. This deficiency often leads to incomplete responses from agents, lacking the necessary contextual depth and verifiable citations to establish trust. Consequently, there is a clear need for a standardized method to enable agents to consistently retrieve semantically relevant and accurate content.
**Pattern**
This pattern provides the architecture for enabling agents to ingest and interpret a wide variety of unstructured information, from internal documents to public web content. Giving an agent access to this data is the key to unlocking advanced capabilities like market sentiment analysis, document summarization, and competitor research.
**Context**
- Knowledge is in files in different formats and shapes.
- Redundant content is prevalent across these documents.
- An agent needs accurate information that can be cited.
- Knowledge changes frequently, so files need to be refreshed and reindexed.
**Interactions**
The content cannot be ingested or used by the agent as is. The content needs to be chunked, embedded, stored in a vector database, and indexed before it can be retrieved and used by agents.
**Ingest and prepare**
1. **Crawl and ingest sources:** Sources can be identified in two ways: manually, such as uploading a PDF file, or by their location, such as AWS S3.
2. **Chunking:** The ingested content is broken down into smaller, manageable chunks to facilitate efficient processing and retrieval. This is a critical step for RAG, as it ensures that only the most relevant pieces of information are retrieved, rather than entire documents.
3. **Embedding:** Each chunk is then converted into a numerical representation called an _embedding_ using a specialized language model. These embeddings capture the semantic meaning of the text, allowing for similarity-based searches.
4. **Vector storage:** The embeddings are stored in a Data 360 vector store, a specialized database optimized for high-performance similarity searches. This allows the agent to quickly find related content.
5. **Indexing:** The content and its embeddings are indexed within the vector store, making them readily searchable for retrieval.
**Data 360 retriever functions**
- **Retrieve content:** This function takes a query as input and performs a semantic search against the Data 360 vector store to find the most relevant content chunks.
- **Filter content:** This function allows for filtering retrieved content based on metadata, such as document type, author, or date, to further refine results.
- **Rank content:** This function ranks the retrieved content chunks based on their similarity score (vector search), keyword score, or a combination of both (hybrid search).
**Retrieve and generate**
- **Query:** When an agent needs information, it formulates a query that is also embedded into a vector.
- **Semantic search:** The agent performs a semantic search against the Data 360 vector store, comparing the query's embedding to the embeddings of the stored content chunks. This retrieves the most semantically relevant chunks based on vector score or hybrid score (vector and keyword combined).
- **Retrieval-augmented generation (RAG):** The retrieved content chunks are then provided as context to Agentforce Agents along with the original query. The LLM uses this context to generate a precise, accurate, and citable answer.
- **Response and citation:** The agent presents the generated answer, often with citations to the original source documents or web links, to build trust and allow for verification.
**Trade-Offs**
Aspect
Gain
Cost
Accuracy
Higher trust (grounded answers with citation)
Document curation and hygiene
Retrieval
Handles natural language and keywords
More storage, tuning effort
Security
Can enforce privileged access
Runtime overhead, cache complexity
Chunking
Better relevance
More preprocessing and tuning
Versioning
Filters outdated knowledge
Maintenance and governance costs
**Recipe 2: Data Graphs: Pre-Curated Structured Graph Data for Agents**
**Problem**
Organizations frequently possess siloed relationship data that hinders an agent's ability to retrieve it. This issue frequently results in agents providing incomplete responses that lack sufficient contextual detail to build trust about how different entities are connected, or causes delays when agents must retrieve information from multiple databases.
**Pattern**
This pattern provides the architecture for enabling agents to ingest and interpret a wide variety of structured and semi-structured relationship information, from internal CRM data to external knowledge graphs. Giving an agent access to this data is the key to unlocking advanced capabilities like customer 360 views, complex dependency analysis, and dynamic context building.
**Context**
1. Relationship data is scattered across various systems and formats.
2. Agents need to understand connections between entities (for example, a customer, their cases, their orders, and related products).
3. Knowledge graphs and connected data models are essential for understanding complex relationships.
4. The agent needs accurate information about entity relationships that can be cited.
**Interactions**
The relational data needs to be harmonized and represented in a graph structure before it can be effectively queried and used by agents.
**Ingest and prepare**
1. **Crawland ingest sources:** Data sources (for example, CRM systems, ERPs, external APIs, and CSVs) are identified and ingested into Data 360.
2. **Data harmonization:** Raw data is mapped to Data Model Objects (DMOs) within Data 360, standardizing its structure and creating a unified view.
3. **Identity resolution:** Duplicate customer profiles are consolidated and related records are linked to create a single, accurate view of each customer.
4. **Data Graph Creation:** DMOs are connected to form a data graph, representing relationships between different entities (for example, a customer DMO is connected to a case DMO, which is connected to a product DMO). This graph allows for efficient traversal of relationships.
5. **Calculated Insights:** Aggregate metrics and derived attributes (for example, a customer's total purchase history) are calculated and added to the data graph for richer context.
**Retrieve and generate**
1. **Query:** When an agent needs information involving relationships between entities, it formulates a query against the data graph (for example, "What are all open cases for this customer and what products are associated with them?").
2. **Graph traversal and Query API:** The agent uses the Data 360 Query API to traverse the data graph and retrieve connected records, calculated insights, and relevant attributes based on the query.
3. **Contextual generation:** The retrieved relationship-aware data is then provided as context to Agentforce Agents along with the original query. The LLM uses this enriched context to generate a precise, accurate, and citable answer that reflects the interconnectedness of the data.
4. **Response and citation:** The agent presents the generated answer, often with references to the specific records or relationships within the data graph that informed the response, to build trust and allow for verification.
**Trade-Offs**
Aspect
Gain
Cost
Accuracy
Higher trust (grounded answers with verifiable relations)
Data harmonization and graph modeling effort
Retrieval
Handles complex relational queries
Graph traversal can be computationally expensive for very large graphs
Security
Can enforce privileged access based on relationships
Runtime overhead, complex access control
Context Depth
Rich, holistic understanding of entities and their connections
More preprocessing and tuning for graph optimization
Maintainability
Centralized data model for relationships
Continuous alignment of DMOs with evolving business needs
## Conclusion
The enterprise stands at the edge of a new era of automation and intelligence, led by AI agents. From handling simple customer queries to autonomously executing complex business strategies, agents promise to redefine productivity and customer engagement. The Salesforce Agentforce platform offers the essential, trusted foundation for this transformation. With a robust suite of declarative and pro-code tools, a unified data platform, and commitment to open standards through A2A and MCP, Agentforce provides a comprehensive and trusted foundation to build every type of agent. This architecture allows organizations to deploy intelligent, goal-oriented agents that act as connected partners, not in isolation, to drive measurable business success.
## Appendix
### Building Advanced Agents with Agentforce: What You Need to Know
Salesforce provides a powerful, integrated set of tools, unified by the Agentforce platform, that serve as the foundation for building sophisticated agents. The recipes and examples in this document assume familiarity with the capabilities of the Agentforce platform and how agents interoperate. This section offers a refresher on the key components you need to understand to get the most out of the recipes and patterns in this document.
### 1. Agentforce Platform Capabilities
This section outlines the foundational platform capabilities that are essential for architects and developers building agents on Agentforce.
- **Salesforce Flow:** The primary tool for defining agent logic. Its declarative, visual interface is ideal for orchestrating the steps an agent will take.
- **Apex:** Provides the power for complex custom logic, state management for autonomous agents, and intricate integrations
- **Platform Events:** The nervous system for proactive and collaborative agents, serving as the transport layer for the A2A protocol.
- **Data 360:** The agent's unified, long-term memory. It provides the context necessary for intelligent action and is the foundation for retrieval-augmented generation (RAG).
- **MuleSoft:** The agent's bridge to the outside world, enabling both system integration and cross-platform agent communication via MCP.
- **Slack:** A primary surface for human–agent interaction, including tasking, notifications, and approvals
- **Agentforce Chat Client:** The customizable, embeddable front-end for customer-facing conversational agents
### 2. Agent Interoperability: A2A and MCP
For agents to be truly effective, they cannot exist in a silo. Agentforce embraces two core interoperability patterns:
- **Agent2Agent (A2A) communication:** This protocol governs how agents within the Salesforce ecosystem communicate with each other. The Agentforce platform acts as both an **A2A client and a server,** making and listening for requests, respectively, which is crucial for collaborative agent swarms. Agents can be configured with **related agents** to discover and invoke other agents with specific skills, creating a dynamic and extensible system. Platform events serve as the durable, asynchronous transport mechanism for these A2A messages.
- **Model Context Protocol (MCP):** This [standard](https://modelcontextprotocol.io/docs/getting-started/intro) ensures that agents are not locked into a single platform. MCP defines a common message format that allows agents built on different frameworks to communicate. In this model, **Agentforce acts as an MCP client.** For example, a Salesforce agent could query an external agent specializing in complex logistics calculations by sending it an MCP-compliant request. MuleSoft serves as the gateway, transforming the internal A2A request into an external MCP-formatted API call, ensuring seamless interoperability across the enterprise.
# From Composable Integration to a Governed Agentic Enterprise
The transition to the Agentic Enterprise represents the most significant architectural shift since the dawn of the cloud. It promises unprecedented levels of productivity and automation, but it also introduces profound challenges that relate to governance, security, and operational complexity. Using a piecemeal approach \- deploying agents in silos without a unifying strategy \- is a direct path to technical debt and organizational chaos.
Deploying agents without a central management plane creates significant operational risk, including security vulnerabilities from direct system access, lack of observability into agent interactions and actions, and high costs due to redundant point-to-point integrations. This siloed deployment strategy results in a brittle environment that’s difficult to manage at scale. A sustainable model requires a unified platform for agent integration and governance.
_MuleSoft_ provides a comprehensive, unified, and open platform to confidently guide enterprises throughout their journey. It leverages the enterprise’s existing API landscape as the foundation for agentic actions, and accelerates creation of new agent-ready assets through a trusted, AI-powered development lifecycle. Through enterprise-grade support for open standards like Model Context Protocol (MCP) and Agent2Agent (A2A) protocols, it makes these assets actionable for both simple commands and complex multi-agent collaboration, regardless of how the AI landscape evolves. [_MuleSoft Agent Fabric_](https://docs.mulesoft.com/agent-fabric/) provides a solution to discover, orchestrate, govern, and observe the entire agent ecosystem. Through this integrated approach, _MuleSoft Agent Fabric_ provides a proven foundation to scale a network of trusted AI agents, which transforms the promise of AI into tangible, automated business outcomes and realizes the full potential of the intelligent enterprise.
## **The Composable Foundation for Actionable AI**
The established three-layered approach of API-led connectivity \- System, Process, and Experience APIs \- provides a powerful framework for structuring agent actionability.
- **System APIs** offer a consistent, secure, and abstracted interface to underlying systems of record. They decouple agents from the complexity of backend protocols and data models, which ensures that all agent actions are performed on governed, reliable endpoints.
- **Process APIs** encapsulate complex, multi-step business logic. Agents don’t need to understand the intricate orchestration that’s behind creating sales orders, checking inventory, or initiating shipments. They can use Process APIs (for example, "Process Order") without having to handle the underlying complexities. Process APIs provide a safe, transactional, and auditable mechanism for agents to execute business processes, which dramatically reduces the agent reasoning required and ensures that business rules are consistently enforced.
- **Experience APIs** were traditionally designed to serve specific UI applications (for example, Order Management App); however, they can also be repurposed as context-rich actions for agents. This provides agents with essential information to perform a given task without requiring multiple calls to downstream systems.
## 1. Generative Creation: Accelerate Development of Agent-Ready Assets
To meet the rising demand for agent-ready tools and capabilities, enterprises must accelerate the development of the APIs and integrations that form the composable foundation. _MuleSoft_ addresses this challenge by embedding generative AI directly into the development lifecycle, which creates a virtuous cycle that uses AI to build the high-quality assets that other agents consume.
### **1.1 MuleSoft Vibes**
For developers, [MuleSoft Vibes](https://www.mulesoft.com/platform/api/anypoint-code-builder/announcing-mulesoft-vibes) acts as an intelligent partner by automating the most repetitive aspects of integration development and providing a unified, agentic interface for the entire software development lifecycle. Through MuleSoft Vibes in [Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/), developers interact with generative capabilities that are powered by the [trusted _Einstein AI Pipelines_](https://blogs.mulesoft.com/automation/how-mulesoft-turns-generative-output-into-value/), which makes the AI-assisted development process smooth and efficient. This pipeline \- the _Inference Graph Execution Service (IGES)_ \- is a multi-stage process that’s used to achieve high-quality results. It consists of grounding, validation, error correction, and rigorous evaluation.
- [**Generative Flows**](https://blogs.mulesoft.com/dev-guides/einstein-for-acb/) capability in _MuleSoft Vibes_ is built on the _Agentforce AI_ framework. It transforms natural language business logic (User Prompts) into functional Mule applications. The _IGES Pipeline_ consists of following steps:
- **Conversation History Summarization:** The LLM analyzes the current prompt and the user’s prior messages to create a summarized prompt that captures user intent and conversation history. This consolidated prompt improves the accuracy of subsequent data retrieval and generation steps.
- **Flow Semantic Retrieval from a Vector Database:** The system takes the summarized prompt from the previous step and performs a semantic search against a vector database that contains 200+ connectors, 7,000+ connector operations, and 7,000+ sample code snippets. It retrieves the most relevant connectors, operations, and code examples to ground the generation process using accurate data and ensures that outputs are aligned with MuleSoft’s extensive connector ecosystem. Since MuleSoft is the industry standard for connectors and operations, this grounding provides the model with rich context and domain accuracy that generic LLMs lack.
- **Augmentation:** The retrieved content and conversation history messages are then combined with the summarized prompt. This augmented prompt guides the LLM to reduce hallucinations. It also includes instructions to prevent the generation of toxic content.
- **Flow Generation:** This step leverages the _Einstein AI LLM_ model to generate raw XML code that’s based on the context and examples that are provided. This is the core step of the generation pipeline.
- **Post-processing and Validation:** The post-processor and validator checks the code to ensure correct syntax and the use of valid connector operations while a separate toxicity check flags harmful content.
- **Multi-Step Error Correction:** If all of the initial generations are invalid, the automated error correction mechanism analyzes the error messages to detect patterns. Then, it resubmits the prompt to the LLM along with enriched error messages and corrective metadata.
- **Config File Generation:** This step extracts relevant connector metadata, augments the prompt, and sends it to the LLM to generate accurate connector configurations. Lastly, all POM and XML namespaces are generated deterministically using the latest version of each dependency, which eliminates hallucinations and ensures consistency.
- [**DataWeave Transformation Generation**](https://blogs.mulesoft.com/dev-guides/dataweave-generative-transformation/)**:** Data transformation is often the most time-consuming part of integration development. _MuleSoft Vibes_ tackles this process using the multi-step approach that’s similar to the _Mule Flow XML_ generation.
- **Intention Reasoning:** The LLM analyzes user input and output data samples to infer and articulate high-level transformation logic in natural language. This step separates the user's goal from the literal data values that may have been provided in the prompt.
- **DataWeave Semantic Retrieval:** To find the most semantically relevant DataWeave function documentation and complete transformation examples, the system uses the generated prompt from the previous step as a query to the vector database. This grounds the generation process in high-quality, verified information.
- **Augmentation:** The retrieved functions and examples are combined with the original user prompt to create a context-aware set of instructions for the subsequent LLM call, which influences the LLM's behavior to reduce hallucinations.
- **DataWeave Generation:** This step leverages the LLM model to generate a DataWeave transformation script and an accompanying explanation that’s based on the provided context and examples. This is the core step of the generation pipeline.
- **Post-processing and Validation** The generated script is evaluated against two specific metrics: validity and correctness. The script must compile without syntax errors (validity) and produce the expected output when it’s run using the sample input (correctness).
- **Multi-Step Error Correction:** If the initial validation fails, then this plugin identifies the error categories and corrects the issues in the generated script. This refinement helps improve the overall success rate and accuracy of the system.
- **Final Post-processing and Validation** The corrected script from the error-correction module undergoes a re-validation process to ensure that it’s syntactically valid and functionally correct. This final quality gate ensures that the output is accurate and reliable before sending it back to the user.
- [**API Specification**](https://docs.mulesoft.com/anypoint-code-builder/api-ai-create-spec) **and [Documentation Generation](https://docs.mulesoft.com/exchange/generating-documentation-with-ai):** Developers can generate fully-validated _OpenAPI (OAS)_ or _RAML_ specifications by describing the desired API in natural language. _MuleSoft Vibes_ ingests the prompt (which includes details on resources, methods, security schemes, and parameters) and produces a valid, syntactically correct API definition. After generation, it can create documentation for the API in _Anypoint Exchange_, which covers everything from authentication to endpoint details and error handling, freeing developers from these types of tedious tasks.
- **AI-Assisted MUnit Generation:** Quality assurance is paramount for assets that are consumed by autonomous agents. _MuleSoft Vibes_ helps generate MUnit test cases directly from the Mule Flow Code. This helps to mock external dependencies and assertions, and identify common testing gaps, which drastically reduces the manual effort that’s required to achieve high test coverage and ensure the reliability of the integration logic.
### **1.2 MuleSoft Your Way**
Developers thrive in their preferred environments. That’s why _MuleSoft_ meets developers where they are, which allows them to build integrations in their AI IDE of choice. [MuleSoft’s Model Context Protocol (MCP) Server](https://www.npmjs.com/package/@mulesoft/mcp-server) exposes development, deployment, and management capabilities as MCP Tools that any VS Code-based AI-native IDE (for example, Cursor, Windsurf, or Trae) can consume to interact with the _Anypoint Platform_ using natural language.
By packaging its core IDE functionality into a [standard VS Code extension](https://marketplace.visualstudio.com/items?itemName=salesforce.mule-dx-extension-pack), _MuleSoft_ decouples its tools from a branded IDE shell, which enables development tooling to be IDE agnostic. Instead of competing with the fast-paced evolution of IDEs, this architecture choice allows MuleSoft’s development tools to stay compatible and accessible across the growing ecosystem of modern, AI-powered IDEs.
## 2\. Enable Actionability: Transform APIs into Tools for Agents
In an Agentic Enterprise, having a robust foundation of composable APIs is necessary, but insufficient. The next critical step is to ensure that these assets are discoverable, understandable, and invocable by AI agents. This requires an "actionability layer" that’s built on open standards that are designed specifically for agentic communication. _MuleSoft_ provides enterprise-grade tooling for the two dominant emerging protocols:
- **MCP** for agent-to-system interactions
- **A2A** for agent-to-agent interactions
### **2.1 Model Context Protocol (MCP)**
_MCP_ has rapidly emerged as the industry standard for agent-to-tool communication, which is analogous to what _REST_ became for web services. _MCP_ allows AI agents to dynamically discover a system's capabilities, understand its inputs and outputs, and invoke it to perform an action, all without requiring pre-programmed or hard-coded logic.
The [MuleSoft MCP Connector](https://docs.mulesoft.com/mcp-connector/latest/) allows any API that’s implemented as a Mule application to be published as an MCP server. Since _MuleSoft_ provides hundreds of pre-built connectors to virtually every major enterprise system (for example, SaaS, legacy, and databases), this instantly transforms an organization's APIs and applications into a set of agent-ready tools. An API that’s designed to check inventory in SAP, a flow that processes a new lead in Salesforce, or a custom application that’s connected via _MuleSoft_ can all be made available to AI agents as atomic, governed tools using the _MCP Connector_.
### **2.2 Agent-to-Agent Protocol (A2A)**
While the _MCP_ excels at hierarchical, agent-invoking-tool interactions, complex business processes often require collaboration between multiple specialized agents. The _Agent-to-Agent (A2A)_ protocol is the emerging open standard that’s designed to facilitate peer-to-peer communication that enables sophisticated, multi-agent workflows.
MuleSoft's support for A2A allows enterprises to design and build advanced systems with the same level of governance and reliability that they expect for their APIs. The [MuleSoft A2A Connector](https://docs.mulesoft.com/a2a-connector/latest/) allows developers to easily expose any agent as an A2A server, or invoke any A2A compliant agent from a Mule application. For example, a mortgage application process may be orchestrated across a "Credit Check Agent," a "Document Signature Agent," and a "Regulatory Compliance Agent," with each agent discovering and invoking the others' capabilities (as needed) to move the application forward.
By providing robust, enterprise-grade tooling for MCP and A2A, MuleSoft supports building a flexible ecosystem that consists of direct agent-to-system interactions (via MCP tools) and agent-to-agent (A2A) interactions. Regardless of how the AI landscape evolves, this approach positions _MuleSoft_ as the underlying foundation that connects all forms of agentic communication.
## 3\. MuleSoft Agent Fabric: The Central Nervous System of the Agentic Enterprise
As enterprises adopt agentic AI, they inevitably face the challenge of agent sprawl. To prevent this from devolving into chaos, a dedicated orchestration layer is required. [MuleSoft Agent Fabric](https://docs.mulesoft.com/agent-fabric/) ([demo](https://www.youtube.com/watch?v=GAqwPie16ic)) is a comprehensive architectural solution that’s designed to address this challenge head-on. It provides a central management plane to discover, govern, orchestrate, and observe the entire network of AI agents, regardless of where they’re built or how they operate. Functioning as the "air traffic controller" for the enterprise's digital workforce, _MuleSoft Agent Fabric_ transforms a collection of fragmented, siloed agents into a cohesive, secure, and high-performing intelligence network.
_MuleSoft Agent Fabric_ is built upon four integrated pillars that cover the complete lifecycle management for agents as first-class enterprise assets.
### **3.1 Agent Registry (Discover)**
The foundation of any managed ecosystem is discoverability. The _Agent Registry_ serves as the universal, centralized catalog for every agentic asset within the enterprise. This includes custom-built agents, agents that are embedded in SaaS applications, MCP servers that expose legacy systems, and A2A endpoints for inter-agent collaboration. By providing a single source of truth, the _Agent Registry_ solves the critical discovery problem by preventing teams from building redundant capabilities, and enabling human developers and other AI agents to dynamically find and reuse existing assets at scale.
The _Agent Registry_ is built upon _Anypoint Exchange,_ and it adds three new asset types: Agents, MCP Servers, and LLMs. It captures information about these assets, including MCP tools, transport protocols, and agent cards, as well as the dependencies between agents and the MCP servers and tools that they consume. Developers can create and manage assets directly within the registry. They can also programmatically discover and reuse existing assets within MuleSoft Vibes (via the _MuleSoft MCP Server’s_ search_asset tool) when creating new orchestrations. This equips developers with all of the information they need to understand and consume these assets.
### **3.2 Agent Broker (Orchestrate)**
Once assets are discoverable, they must be orchestrated to perform useful work. The _Agent Broker_ is an orchestration service that executes multi-step business processes. It uses a configurable LLM to interpret high-level tasks and generate corresponding workflows. The _Agent Broker_ dynamically discovers, sequences, and invokes the required agents and tools to complete these processes.
Connectivity is managed via the _MCP_ for tools and an _A2A_ protocol for agents. This allows the system to organize agents into business-specific domains (for example, Supply Chain or Finance) and route tasks across all of them. A single, natural-language prompt (for example, ”Onboard an Employee.”) is decomposed into a sequence of discrete actions that are executed by different agents or tools across multiple backend systems. Agent Broker Orchestration includes:
- **Dynamic Orchestration Pattern:** This is an Agent-Loop pattern that determines sub-tasks and orchestrates them across the most suitable agents and tools to achieve the overall goal. By leveraging this pattern, [collaborative agents](/docs/architect/fundamentals/guide/agentic-patterns#15-collaborative-agents-agent-swarms) can be built to solve complex use cases (for example, [handling a complex service escalation](/docs/architect/fundamentals/guide/agentic-patterns#35-collaborative-agent-use-case-complex-service-escalation)).
- **LLM-Powered Reasoning:** Uses an LLM to interpret natural language goals and generate execution plans, which removes the need for hard-coded, rigid workflow logic.
- **Configurable LLM Model:** Allows developers to specify which LLM model to use, which provides control over cost, performance, and capabilities.
- **Natural Language Development:** _Agent Broker_ logic can be defined using natural language via _MuleSoft Vibes_.
- **Observability:** _Anypoint Monitoring_ provides logging and tracing upon deployment to help users understand and debug Agent Broker’s reasoning and interactions with _MCP_ tools and _A2A_ Agents.
- **Managed Deployment:** _Agent Broker_ is a containerized application that’s backed by _Mule Runtime_, which manages availability and scalability of the deployment.
### **3.3 Flex Gateway for MCP and A2A (Govern)**
The _Anypoint Flex Gateway_ is the mechanism through which certain policies are technically enforced. _MuleSoft Agent Fabric_ leverages the _Anypoint Flex Gateway_ to [secure, inspect, and manage every agentic interaction](https://docs.mulesoft.com/gateway/latest/flex-agent-secure) that happens via _MCP_ and _A2A_ protocols. This allows organizations to apply a rich [set of enterprise-grade policies](https://docs.mulesoft.com/gateway/latest/flex-agent-policies) to all agentic traffic to ensure that every action is secure, compliant, and auditable prior to its execution. To safely and responsibly scale AI adoption, these guardrails are critical.
| Policy Name | Protocol(s) | Description |
| :----------------------------------------------------- | :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **JWT Validation Policy/Client ID Enforcement Policy** | A2A, MCP | The **JWT Validation Policy/Client ID Enforcement Policy** secures _A2A_ agents and _MCP_ servers by restricting access to authenticated callers only. |
| **Schema Validation** | A2A, MCP | **Schema Validation** ensures that incoming agent requests conform to the _A2A_ or _MCP_ specification, which prevents malformed traffic. |
| **A2A PII Detector** | A2A | **A2A PII Detector** identifies _Personally Identifiable Information (PII)_ in requests and responses, and enables logging or blocking to meet compliance requirements. |
| **A2A Prompt Decorator** | A2A | **A2A Prompt Decorator** injects custom context or instructions into prompts that are sent to agents to guide their behavior and enforce guardrails. |
| **MCP Attribute-Based Access Control** | MCP | **MCP Attribute-Based Access Control** regulates access to specific tools and resources that are exposed by an _MCP_ server based on user attributes (for example, Tiers, IP, or JWT claims). |
| **SSE Logging** | A2A, MCP | **SSE Logging** records the content of _Server-Sent Events (SSE)_ streams that are used by agentic protocols for comprehensive auditing and traceability. |
| **Rate Limiting and Spike Control** | A2A, MCP | The **Rate Limiting and Spike Control** protects backend agents and systems from traffic surges and denial-of-service attacks by enforcing request limits. |
| **A2A Agent Card** | A2A | The **A2A Agent Card** rewrites the Agent Card URL to ensure that all traffic is correctly proxied through the governed Flex Gateway instance. |
**Enterprise Governance Policies for Agentic Protocols**
In addition to governing inbound requests, the _Anypoint Flex Gateway_ also manages all outgoing connections and requests from an agent to external services (for example, _MCP_ Servers and Tools or other agents). This includes:
- **Logging:** Provides a centralized observability point to monitor and log all outbound agent requests for auditing and troubleshooting.
- **Security:** Prevents sensitive data leakage by inspecting outbound traffic.
- **Authentication:** Manages credentials for external systems by applying outbound authentication mechanisms, including API Keys, OAuth, and ClientId/ClientSecret from a single point.
The _Anypoint Flex Gateway_ [**Policy Development Kit (PDK**)](https://docs.mulesoft.com/pdk/latest/policies-pdk-overview) allows users to create custom policies when out-of-the-box policies don’t meet specific requirements. By using the _PDK_, developers can write policy logic in the _Rust_ programming language and compile it into a _WebAssembly (WASM)_ module. The self-contained module is then loaded into the _Anypoint Flex Gateway_ to enforce unique security rules, custom data transformations, or specialized integration logic directly at the API edge. This provides a powerful, high-performance way to extend gateway functionality for unique or complex use cases.
Here are the four key components of the _PDK_:
- **Anypoint CLI PDK Plugin:** This plugin creates the _PDK_ project and uploads the compiled policy to _Exchange_. It also generates a _Makefile_ that simplifies the development process by providing a clear set of commands to build and manage the policy.
- **Policy Template:** When a new project is created, the _PDK_ generates a basic scaffold or template. This structure includes all of the necessary files and configuration that are required to successfully compile the policy, which gives developers a starting point for custom logic.
- **SDK Building Tools:** These tools abstract the complex, event-driven architecture of the underlying _Envoy_ proxy. By using reactor and executor patterns, the _SDK_ provides a straightforward, linear coding method. This helps to reduce complexity, improve debugging, and lower the learning curve for developers.
- **Policy Management:** The [MuleSoft MCP Server](https://docs.mulesoft.com/mulesoft-mcp-server/reference-mcp-tools) provides _MCP_ tools to help users manage the custom policy lifecycle. Examples of these tools include:
- get_flex_gateway_policy_example
- manage_api_instance_policy
- manage_flex_gateway_policy_project
### **3.4 Agent Visualizer (Observe)**
The _Agent Visualizer_ provides a real-time, dynamic map of the entire agent network, turning what could be a "black box" of AI interactions into a fully-observable system. Architects and operations teams can use the _Agent Visualizer_ to review how agents are connected, trace their decision flows, monitor their health and performance, and identify dependencies. This level of visibility is crucial to optimize performance, troubleshooting failures efficiently, detect bottlenecks, and build confidence in deployed agents.
## **4\. Salesforce Platform Unification**
### **4.1 API Catalog and Topic Center**
The _MuleSoft API Catalog_ and _Topic Center_ are designed to improve how APIs are discovered, used, and managed, particularly in conjunction with _Agentforce_.
All of the _MuleSoft_ APIs that are designed and published can be made discoverable and consumable via the [API Catalog](https://help.salesforce.com/s/articleView?id=platform.api_catalog.htm&type=5) in the _Salesforce Platform_. The _API Catalog_ serves as the centralized repository, and it unifies all of an organization's APIs from _MuleSoft_, _Salesforce_, _Heroku_, and other clouds into a single view. This makes it easy for developers and administrators to discover, understand, and reuse existing APIs by enabling them to be used in automations (for example, _Agentforce_, _Flow_, and _Apex_).
The [MuleSoft for Agentforce: Topic Center](https://blogs.mulesoft.com/news/mulesoft-for-agentforce-topic-center/) allows developers to structure their APIs around specific business use cases by defining Agentforce **Topics** and **Actions** metadata at design time itself. This includes:
- **Actions**, which are the tasks that an agent can perform
- **Instructions**, which guide the agent on how to apply certain actions
By [adding this semantic layer](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center), the _Topic Center_ makes APIs understandable and consumable by _Agentforce_, which ensures that it can interact with enterprise systems effectively.
### **4.2 Agentforce Gateway**
The _Agentforce Gateway_ is a centralized governance layer that’s designed to manage and secure interactions within the expanding _Agentforce_ ecosystem. As _Agentforce_ integrates with additional third-party APIs and tools via protocols like _MCP_, the primary function of the _Agentforce Gateway_ is to enforce policies (for example, rate limits and tool restrictions) on all outbound traffic that’s initiated by _Agentforce_, and audit all of the outgoing requests.
The _Agentforce Gateway_ leverages the existing _MuleSoft_ API governance policy engine, which is built natively into the _Salesforce Platform_. This _Envoy_\-based policy engine intercepts agent traffic, applies configured policies (for example, attribute-based access control and quota limits), and manages authentication and authorization, all without requiring customers to install additional gateway infrastructure.
### **4.3 Integration Intelligence**
Deploying a governed network of agents is a landmark achievement. However, it introduces new "Day 2" operational challenges. It requires an enhanced level of operational intelligence to monitor, measure, and troubleshoot a dynamic, distributed system of autonomous actors. The ultimate architectural vision is a system where AI isn’t only used to execute business processes but also to monitor, manage, and heal the very infrastructure that it runs on.
_MuleSoft’s_ vision for integration intelligence leverages the power of the broader _Salesforce_ ecosystem to provide deep, customizable insights into the performance of the integration fabric and the agentic network. By capturing and storing [OpenTelemetry (OTEL) compliant](https://opentelemetry.io/) data \- the emerging standard for observability \- in **Salesforce Data 360**, organizations can create a unified repository for logs, metrics, and traces across their entire landscape. This data can be viewed in **Tableau** via pre-built dashboards and custom visualizations to gain detailed insights into API performance, agent interaction patterns, and overall system health.
This system has three key components:
1. **Ingestion:** The ingestion service is the centralized entry point for collecting and processing telemetry data from various _Mule_ applications, _Agent Brokers_, and _Flex Gateways_. It performs schema validation, data normalization, and filtering to maintain data quality and consistency across various applications. In addition, it enforces controls (for example, authentication, encryption, tenant fairness, and rate limiting) in the ingestion pipeline.
2. **Storage:** A high-throughput streaming job runs in _Data 360_ that reads data from multi-tenant _Kafka_ topics, and transforms it into the _OTEL_ format. OTEL data is then committed to the tenant’s _Data 360_ in the _TelemetryTraceSpan_, _TelemetryLogs_, and _TelemetryMetrics DMOs_ in the _Lakehouse_.
3. **Visualization/Consumption:** With the telemetry data available in _Data 360_, customers can review system health and gain insights by using pre-built or custom dashboards via _Tableau Next_. Customers can also leverage the [Tableau Concierge](https://help.salesforce.com/s/articleView?id=analytics.tua_metric_questions.htm&type=5), which is a pre-built, agentic analytics skill within _Tableau Next_, that allows users to ask questions about telemetry data in natural language and receive trusted, actionable answers with visualizations. Customers may also export the data to existing _Application Performance Management (APM)_ systems (for example, _DynaTrace_, _Datadog_, _Splunk_, and so on).
## **Conclusion**
The transition to an Agentic Enterprise is not merely an IT upgrade; it is a fundamental architectural inflection point. A fragmented, siloed deployment of AI agents is a direct path to operational chaos, shadow IT, and unmanageable technical debt. The only sustainable path forward is through a unified, composable architecture. By building on the proven foundation of API-led connectivity, the _MuleSoft Agent Fabric_ delivers the 'central nervous system' required to manage this new digital workforce. It provides the critical capabilities for discovery, orchestration, enterprise-grade governance, and end-to-end observability. This is how we move beyond AI experimentation and begin to architect a truly intelligent, automated, and secure enterprise, transforming autonomous potential into tangible, governed business outcomes.
## **Technical Guides and References**
- [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb)
- [Technical Guide to Einstein for Anypoint Code Builder: Generative Flows](https://blogs.mulesoft.com/dev-guides/einstein-for-acb/)
- [DataWeave Generative Transformation Deep Dive: AI Innovation for Rapid Data Transformation](https://blogs.mulesoft.com/dev-guides/dataweave-generative-transformation/)
- [Creating API Specs with MuleSoft Dev Agent](https://docs.mulesoft.com/anypoint-code-builder/api-ai-create-spec)
- [Generating API Documentation With Einstein Generative AI](https://docs.mulesoft.com/exchange/generating-documentation-with-ai)
- [MuleSoft MCP Server Overview](https://docs.mulesoft.com/mulesoft-mcp-server/)
- [MuleSoft MCP Server Tools](https://docs.mulesoft.com/mulesoft-mcp-server/reference-mcp-tools)
- [MCP Connector](https://docs.mulesoft.com/mcp-connector/latest/)
- [A2A Connector](https://docs.mulesoft.com/a2a-connector/latest/)
- [Get Started with Agent Fabric](https://docs.mulesoft.com/agent-fabric/learning-map-agent-fabric)
- [Securing Agent Interactions with Flex Gateway](https://docs.mulesoft.com/gateway/latest/flex-agent-secure)
- [Flex Gateway Agent Policies](https://docs.mulesoft.com/gateway/latest/flex-agent-policies)
- [Flex Gateway Policy Development Kit (PDK) Overview](https://docs.mulesoft.com/pdk/latest/policies-pdk-overview)
- [MuleSoft API Catalog for Salesforce](https://help.salesforce.com/s/articleView?id=platform.api_catalog.htm&type=5)
- [Enabling an API Project for Topics and Agent Actions](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center)
- [Work with Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_consume.htm&type=5)
- [OpenTelemetry](https://opentelemetry.io/)
- [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)
- [Agent2Agent (A2A) Protocol](https://a2a-protocol.org/latest/)
## About The Author
Nikhil Aggarwal is a Principal Architect at Salesforce, where he leads architecture for MuleSoft and Salesforce Automation Clouds. Nikhil brings over 18 years of experience delivering large-scale products and is passionate about scalable architecture, intuitive developer experiences, and building high-performing teams. Prior to Salesforce, he led multiple initiatives in Microsoft Power Platform, Dataverse and Office 365 from concept to launch. His work continues to shape how modern enterprises connect systems, automate workflows, and unlock business value in the AI-first era.
## Executive Summary
In large-scale Salesforce Field Service (SFS) environments, managing external contractor networks requires a delicate balance between platform security and scheduling performance. This guide compares two primary architectural patterns\: the traditional **territory-based** pattern and the new **account-based sharing** pattern for governing external contractors' access and management. In this paper, we review both in depth to help organizations choose the foundational structure that best supports their operational goals, and to understand the trade-offs of each option.
This pattern choice affects scheduling efficiency, resource utilization, and dispatcher productivity. By selecting the right approach, companies ensure a seamless experience for both internal staff and external partners while maintaining the long-term scalability of their solution.
Beyond immediate operational gains, this foundational choice determines an organization's readiness for autonomous service. The account-based sharing pattern provides the unified data visibility required for Agentforce, and specifically the Scheduling Agent for Field Service, to perform holistic evaluation without being restricted by artificial data silos. Account-based sharing also enables Data Cloud to aggregate contractor performance metrics more effectively, allowing for seamless competitive benchmarking while maintaining the rigorous data isolation required in multi-vendor environments.
### Takeaways
- **Select your pattern based on competitive overlap.** If external contractors compete with internal or other external resources on shared territories, account-based sharing is likely the architecturally correct choice. Territory-based sharing is appropriate only when contractors receive exclusive, non-overlapping service areas/jobs.
- **Avoid territory sprawl.** Creating dedicated contractor territories to achieve data isolation when not necessary introduces hierarchy bloat that degrades scheduling efficiency and performance, and significantly increases administrative overhead at scale. Account-based sharing eliminates this problem pattern.
- **Build the foundation for AI-driven scheduling.** The Scheduling Agent for Field Service and the Optimization engine will have better performance when they have full resource-pool visibility. Territory-based sharing siloed structure prevents this; Account-based sharing is the desired architectural foundation.
## Introduction - The Evolution of Contractor Networks
Over the past decade, contractor networks in field service have evolved from ad hoc extensions of internal teams to strategic, deliberately structured ecosystems across industries including telecommunications, utilities, home services and more. Many field operations now rely on contractors alongside full-time employees, requiring clear rules for access, visibility, and dispatch control.
As organizations scale on Salesforce Field Service, the way they design and manage these external resources—whether through territory-style pattern, account-centric sharing, or hybrids—directly shapes how securely and efficiently they can schedule work across a blended workforce.
## Audience
This guide is intended for technical and strategic stakeholders responsible for the design, performance, and scalability of Salesforce Field Service implementations\:
- **Solution and Technical Architects\:** To evaluate the impact of different sharing patterns on scheduling and optimization efficiency.
- **Field Service Operations Leaders\:** To understand the trade-offs between different contractor personas, such as Named Contractors, Contractor Companies, and Occasional Workers.
- **Salesforce Administrators\:** To gain insight into how Service Territories and platform sharing tables are used to manage complex security requirements.
## Defining the SFS Contractor
The contractor persona in scope directly determines the appropriate sharing architecture. Each category carries distinct implications for how record-level access is structured, how the Optimizer perceives resource availability, and how the solution scales\:
- **Named Contractor\:** An individual external resource who is treated similarly to an internal employee. A named contractor requires a dedicated user license. The sharing model mirrors internal technician access patterns, making this the lowest-complexity contractor persona to support.
- **Contractor Company\:** A third-party entity that manages its own workforce. In SFS, contractor companies are represented as Capacity-Based Resources, where the parent organization schedules and assigns work to the company rather than a specific individual.
- **Occasional Worker\:** A user who temporarily operates across multiple territories. The most architecturally complex persona. Transient, multi-territory relationships mean that territory-based sharing boundaries break down, so visibility is managed dynamically at the record level rather than through static geographic assignment.
## Understanding the Contractor Complexity
### Why Contractor Management is Complex
These patterns are complex because the parent organization and the goals of the contractor are often technically at odds.
1. **Divergent Goals\:** The parent organization primarily focuses on customer satisfaction and contractual work/agreement (for example, resource preferences, servicing quickly and timely, and managing how work and hours are distributed across contractors). Contractors, by contrast, typically focus on maximizing assigned work while minimizing travel time and operational cost.
2. **Competition\:** Unlike internal employees, different contractor companies are often direct competitors. While the parent organization needs a holistic view of the region (transparency), the contractors require strict isolation from each other's operations (isolation).
3. **Brand Integrity\:** To the end customer, the worker represents your brand, which often requires the parent company to see real-time status updates. However, contractors often guard their internal operations in a closed system, or "black box."
4. **Visibility and Security\:** While a shared service territory typically implies universal visibility of all assigned resources, multi-contractor environments require a more nuanced security pattern. To maintain competitive integrity and data privacy, it's essential to prevent contractors from accessing each other's proprietary names, schedules, or resource information.
### The Core Tension - Transparency vs. Isolation
| Role | Requirement |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **The Organization** | Requires visibility into all technicians, both external (including contractors) and internal, and wants the scheduling and optimization engine to consider them together for full regional optimization. |
| **The Contractors** | Operate as a closed system, or "black box" to protect proprietary operations and require strict isolation toward competitors operating in the same region, or toward the internal technicians of the organizations. |
| **The Challenge** | Designing a system that provides both efficiency and transparency for the organization while maintaining required visibility and access for partners. |
### The Contractor Complexity Matrix
Contractor design within Salesforce Field Service spans three distinct operating models, each affecting resource visibility, dispatch ownership, and licensing\:
1. External Capacity Allocation
2. Partner Self-Scheduling
3. Internal-Led Dispatch
**External Capacity Allocation (Off-Platform Capacity)\:** The contractor manages their workforce externally and provides a defined capacity (for example, 10 available hours) rather than individual technician schedules. This capacity is treated as a bucket of hours or work items for scheduling purposes.
**Partner Self-Scheduling\:** Contractor managers log into Salesforce via an Experience Site to schedule their own teams. They require strict isolation from other partners.
**Internal-Led Dispatch\:** Internal dispatchers schedule contractor technicians directly. Contractors use the Field Service Mobile App for execution.
:::warning
A full SFS license is required for the internal dispatcher. Contractor technicians in this model only require a Field Service Mobile license (or Community license with mobile access).
:::
| Dimension | External Capacity Allocation | Partner Self-Scheduling | Internal-Led Dispatch |
| ----------------------- | ---------------------------- | -------------------------- | -------------------------------------------------------- |
| **Resource Visibility** | Capacity Only | Partner-Owned | Full Internal |
| **Who Dispatches** | Contractor (External) | Contractor (In Salesforce) | Internal Dispatcher |
| **Salesforce Licenses** | Minimal | Experience Cloud | Full SFS (Dispatcher); Community (Contractor Technician) |
### Pattern in Scope
| Pattern Name | Description |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Territory-Based Sharing** | Contractors are assigned to dedicated, isolated service territories. Record visibility is governed by territory membership. Each contractor company or group operates within a hard geographic boundary. |
| **Account-Based Sharing** | Contractors operate within the standard geographic territory structure alongside internal/other external resources. Record-level visibility is governed by sharing rules, enabling a unified resource pool. |
## Sharing and Visibility - Territory-Based Sharing
In this pattern, the **Service Territory** serves as the primary security boundary. Each Contractor Company is assigned to its own unique "Child" territory.

### Common Use Cases
- Small-scale partner networks
- Partners with strictly non-overlapping geographical regions
- Situations where contractor work is fundamentally different from internal resource work, eliminating competition (for example, external contractors handle only "Type A installations", while internal resources handle all other work types)
### Advantages
- **Simplified configuration\:** Uses standard User Territory setup and automation.
- **Clear data bucketing\:** Makes sure of easy data visibility and simplified security management through standard Service Territory objects.
### Disadvantages and Technical Debt
- **Optimization Efficiency\:** The engine cannot evaluate resources across territory boundaries, preventing optimal scheduling and efficient routing.
- **Territory Sprawl\:** Creating a larger number of territories for a very low number of resources leads to scheduling overhead.
- **Gantt Performance\:** Large hierarchies (1K+ territories) can cause significant performance bottlenecks as well as risks of hitting platform limits.
## Sharing and Visibility - Account-Based Sharing
This guide introduces a new solution approach\: **Account-based sharing** (implemented via Salesforce's native criteria-based sharing rules, the same platform mechanism used to grant record access based on field values). Account-based sharing decouples **visibility** from **geography**. Territories remain large and continuous, while visibility is managed through the platform's sharing tables based on an account relationship. In practical terms, criteria-based sharing rules evaluate a field on the record (such as `ServiceResource.Company`) and automatically share that record with the appropriate group. Criteria-based sharing is the engine that makes Account-based sharing work without custom code at the record level.

### Common Use Cases
- Large-scale ecosystems where a significant proportion of the workforce consists of external resources
- Urban areas where multiple contractors cover the same zip codes
- Scenarios where both internal and external resources are capable of executing the same work (for example, "Type A installations"), but business rules dictate a specific logic for resource selection (for example, internal resource preference in certain scenarios)
### Advantages
- **Maximum utilization and ROI\:** The engine evaluates the entire regional pool, finding the "best" resource for every job
- **Scalability\:** Supports a large number of contractors/external resources without increasing territory counts
- **Consolidated Management\:** Internal staff manage one view rather than hundreds of siloed folders (child territories)
### Disadvantages and Technical Debt
- **Development Effort\:** Requires custom automation (Flow or Apex) to manage the Sharing tables
- **Membership Sharing\:** Requires explicit sharing of Service Territory Member (STM) records
:::tip
**The Scalability Impact**
Organizations managing a large pool of contractor partners without a unified regional pool often face coverage gaps, where the closest technician is invisible to the scheduling logic because each partner is managed in a geographical and administrative silo. By moving to a unified pool (account-based sharing), organizations can reduce travel by more than 20% through holistic scheduling and accelerate time-to-serve by identifying the closest available technician across the entire resource pool.
:::
## Capacity-Based Resources
For external workforce (External Capacity Allocation dimension), architects can use [**Capacity-Based Resources**](https://help.salesforce.com/s/articleView?id=service.fs_define_resource_capacity.htm&type=5) to represent the "summary" of a contractor's workforce.
### When to use Capacity vs. Individual
- **Capacity\:** Use this when the contractor manages their own dispatching and routing. Your primary focus is on the total volume of work they can fulfill rather than the specific person performing it.
- **Individual\:** Use this when you need granular visibility into a technician's day. Individual-based resources allow you to manage their exact location, real-time availability, and specific job assignments as if they were internal staff.
## Contractor Sharing Pattern Selection
Before designing your Field Service contractor pattern, use this decision tree to determine the appropriate sharing architecture.
**Contractor Sharing Pattern Selection Decision Tree**

_Decision tree for selecting a contractor sharing pattern in Salesforce Field Service. Starting from whether external resources are in use, the tree branches through resource type and job exclusivity to recommend either territory-based sharing or account-based sharing._
### Choosing the Right Pattern
| Territory-Based Sharing | Account-Based Sharing |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| External resources with exclusive, non-competing job assignments | Named external resources competing with internal or other external resources |
| No overlap with other external partners in the same geographical area | Multiple partners operating within the same geographical area |
| Lower complexity; faster to implement and maintain | Higher complexity; additional steps required to implement and maintain record-level visibility |
## Implementation Guidance - Account-Based Sharing Logic
The core of this pattern is an automation layer that converts the `ServiceResource.AccountId` or `ServiceResource.Company` (Contractor Company) relationship into platform sharing records.
### The Three Pillars of Access
To verify proper access for the dispatcher and the service resource in an Experience Site, access needs to be controlled via\:
- **Service Resource Sharing Rule\:** Grants access based on a criteria (account/company)
- **Service Territory Sharing Rule\:** Grants access based on a criteria (territory name/ID)
## Advanced Considerations - Mobile Worker Experience
When using account-based sharing, be sure to account for the **Field Service Mobile experience** and record visibility for assigned technicians.
- **Assigned Resource Sharing\:** Standard SFS functionality automatically grants an assigned resource access to the Service Appointment and its parent Work Order. This setup gives the technician the necessary information to execute the job without requiring additional custom sharing rules for assigned work.
- **Visibility Risks\:** While assigned work is handled natively, be cautious about unassigned or future appointments that lack an Account or Territory association. If Organization-Wide Defaults (OWDs) aren't strictly managed, or if sharing sets are too broad, unassigned appointments could be visible to all users in a consolidated territory.
- **Account-Territory Association\:** Make sure that all service appointments are explicitly linked to an account and territory. This linking allows clean filtering within the mobile app and verifies that data leakage does not occur for unassigned work sitting in the regional pool.
## Practical Business Scenarios
### Scenario 1 - The Urban Hub
- **Requirement\:** 10 different contractors provide fiber installation in London.
- **Context\:** In the territory-based sharing approach, London would be split into 10 overlapping territories. Dispatchers would struggle to see nearby availability, leading to high travel times.
- **Recommendation\:** **Account-based sharing**. Implement a unified "Greater London" service territory utilizing account-based sharing to maintain granular data security. Account-based sharing keeps Contractor A's management siloed to their respective resources, while the SFS Optimizer maintains cross-functional visibility of all internal and external technicians. This complete scheduling approach facilitates a more efficient routing logic that can reduce travel by more than 20% through complete scheduling (directional estimate based on field observations across SFS customer deployments), creating immediate improvements in resource utilization and enhanced service responsiveness.
### Scenario 2 - The Capacity-Based Availability
- **Requirement\:** A vendor provides up to 40 "slots" for boiler repairs daily but manages their own technician dispatching.
- **Context\:** Managing 40 individual resource records adds unnecessary overhead.
- **Recommendation\: Capacity-based resource** linked to the vendor account. One resource record represents the vendor's total daily capacity, keeping the Gantt clean and avoiding the need to manage individual contractor technician records.
### Scenario 3 - Seasonal Capacity Scaling
- **Requirement\:** A utility company onboards 50 small local contractors during storm season to handle surge repairs.
- **Context\:** Creating and deleting 50 territories every season is a major administrative burden, and it negatively impacts the flexibility of the scheduling and optimization engine.
- **Recommendation\:** **Account-based sharing**. Create a permanent "Overflow" Geographical Territory. When a contractor is onboarded, simply create their account and link their resources to it. The automation layer handles visibility instantly without requiring a territory hierarchy redesign.
### Scenario 4 - Multi-Vendor Emergency Coverage
- **Requirement\:** For high-priority gas leaks, the closest technician must be dispatched regardless of which contractor they work for.
- **Context\:** Territory-based sharing creates coverage gaps where the closest tech might be in a different territory, and therefore unreachable to the scheduling logic.
- **Recommendation\:** **Account-based sharing**. By consolidating vendors into a single large territory, the engine performs a complete search based on travel across the entire multi-vendor pool, reducing response times for critical safety incidents.
### Scenario 5 - The Exclusive Regional Franchise
- **Requirement\:** A specialized HVAC partner has a 10-year exclusive legal right to service a remote area or rural county.
- **Context\:** There are no other contractors operating in this geography, and the partner manages their own scheduling and dispatching entirely.
- **Recommendation\:** **Territory-based sharing**. In this scenario, a dedicated Service Territory is the most efficient choice. Since there is no geographical overlap with other partners, the isolation provided by the territory boundary matches the legal and operational requirements perfectly without further sharing automation.
## Implementation Guidance - Sharing Automation Layer
Account-based sharing separates visibility from geography by tying record-level access to a common account/company identifier shared between the dispatcher user and their Service Resource records. The platform's native criteria-based sharing engine evaluates this field and automatically grants or revokes access without changing the territory hierarchy.
### The Three Architectural Components Required
The three architectural components required are\:
1. A common identifier field on both User and Service Resource objects linking them to their contractor account.
2. Public Groups aggregating all Dispatcher users per contractor company, so sharing rules apply uniformly.
3. Criteria-based sharing rules that evaluate the identifier and grant the appropriate Public Group access to relevant records.
### Public Groups
Rather than using territories as boundaries, use Public Groups to aggregate dispatchers who require the same visibility. Dispatchers see specific Territories, Work Orders, and Service Appointments via membership in territory-based Public Groups.
- **Group Creation\:** Create a Public Group for each contractor company.
- **Member Assignment\:** Add the relevant Partner Community Users (dispatchers) to their respective contractor Public Group.
### Criteria-Based Sharing Rules
Leverage criteria-based sharing rules to grant the Public Group's access to specific records.
- **Service Resource Sharing Criteria\:** Service resource sharing rules enforce per-contractor technician visibility by matching the company/account identifier on the Service Resource record to the corresponding contractor Public Group.
- Access level permits read/write to allow dispatchers to schedule and update assignments.
- **Service Territory Sharing Criteria\:** Use the service territory sharing criteria to set up the logic for territory restricted access. Grant dispatchers access the broad geographical territories where they are authorized to work. Example\:
- **Criteria\:** ServiceTerritory.Name EQUALS "Atlanta".
- **Shared With\:** Relevant Contractor Public Groups (for example, Contractor A, Contractor B, Contractor C).
- **Access Level\:** Read/Write
For detailed implementation guidance, refer to the official Salesforce documentation\:
- [Criteria-Based Sharing Rules](https://help.salesforce.com/s/articleView?id=sf.security_sharing_rules_criteria.htm)
- [Public Groups](https://help.salesforce.com/s/articleView?id=sf.user_groups.htm)
- [Apex Triggers for automated share record management](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm)
### Implementation Result
When correctly implemented, account-based sharing delivers\:
- **Unified Visibility\:** Dispatchers see all relevant resources across the full territory without manual territory reassignment.
- **Dynamic Access\:** As contractor assignments change, sharing rules automatically adjust visibility without administrator intervention.
- **Competitive Isolation\:** Each contractor only sees their own resources, maintaining data privacy.
- **Scalable Architecture\:** New contractors can be onboarded by simply creating an account and public group, with sharing rules handling the rest automatically.
## ROI Framework\: Measuring Success
| KPI Category | Metric | Targeted Impact (Account-Based Sharing) |
| -------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Operational Efficiency** | Travel Time Reduction | By moving to a unified pool (account-based sharing), organizations reduce travel by more than 20% through complete scheduling (directional estimate based on field observations across SFS customer deployments) and accelerate time-to-serve by identifying the closest available technician across the entire resource pool. |
| **Resource Productivity** | Technician Utilization Rate | Better productivity by optimizing the true best resource and reducing travel |
| **Customer Experience** | Response Time / SLA Adherence | 25%+ improvement in response time (directional estimate based on field observations across SFS customer deployments) |
## Strategic Recommendation and Long-Term Value
### Future-Proofing\: AI, Automation, and Scalability
As field service organizations shift from reactive to proactive models, their choice of architectural pattern sets the "innovation ceiling" for long-term operational agility.
- **Enabling AI and Machine Learning\:** Account-based sharing verifies the engine has visibility into the entire resource pool to find the best match rather than being restricted by data silos. Because it avoids inefficient territory silos, the Scheduling Agent for Field Service (AI-powered scheduling assistant within Salesforce) provides more logical travel patterns and technician assignments without being limited by isolated micro-territories. This approach maximizes full optimization, directly improving travel KPIs and technician readiness. Account-based sharing supports AI-driven scheduling by giving the engine visibility into the entire resource pool, allowing for "true best" matching rather than being restricted by artificial data silos.
- **Architectural Scalability\:** Territory-based sharing often encounters a "performance wall" due to its reliance on isolated territories. As the contractor network grows, the scheduling engine's effectiveness is neutralized by artificial boundaries that prevent it from reaching available capacity in adjacent territories. Furthermore, where territory-based sharing requires a new territory and manual adjustments for every partner, account-based sharing simplifies growth. Organizations onboard hundreds of contractor partners by simply creating an Account and associated Service Resource records, leaving the core geographic territory structure untouched and performant.
### Final Decision Matrix\: Comparing Architectures
| Decision Driver | Territory-Based Isolation | Account-Based Sharing (Proposed) |
| ------------------------------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **Scheduling and Optimization Efficiency** | Low (siloed resources) | High (aggregated pool) |
| **Operational Performance** | Low (siloed territories and resources covering the same geographical area) | High (maximizing utilization, travel time minimization, accelerating responsiveness/time-to-serve) |
| **Territory Scalability** | Poor (risk of "hierarchy sprawl") | Excellent (static geography) |
| **Complexity of Setup** | Low (declarative/OOTB) | Medium (Flow/Apex required) |
| **Partner Data Security** | High (hard boundaries) | High (platform sharing rules) |
| **Internal Management** | High (dispatcher manually toggles between views) | Low (consolidated regional view) |
### Brownfield Migration\: Transitioning from Territory-Based Sharing to Account-Based Sharing
This guide has focused primarily on net-new implementations. However, many organizations are already running Territory-based sharing at scale and carry significant territory hierarchy debt. Migrating from territory-based sharing to account-based sharing in a live production environment introduces distinct architectural risks to assess before any transition work begins. This section addresses the three critical dimensions of an existing-system migration\: evaluating the current state, determining transition strategy, and managing migration risks.
- **Assessing Territory Sprawl\:** Before any migration planning, quantify the current territory hierarchy. The key diagnostic questions are\: How many territories exist solely to enforce contractor isolation versus genuine geographic boundaries? What is the ratio of contractor-specific child territories to operational parent territories? Are any territories shared between internal and external resources, or have they been fully siloed? This audit distinguishes true geographic structure from accumulated isolation debt. Territories created exclusively for partner visibility control are strong candidates for elimination under account-based sharing. Territories that encode genuine operational geography (scheduling zones, SLA regions, regulatory boundaries) are preserved and aren't conflated with access control.
- **Hybrid Transition Viability\:** For organizations at scale, a full cutover from territory-based sharing to account-based sharing is rarely advisable; instead, a hybrid transition reduces risk by onboarding new contractors under account-based sharing while maintaining legacy territory-based sharing cohorts until their next renewal window. The hybrid approach is architecturally viable provided the account-based sharing automation is strictly scoped to the account/company identifier, allowing resources without that ID to remain on territory-based access without disruption. Treat the hybrid state as a temporary architecture—not a permanent operating model.
- **Key Migration Risks\:** Existing-system migrations introduce three critical architectural risks that require proactive mitigation. First, sharing table rebuilds triggered by new criteria-based rules are resource-intensive; schedule cutovers during low-activity windows to prevent dispatcher visibility gaps caused by long-running recalculations. Second, in-flight work orders risk visibility loss during the transition; maintain parallel territory memberships or pre-populate sharing for active records until they are closed. Finally, tune optimization and scheduling policies as removing child territories shifts the resource pool. Test, take baseline runs, and capture metrics to confirm geographic boundaries remain effective and that efficiency gains are actually realized.
## General Recommendation
Given the scalability and optimization ROI, we recommend the **account-based sharing** approach for high-growth Field Service organizations that manage multiple competing contractors in overlapping geographic regions. While territory-based sharing offers a simpler, declarative setup, account-based sharing allows organizations to unlock the full potential of the Scheduling and Optimization engine. By decoupling visibility from geography, organizations can maintain a territory setup that scales with the business and delivers these outcomes\:
- **Operational Efficiency\:** Aggregating resources into a single pool allows the engine to find the true "best" technician for every job, reducing travel time and operational costs.
- **Enhanced Service Levels\:** Comprehensive scheduling reduces service delays by identifying which contracted resource is most available/closest, accelerating time-to-serve and directly improving customer satisfaction.
- **Dispatcher Productivity\:** Internal staff can manage a consolidated regional view rather than toggling between siloed "child" territories.
Territory-based sharing is best suited for highly siloed contractor operations with strictly non-overlapping geographic territories/areas.
## Implementation Checklist\: Next Steps and Engagement
Choosing an architectural pattern is the first step. Successful execution requires continuous alignment with Salesforce best practices and the platform capabilities.
**Next Steps\:**
- **Audit Your Landscape\:** Review your current territory hierarchy and external resource utilization. Identify any "contractor territories" created solely for partner isolation — if your hierarchy is cluttered with such silos, evaluate the benefits and effort of migrating to account-based sharing.
- **Sandbox Validation\:** Prototype the account-based sharing pattern in a full or partial sandbox and test visibility end-to-end from all angles\:
- **Internal Users (admins, dispatchers, and internal technicians)\:** Confirm appropriate access. Some internal users should have access across the board.
- **The Contractor Manager User\:** Verify visibility is scoped strictly to their own workforce.
- **Contractor's technicians (the external resources)\:** Confirm access is properly restricted to their assigned work only.
- _Rigorous testing of organizational visibility is essential to prevent data leakage between competing partners._
- **Performance Benchmarking and ROI evaluation\:** Leverage Optimization Hub and Field Service Intelligence Dashboards to get insights into travel time reduction, resource utilization, and response time improvements, providing the data needed to justify the architectural shift to stakeholders. This before-and-after analysis can also be repeated in production once the transition is underway.
- **Pilot Phase\:** Once sandbox testing is complete, launch a phased pilot in one or two territories where internal and external resources geographically overlap, ideally, mirroring those tested in the sandbox. Validate sharing logic with a small, controlled user group before broader rollout is recommended before full deployment.
- **Scalability of the Solution\:** Confirm that any custom automation (Flow or Apex) required to manage Sharing Tables and Service Territory Member (STM) records is engineered for long-term sustainability. The solution should utilize modular design patterns (for example, Trigger Frameworks) and ensure the logic is built to handle high-volume resource assignments seamlessly within platform governor limits.
## Architectural Note
_All patterns in this guide require validation in a sandbox environment before production deployment. Implementation behavior may vary based on org configuration, data volume, and business rules._
## References and Further Reading
**Platform Documentation (Salesforce Official)\:**
- [Field Service Developer Guide\:](https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/fsl_dev_introduction.htm) Core reference for Field Service data objects, APIs, and customization
- [ServiceResource Object Reference\:](https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/sforce_api_objects_serviceresource.htm) API documentation for the SR object
- [ServiceTerritoryMember Object Reference\:](https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/sforce_api_objects_serviceterritorymember.htm) API documentation for the STM object
- [Criteria-Based Sharing Rules\:](https://developer.salesforce.com/docs/atlas.en-us.securityImplGuide.meta/securityImplGuide/security_sharing_rules_criteria.htm) Official security guide for implementing the sharing rules underpinning account-based sharing
- [Apex Triggers Developer Guide\:](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm) Reference for the custom automation layer required by account-based sharing
- [Apex Trigger Best Practices\:](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_bestpract.htm) Salesforce recommended patterns for scalable trigger development
**Salesforce Help Articles**
- [Guidelines for Setting Up Field Service Contractors\:](https://help.salesforce.com/s/articleView?id=service.fs_setting_up_contractors.htm&type=5) Guidance for configuring contractor resources on the Salesforce Field Service
- [Define Capacity-Based Resources\:](https://help.salesforce.com/s/articleView?id=service.fs_define_resource_capacity.htm&type=5) Official documentation for setting up capacity-based resources referenced in the article
- [How Does the Field Service Optimization Engine Work?](https://help.salesforce.com/s/articleView?id=service.fs_start_optimization.htm&type=5) Field Service Optimization reference. Guidance for optimization runs, also relevant to account-based sharing advantages and ROI referenced in the article.
- [Set Up Optimization Hub](https://help.salesforce.com/s/articleView?id=service.pfs_optimization_hub_set_up.htm&language=en_US&type=5)\: Configuration guide for Optimization Hub referenced in the Next Steps section
- [Experience Cloud Overview\:](https://help.salesforce.com/s/articleView?id=experience.networks_overview.htm&language=en_US&type=5) Partner Community setup for account-based sharing (On-Platform Management)
**Salesforce Trailhead/Learning**
- [Field Service Basics\:](https://trailhead.salesforce.com/content/learn/modules/field_service_basics) Foundational module covering territories, resources, and operating hours
- [Field Service Scheduling\:](https://trailhead.salesforce.com/content/learn/modules/field-service-lightning-scheduling-basics) Scheduling concepts that underpin the optimization discussion in this guide
- [Field Service Optimization\:](https://trailhead.salesforce.com/content/learn/modules/field-service-lightning-optimization) Deep dive into optimization setup and scheduling policies
- [Salesforce Security and Who Sees What\:](https://trailhead.salesforce.com/content/learn/modules/data_security/data_security_sharing_rules) Sharing rules and data security fundamentals
- [Customize Your Experience Cloud Site\:](https://trailhead.salesforce.com/content/learn/trails/customize-your-community) Trailhead trail covering the Experience Cloud site setup behind a partner portal like the one referenced in the article
**Industry and Strategic Context**
- [Salesforce State of Service Report, 7th Edition\:](https://www.salesforce.com/resources/research-reports/state-of-service/) The most recent edition, surveying 6,500 service professionals worldwide, with dedicated insights on Field Service, AI adoption, and technician productivity trends directly relevant to the ROI arguments in this paper.
- [Agentforce for Field Service\:](https://www.salesforce.com/news/stories/agentforce-for-field-service-announcement/) Salesforce's AI-powered field service platform, directly relevant to the AI and future-proofing discussion in Section 13. Account-based sharing unified resource pool is maximizing Agentforce's scheduling intelligence.
- [Gartner Market Guide for Field Service Management\:](https://www.gartner.com/en/documents/6311147) The most current Gartner analysis of the FSM market landscape (Gartner subscription required).
## About the Authors
**Mor Epstein**
_Senior Success Architect, Salesforce Field Service_
With an Industrial Engineering background from Georgia Tech and an MBA, Mor is a trusted advisor with a proven track record of unblocking and accelerating mission-critical Field Service implementations. Her global customer-facing experience, combined with hands-on, data-driven problem solving, positions her as a go-to resource for field service organizations worldwide. Mor excels at guiding customers through the Scheduling and Optimization journey, helping organizations unlock the full potential of intelligent scheduling to achieve measurable gains in efficiency and service delivery.
**Lee Ephrati**
_Senior Success Architect, Salesforce Field Service_
Lee is a highly experienced Technical Architect with over 10 years of Salesforce delivery and advisory experience, specializing in Field Service architectures and mobile solution design. Lee focuses on aligning complex organizational structures with the native SFS platform and mobile application to drive maximum operational ROI for global enterprises. With a customer-first mindset and comprehensive platform knowledge, Lee brings a consultative approach that consistently delivers lasting value for Salesforce customers worldwide.
# Introduction
The Salesforce Customer 360 Platform provides a powerful [multitenant, metadata-driven architecture](/docs/architect/fundamentals/guide/platform-multitenant-architecture) to every individual Salesforce tenant instance (aka ‘org’). This architecture basics document provides an overview of areas where the underlying architecture of the Salesforce Platform creates a key consideration for the architectures of solutions built on the platform.
There are three essential areas to understand when designing architectures on the Salesforce Platform:
- [Transactions](/docs/architect/fundamentals/guide/architecture-basics#transactions)
- [Metadata Versus Data](/docs/architect/fundamentals/guide/architecture-basics#metadata-versus-data)
- [Platform APIs](/docs/architect/fundamentals/guide/architecture-basics#platform-apis)
## Transactions
On the Salesforce Platform, a transaction can be instantiated by code execution and/or a database operation. A fundamental competency for architecting on Salesforce is understanding how the platform defines and controls transactions for tenants. In order to maintain resources for all tenants, Salesforce imposes limits upon every tenant, calculated on a per transaction and per org basis.
At the transactional level, Salesforce sets [governor and execution limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) to ensure individual instances of code execution and database transactions don’t monopolize shared compute resources. At the org-wide level, Salesforce sets limits based on [edition and feature type](https://help.salesforce.com/s/articleView?id=sf.overview_limits_general.htm&type=5). Org-wide limits also include a rolling calculation of API usage across all transactions in the org, which are subject to [API limits](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm).
Let's look more closely at two key parts of transactions on the Salesforce Platform: execution context and database manipulation.
### Execution Context
Salesforce calculates transactional limits based on a concept of [execution context](https://trailhead.salesforce.com/content/learn/modules/apex_basics_dotnet/execution_context). It is important to understand that for Salesforce applications, this is not exclusive to executions of custom code within a single Salesforce org. Execution context is based on the platform runtime engine, and all code available to the runtime engine for a particular tenant. This means custom code defined within a tenant’s org, code from packages installed with that org, as well as code contained within Salesforce platform services can all instantiate a transaction. The platform does distinguish between different kinds of Apex code and calculates governor limits based on those distinctions.
See the Apex developer’s guide for more about [Apex transaction limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm).
### Database Manipulation
When a transaction involves database manipulation, a built-in [order of execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) prescribes how different parts of your org’s configuration and code will behave. A key to understanding how to correctly use the order of execution in your Salesforce applications is understanding the robust data integrity this behavior provides for your Salesforce applications.
The platform exposes context variables for the state of database operations in the form of [trigger context variables](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_context_variables.htm). It is important to understand that these trigger context variables describe runtime states for all database transactions in Salesforce org—whether or not custom Apex Triggers have been defined within that org. They are available to declarative tools like Salesforce Flow.
In Salesforce, data is not committed (nor are data transactions finalized) until the final _after_ trigger behaviors described in the order of execution have completed successfully. This means that any fatal errors or disqualifying behaviors during a data transaction that occur in _before_ contexts or _after_ contexts will cause the platform to roll back all data operations within the transaction. Requested changes to record data are not committed to the database, and no post-commit logic is executed. (Apex does expose [database methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_transaction_control.htm) to allow for more granular control of savepoints and rollback behavior.)
A key anti-pattern to avoid in your Salesforce architecture is attempting to short cut or supersede the platform’s built-in order of execution behavior.
For a deeper look at the logic behind these built-in data integrity behaviors, see [Inside and Out: Transactions](https://engineering.salesforce.com/inside-and-out-transactions-b9535faa5924) on the Salesforce Engineering blog.
## Metadata Versus Data
When choosing how you customize and extend within a Salesforce org, it is important to understand what will be considered data and what will be considered metadata from the point of view of the Salesforce Platform. For a deep-dive into the underlying architecture behind this data/metadata distinction, in the [Platform Multitenant Architecture](/docs/architect/fundamentals/guide/platform-multitenant-architecture#the-platform-data-layer) fundamentals doc.
This distinction will affect many aspects of the development lifecycle for your application, such as: whether or not an artifact will be copied over into [sandbox development environments](https://help.salesforce.com/s/articleView?id=sf.create_test_instance.htm&type=5), how it can be migrated to other environments, whether or not it can be part of a [package](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/sharing_apps.htm).
The table below offers a quick comparison of the performance of data vs. metadata as it relates to key parts of the application lifecycle:
Behavior
Data
Metadata
Copied from production into sandbox environments
No*
Yes
Migrate by Metadata API
No
Yes**
Migrate by data load
Yes
No
Can be included in packages
No
Yes**
Counts against data storage limits
Yes
No
*Full copy and partial copy sandboxes allow for data replication from production. **Some metadata types are not available for use with the Metadata API and/or packages. You can find exceptions in the Metadata Coverage Report.
Sometimes this distinction is fairly obvious. For example, individual records in a Salesforce org are data. The various [sObjects](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SObjects.htm) in an org are metadata.
Distinctions can be more complex when it comes to org configuration features. A key example is [Custom Settings](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_customsettings.htm) vs [Custom Metadata Types](https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_about.htm&type=5). Both of these features allow you to configure information in an org so that it is easily available at runtime, and can be manipulated and managed in ways that are similar to database records. Both features are intended to allow for loosely coupled, highly flexible design patterns in code and automation. However, Custom Settings are stored in an org as data and Custom Metadata Types are stored as metadata.
You can determine if something is metadata by seeing if it appears in the [Metadata Coverage Report](https://developer.salesforce.com/docs/metadata-coverage). This report will also tell you about key development and deployment behaviors for a particular type of metadata.
## Platform APIs
There are many [Salesforce Platform APIs](https://help.salesforce.com/s/articleView?id=sf.integrate_what_is_api.htm&type=5). Salesforce Platform APIs support different data formats and protocols, various operation types and timings. Some APIs allow you to interact with the data in a Salesforce org, while others support interactions with the metadata in a given org. Some APIs are built specifically to handle [large transaction volumes](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm), others are not. Salesforce updates the version number for _all_ Salesforce Platform APIs with every release.
A key part of sound application architecture is making sure application developers [use the correct API](https://help.salesforce.com/s/articleView?id=sf.integrate_what_is_api.htm&type=5) (and API version) for a given use case. You will need to consider the built-in [API limits](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm) for your Salesforce orgs, many of which are determined by edition and feature activation. The Salesforce Platform APIs support [backwards compatible](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_support_policy.htm) usage, which means implementations with a particular version should perform with stability and consistency, even as new API versions are released. If you want to incorporate new or changed functionality from a new API version, you may need to refactor your app before upgrading references to the new API version.
The many different Salesforce Platform APIs, along with the speed of Salesforce API versions, adds significant complexity to the lifecycle of any applications that use Salesforce APIs. You will need to plan for regular evaluations of the Salesforce Platform API references in your applications and prioritize planned API maintenance cycles to keep applications running predictably and properly.
# Guide Overview
Asynchronous processing increases [scalability](/docs/architect/well-architected/guide/reliability.html#scalability-and-capacity-planning) by allowing higher limits per context. Asynchronous requests execute in their own threads behind the scenes, so users can continue to do work on the client side as the asynchronous tasks execute in the background.
The Salesforce Lightning Platform offers a variety of asynchronous technologies that can be used to solve a given use case. Each technology has benefits and limits that you will need to consider when selecting an approach for each use case.
When choosing a technology for implementation, three important considerations to keep in mind are:
1. Asynchronous processing isn’t the best approach for every problem. It can be tempting to think of any process that doesn’t directly require user interaction as a good candidate for asynchronous processing, but there are some drawbacks. First, asynchronous processes have no SLA, which means that there’s no guarantee that an asynchronous process will complete within a set amount of time. Second, there’s no guarantee of consistent response latency. If an asynchronous process completes within a certain amount of time, a subsequent process can take a different amount of time to complete. Therefore, even if a user isn’t directly waiting for a response, asynchronous processing might not be right for your scenario if you have subsequent processes that depend on a response, or if you’re concerned that excessive response times might cause your data to become out of sync with the data in an external system.
2. There are different ways to process asynchronous requests on the Salesforce Platform, so make sure that you choose the best approach. Technologies that support asynchronous processing on the Salesforce Platform work differently “under the hood,” and some were designed for very specific use cases.
3. If a technology is asynchronous on the client side, it doesn’t necessarily mean that all of the end-to-end processing is performed in parallel. Depending on the choices that you make, the client’s messages can sometimes still get serialized on the server side.
If you use the wrong technologies or the wrong combinations of technologies for a job, unintended consequences that cancel out the benefits of asynchronous processing can occur. This guide provides explanations and recommendations, as well as potential drawbacks and anti-patterns for various asynchronous use cases, along with the rationale for those recommendations. It also provides insight into how various asynchronous implementation techniques operate and are regulated on the Salesforce Platform.
If you are making a decision about what technology to use, there is a focused [Asynchronous Processing Decision Guide](/docs/architect/decision-guides/guide/async-processing) that gives a quick mapping of typical use cases to the best-fit technology.
## Products in Scope
The Salesforce Lightning Platform is a comprehensive, AI-driven platform that unifies employees, autonomous AI agents, company data, and applications into a single, trusted system to enhance productivity and customer experience. It enables the creation of an "agentic enterprise" by connecting Customer 360 apps, Data Cloud, and Slack for end-to-end automation.
This document does not cover technologies in other ecosystems such as MuleSoft, Informatica, Commerce Cloud, Tableau, and Marketing Cloud.
Note that this guide focuses exclusively on asynchronous processing within the Salesforce Lightning Platform. If you are looking for information about asynchronous integration patterns, check out [Event-Driven Architecture](/docs/architect/decision-guides/guide/event-driven).
## Takeaways
- **Before using asynchronous processing, make sure that your use cases fit the pattern.** Asynchronous patterns have no SLA, are subject to multiple governor mechanisms, can have capacity limits defined based on licensing, and can cause processing delays due to the finite nature of the resources allocated to asynchronous infrastructure within the Salesforce Platform. Take these limitations into serious consideration when using asynchronous processing in scenarios where a user requires a response from the system before they can continue with their work.
- **Asynchronous processing with Salesforce isn’t a solution for boundless scaling needs.** The Salesforce Platform doesn’t scale infinitely, and asynchronous patterns are still subject to limitations. Asynchronous processing uses threads, which contain the contextual information that a CPU needs to execute a stream of instructions. Threads can run in parallel. The number of available threads in any CPU is limited, so the platform has mechanisms in place to ensure that its available threads are used as efficiently as possible. The platform’s [flow control mechanism](/docs/architect/decision-guides/guide/async-processing#flow-control) prevents orgs from consuming too many threads and negatively affecting other orgs. The platform’s [fair usage algorithm](/docs/architect/decision-guides/guide/async-processing#fair-usage) controls the number of threads that an org has available for each particular message type.
- **Know when transactions are truly asynchronous.** Some architecture patterns behave asynchronously end-to-end. However, other processes behave asynchronously on the client- or browser-side, but serialize server-side requests, which are then subject to synchronous governor limits.
- **To build large-scale outbound integrations from the Salesforce Platform, use platform events and robust middleware instead of callouts via asynchronous Apex**. Because there are a finite number of asynchronous threads available in the platform, outbound integrations via asynchronous Apex have limited scalability. If your org has outbound integrations that involve high volumes of messages, exceed the number of available threads, and have long processing times, then using asynchronous Apex will inevitably introduce delays.
- **Make sure to incorporate monitoring when using asynchronous processing.** With monitoring, you can detect issues as early as possible and correct them before major performance incidents occur.
- **Account for events that can cause extreme loads.** When you design asynchronous processes, make sure that they can predictably manage workload spikes and lulls. Consider how your implementation handles unexpected events, such as power outages, and design safeguards that mitigate data loss or loss of functionality.
## Approaches in Depth
When you select an approach for server-side asynchronous processing, first evaluate your organization’s requirements and available resources. Your goal is to select an approach that minimizes implementation and maintenance costs while still ensuring scalability and minimizing your likelihood of limit violations. This goal is dependent on the technical considerations outlined in the next sections, as well as the makeup of your team. For example, consider whether you have Apex developers on your team who can maintain your pro-code solution. Otherwise, a declarative approach can make more sense. Also, keep in mind that different sets of [limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) can apply to different tools.
Consider the use case of an asynchronous ordering process in Salesforce. When an order is saved, it triggers a message to an external warehouse management system with special instructions for how to pack and ship an item. The user who places the order doesn’t need an immediate response from the warehouse management system, so the request can be sent asynchronously. The asynchronous processing allows the user to continue their work without delays.
Considerations for your architecture:
- How many concurrent processes are needed?
- How will the concurrent process interact with each other?
- How many SOQL queries will execute within each process?
- How many DML operations will execute within each process?
- How long will each process run?
- How sensitive are processes to specific timing?
### Asynchronous Apex
The Salesforce Platform’s [multitenant architecture](/docs/architect/fundamentals/guide/platform-multitenant-architecture) isolates and concurrently supports the varying requirements of many tenants (orgs). All asynchronous Apex methods covered in this guide are executed within the same asynchronous infrastructure in the Salesforce Platform. They use a message queuing framework that is governed by two primary enforcement mechanisms: flow control and fair usage.
The flow control and fair usage mechanisms prevent a single tenant from using too many server resources and not leaving enough resources for the remaining tenants. Although it’s helpful to understand how these mechanisms work, your key takeaway should be that following asynchronous processing best practices, such as the ones outlined in the next sections, significantly reduces your likelihood of running into issues with them.
#### Flow Control
The platform’s flow control mechanism prevents one org from flooding a given message type, which consumes too many threads and negatively affects other orgs. Before the framework adds new entries to the queue associated with a message type, it checks the first several thousand existing entries in the queue. If the majority of existing entries are associated with that same org and that org already also has entries in worker threads, then the newly added entries are moved to the back of the queue. This process is called re-enqueuing. Re-enqueuing typically happens to Batch Apex and Bulk API processes because they often insert large numbers of entries into their queues at the same time.
#### Fair Usage
The platform’s fair usage mechanism implements a tier-based system. The system ensures that each org on the Salesforce Platform gets a fair share of processing time for a given message type, including Future, Queueable, and Batch message types. If one org dominates a given message type during the same time that other orgs are waiting to perform work on the same message type, the fair usage algorithm reduces the number of threads that the org has available for that particular message type.
A benefit of using asynchronous Apex methods is that some governor limits, such as SOQL query limits and heap size limits, are higher. However, don’t rely too heavily on these methods. Due to the finite resources allocated to asynchronous infrastructure, heavy usage of Future, Queueable, and Batch Apex can cause processing delays that stem from limitations based on fair usage and flow control.
#### Special Considerations for Outbound Callouts via Asynchronous Apex
Outbound callouts that use asynchronous Apex count against the asynchronous Apex limit. The daily limit is currently 250,000 or 200 times the number of applicable user licenses, whichever is greater. This limit can be an issue for high-volume use cases. If you exceed the limit, your asynchronous Apex jobs and their associated outbound callouts will fail.
Additionally, because the platform has a finite number of asynchronous threads available, outbound integrations via asynchronous Apex have limited scalability. Any high-volume outbound integrations that exceed the number of available threads can have long processing times and lead to delays.
For high-volume use cases, consider these alternative approaches. API calls with these approaches count towards the daily API request limit, which is significantly higher than the daily asynchronous Apex limit. Thus, these approaches are more scalable. Note, however, that there are still physical limitations on the number of concurrent requests that any CPU can process.
- **Middleware Scheduled Pull.** Avoid delays associated with high-volume outbound integration jobs by using middleware to pull the data on a scheduled basis instead of pushing it via asynchronous Apex. Middleware, such as the MuleSoft Anypoint Platform, can use native SOAP API or REST API in a synchronous fashion so that few, if any, delays are introduced. Middleware can also use the native Bulk API for large data volumes.
- **Middleware Pull via Platform Event Notification.** Instead of enqueuing Future, Queueable, or Batch asynchronous Apex to perform outbound integrations, you can use platform events. The platform event can either deliver the outbound information itself or instruct a middleware tool to pull the required information via a native API and deliver it to its final destination. Neither of these approaches are subject to the delays that asynchronous Apex is subject to. However, [platform event limits](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_limits_default.htm) still apply.
#### Asynchronous Apex Tradeoffs
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Apex Future Methods
We recommend that you use Queueable Apex instead of Apex future methods. Queueables have the same use cases as future methods but offer additional benefits.
Pro-code
Yes
Yes
Asynchronous
Queueable Apex
We prefer this approach over future methods. Use for processes that involve long-running database operations or external web service callouts. Queueable Apex offers additional benefits over future methods, including job IDs, support for non-primitive types, and job chaining.
Pro-code
Yes
Yes
Asynchronous
Scheduled Apex
Execute Apex at a scheduled time defined by a cron expression. Although the act of scheduling Apex via the cron expression is an asynchronous process, the underlying code executes synchronously when the job starts.
Pro-code
Yes
Yes
Synchronous
Apex Continuation Callouts
Callouts from Apex methods running in a synchronous transaction context.
Pro-code
Yes
Yes
Synchronous
#### Queueable Apex
With Queueable Apex, you can run Apex processes that involve extensive database operations or external web service callouts asynchronously. To use Queueable Apex, implement the [Queueable interface,](https://developer.salesforce.com/docs/atlas.en-us.258.0.apexref.meta/apexref/apex_class_System_Queueable.htm) and then add a job to the Apex job queue. This approach ensures that the asynchronous Apex job runs in the background in its own isolated thread and doesn’t delay the execution of your main Apex logic. Each queued job runs when system resources become available.
Queueable Apex represents the evolution of asynchronous Apex. It offers features that aren’t available to Apex future methods, including:
- **Job IDs:** When you submit a job by invoking the System.enqueueJob method, the method returns the ID of the new job. You can use this ID to identify your job. To monitor its progress, view the Apex Jobs page in Salesforce Setup, or query the AsyncApexJob object.
- **Support for non-primitive types:** Queueable classes can contain member variables of non-primitive data types, such as sObjects or custom Apex types.
- **Support for job chaining:** You can chain Queueable jobs together by starting a second job from a running job. This technique can help you address scenarios involving process dependencies.
- **Maximum depth control:** You can configure Queueable jobs with a maximum stack depth to ensure that chains of jobs don’t end up with unexpected recursion.
- **Deduplication signatures:** Queueable jobs provide an optional signature to detect and remove duplicate jobs.
- **Configurable delay:** You can define a delay of up to 10 minutes before the Queueable job will execute.
- **Transaction finalizers:** You can attach a post-action sequence to a Queueable job and take relevant actions based on its result. For example, a [transaction finalizer](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_transaction_finalizers.htm) can re-enqueue a Queueable job that failed due to an unhandled exception up to five times.
#### Considerations for Apex Future Methods and Queueable Apex
Salesforce uses a queue-based framework to handle asynchronous processes. This queue is used to balance request workloads across orgs. To ensure that your org uses this queue as efficiently as possible:
- Avoid enqueueing future or Queueable methods directly from actions generated by large volumes of end-user activity or integration API calls. This approach can quickly exhaust daily asynchronous Apex limits, resulting in serious business impacts.
- Avoid enqueueing more than one asynchronous action per synchronous action. When multiple asynchronous methods are enqueued from a single synchronous action, the asynchronous activities often execute at the same time and contribute to row lock contention and/or row lock timeout errors.
- Avoid adding large numbers of future or Queueable methods to the asynchronous queue.
- Ensure that future and Queueable methods execute as quickly as possible. The longer a future method takes to execute, the more likely requests behind it in the queue will be delayed. To ensure fast execution of batch jobs, minimize web service callout times, tune queries used in your future methods, and optimize any other object automations including Process Builder processes, workflow rules, flows, and Apex triggers.
- Test your asynchronous methods at scale. Use an environment that generates the maximum number of methods that you expect to handle. This testing helps determine whether you’ll encounter issues with performance or limits in your production environment. Also consider the impact on cumulative daily limits.
- Use Batch Apex instead of future or Queueable methods to process large numbers of records. Batch Apex can handle complex, long-running processes that execute against thousands of records and can be scheduled to run during off hours when more resources are available.
#### Scheduled Apex
Use scheduled Apex to execute at a specified time and at a repeated frequency as defined by a cron expression. Although the act of scheduling Apex via the cron expression is an asynchronous process, the underlying code executes synchronously when the job starts. Scheduled Apex is ideal for daily or weekly maintenance tasks.
#### Considerations for Scheduled Apex
- You can only have 100 scheduled Apex Jobs at one time. To avoid this limitation, consider using a schedule-triggered flow that invokes Apex code instead of using scheduled Apex.
- Use extreme care if you’re planning to schedule a class from a trigger. You must be able to guarantee that the trigger won’t add more scheduled classes than the limit. In particular, consider API bulk updates, import wizards, mass record changes through the user interface, and all cases where more than one record can be updated at a time.
- For one-off tasks that need to be scheduled up to 10 minutes in the future, use a delayed Queueable job. This approach does not count toward the 100 scheduled job limit.
- Scheduled Apex is executed in a synchronous context with synchronous limits.
- Consider how long the scheduled job will execute for. A long-running job may overlap with the start of the next scheduled job.
- Salesforce schedules the class for execution at the specified time. Actual execution can be delayed based on service availability. Jobs scheduled to run during service maintenance downtime will be scheduled to run after the service comes back up.
- Use [System.scheduleBatch](https://developer.salesforce.com/docs/atlas.en-us.258.0.apexcode.meta/apexcode/apex_batch_interface.htm#apex_batch_scheduleBatch_section) for scheduling batch jobs rather than having a scheduled job with the sole purpose of enqueuing a batch job.
#### Apex Continuations
Historically, synchronous callouts made from an Apex method running in a synchronous Apex transaction context, such as a Visualforce controller or a Lightning component controller, were subject to the [Apex concurrency limit](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) regarding long-running requests. As of Winter ’19, synchronous callouts are no longer counted as long-running. Although Apex continuations were initially created as a solution to synchronous callouts that resulted in long-running requests, they also provide some additional benefits.
- A single synchronous action can perform up to three continuation actions. The previous continuation must complete prior to a new continuation action being performed.
- Each continuation action can perform up to a maximum of three callouts, which execute in parallel.
- When all of the callouts performed by a continuation action are complete, the platform invokes the continuation callback method to handle the results.
#### Considerations for Apex Continuations
Although continuations execute asynchronously with respect to the originating synchronous action, there are key differences between Apex Continuations and other asynchronous Apex techniques such as future methods, Queueable, or Batch. Key differences are:
- Continuations aren’t queued in any way.
- Continuations don’t contribute to the daily asynchronous Apex execution limit.
- Continuations switch thread context on the application server from a heavyweight Apex platform thread to a lightweight thread that only performs callouts. For the purposes of executing callouts that may run up to 120 seconds, continuations offer significant application server memory savings.
- Originally, continuations could only be executed from a Visualforce JavaScript remoting call. However, in Summer ‘19, continuations were officially added to the Lightning Component framework, which eliminated the need for Visualforce.
### Product: Platform Events
Platform events are the Salesforce Platform’s implementation of a purely event-driven architecture. You can find more details about the components associated with this type of architecture in the [Architect’s Guide to Event-Driven Architecture](/docs/architect/decision-guides/guide/event-driven).
Platform events and platform event triggers/flows are often great alternatives to running asynchronous Apex. They’re also a great way to invoke off-platform processing. For example, you can use a combination of [Amazon Web Services (AWS) event relays](https://help.salesforce.com/s/articleView?id=platform.ev_relay_create_ui.htm&type=5) and platform events to invoke serverless compute functionality in AWS Lambda. Work that’s performed relatively quickly and without any callouts (which aren’t possible from a platform event trigger or flow) is a great candidate for a platform event/trigger or event/flow combination.
The events published to the bus via [publish after commit](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_intro.htm) are delivered in order and can be bulk processed by the trigger or flow in a separate synchronous context. The context is synchronous and enforces all synchronous governor limits. Choose the platform event trigger/flow batch size carefully to avoid hitting limits.
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Platform Event Triggers
Loosely couple Salesforce with external systems and communicate between asynchronous platform components.
Low-code + Pro-code
Yes
Yes
Synchronous
#### Considerations for Platform Events
- As events are published on the event bus, they are available for consumers. In the case of event triggers (Apex or flow), these events are dispatched to available synchronous threads on the app tier (one thread per event trigger/flow). Note that this process doesn’t have an SLA.
- When publish operations are added to the queue, the result of the queueing process is stored in the Database.SaveResult object. These entries only indicate whether or not the queueing operation was successful. To get the final result of an event published through the event bus, implement an [Apex publish callback](https://help.salesforce.com/s/articleView?id=release-notes.rn_platform_events_publish_callbacks.htm&release=244&type=5). With this additional information, you can make decisions about further actions, such as attempting to republish failed events.
- While platform events aren’t subject to the same limits as asynchronous Apex, they do have their own sets of [governor limits](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_limits_default.htm). If you run into issues with limits, you can enable [enhanced event usage metrics](https://help.salesforce.com/s/articleView?id=release-notes.rn_platform_events_enhanced_usage_metrics.htm&release=244&type=5) to determine whether specific events are using up more of your allocations than you intended. If you need greater throughput on event triggers, consider using [parallel subscriptions](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_ps.htm) to process events simultaneously instead of in a single stream. With parallel subscriptions, you can scale Apex platform event triggers to handle high volumes of events. Parallel subscriptions are available for custom high-volume platform events but not for standard events or change events.
- Platform events have two options for publish behavior:
- Publish Immediately: Events are published immediately during the transaction, before the final database commit. Events that are published this way are not guaranteed to be published in order.
- Publish After Commit: Events are published at the time that the database transaction is successfully committed. Events that are published this way are guaranteed to be published in order.
It’s helpful to use Publish Immediately for use cases such as logging, where you want to publish the logging event regardless of whether the transaction succeeds and commits, or fails and rolls back. It’s possible to immediately publish a platform event that’s consumed by a platform event trigger. The platform event trigger then competes for a database row lock with the transaction that published it. Review all designs thoroughly prior to immediately publishing platform events to ensure that you avoid this scenario.
### Product: Asynchronous Flows
Asynchronous flows provide low-code alternatives to asynchronous Apex. As with other forms of asynchronous processing, they execute in the background when resources are available. Asynchronous flows also have no SLAs and can have unpredictable wait times.
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Scheduled Path (After Commit Flows)
Execute at dynamically scheduled times after triggering events.
Low-code
Yes
Yes
Asynchronous
Asynchronous Path (Record-Triggered Flows)
Execute an operation that you want to run on its own time and to avoid mixed DML errors.
Low-code
Yes
Yes
Asynchronous
**Scheduled Paths** are cron trigger-based to execute at a specific time. They execute when records are created, updated or deleted and give you granular control over when to run the automation relative to the record change. (Example: send an email to a user one hour before a task is due.) Unlike Apex future methods, which are limited to a maximum of 50 methods enqueued in a synchronous transaction, scheduled flow actions don’t currently have a max enqueue limit per transaction. There is, however, a batch size configuration within the definition of the scheduled path that allows for some control over how many records are handled by the scheduled path flow execution.
**Asynchronous Paths** can be added to record-triggered flows. They run in the background and don’t delay the execution of the transaction that originally triggered the flow. You can use an asynchronous path to execute a long-running operation or any operation that you want to run on its own time. Asynchronous paths can help avoid mixed DML errors that occur when you need to update a value on a related record that’s not part of the record that triggered the flow.
### Product: Outbound Messages (Legacy)
**Note:** Outbound messaging is a legacy feature and platform events (described in the previous section) are a more modern approach and offer greater flexibility. Platform Events are Salesforce’s recommended pattern for event-driven integration.
Outbound messages provide a means of asynchronous outbound communication via SOAP API. When configured in Salesforce, the outbound message definition produces a SOAP WSDL that can be consumed by an external web service provider. Outbound messages can be triggered from workflow rules, Process Builder processes, or Lightning after-save flow triggers. An outbound SOAP message can contain up to 100 notifications. Each notification contains the object ID and a reference to the associated sObject data. If the information in the underlying object changes after the notification is queued but before it is sent, only the latest data is delivered and not the intermediate changes.
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Outbound Messages
Share data with third-party systems in near real time via the SOAP protocol
Low-code
N/A
Yes
N/A
When an outbound message listener (the web service you configured with the generated WSDL) receives a message, it uses the included session ID information to call the Lightning Platform API to update the record in Salesforce that triggered the outbound message.
#### Considerations for Outbound Messages
- Outbound messages aren’t handled via the queue-based asynchronous infrastructure in Salesforce that runs activities such as future methods, Queueable Apex, Batch Apex, Bulk API, and so on. Instead, records are stored locally in the OutboundMessage object. Messages are dispatched and retried via a local scheduled background process.
- Messages aren’t sent synchronously when the outbound message action is executed by the initiating automation (for example, an after-save flow trigger). Instead, they remain in the OutboundMessage object until sent successfully or until they’re dropped after 24 hours of unsuccessful delivery.
- To avoid an infinite loop of outbound messages, ensure that the user who updates the objects does not have the Send Outbound Messages permission.
### Product: Email-to-Case
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Email-to-Case
Automatically create cases and populate case fields based on values in incoming emails.
Low-code
Yes
Yes*
Synchronous
* Email-to-Case is handled as both sync and async, but with synchronous Apex limits
Email-to-Case normally works in a synchronous manner. There’s a limit of four synchronous threads to handle inbound Email-to-Case requests. The synchronous form of the handler maintains a connection to the inbound Salesforce mail server (MTA) that receives the email. However, there are reasons why Email-to-Case can be handled asynchronously:
- Email-to-Case is subject to thread limits, specifically 10 total handler threads per app server: four threads for synchronous processing and six threads for asynchronous processing.
- If a synchronous email handler exceeds 15 seconds of execution time, then that particular email service address is marked as asynchronous for a period of 30 minutes. Subsequent handler requests for that service address result in a message that’s enqueued for MessageTypeName = MAILCATCHER_EMAIL_TO_CASE, along with a reference to the email content.
- If a synchronous thread is already in use for a particular org and service address, then additional requests for that service address are queued asynchronously.
- If a synchronously handled email encounters an error, such as a row lock timeout, then the request is saved and queued asynchronously.
- If no synchronous handler threads are available, then the request is queued asynchronously.
#### Considerations for Email-to-Case
- There is a deduplication option when you configure Email-to-Case, but it doesn’t deduplicate attachments until after the email is processed. This deduplication saves space in the database, but it doesn’t reduce email processing times. You can, however, improve performance by implementing a custom Apex Email-to-Case handler for message processing. This implementation doesn’t affect any governor limits, but it gives the handler access to the email message and all of its attachments before anything is committed to the database. This access allows you to compute checksums for all the included attachments and discard any that you decide are unnecessary, including duplicates, well-known signature pictures, or unwanted file types.
- Committing email attachments to Salesforce Files is responsible for the majority of email processing time. As reply-responses to or from the contact increase and the email chain gets larger, the processing time for each email also grows larger. If the email option “Reply with new content only” isn’t selected, then email chains will grow with each reply. Therefore, we recommend that you use an Apex Email-to-Case handler with logic that implements attachment deduplication at the time of processing.
- Despite the invocation of Apex triggers as part of the handling, Email-to-Case handlers are exempt from the concurrent Apex limit.
### Large Record Volume Processing
To process large volumes of records asynchronously, consider using one of these approaches.
Product / Approach
Use Cases
Skills Required
Asynchronous with Respect to Client
Asynchronous with Respect to Server
Type of Platform Limits Enforced
Batch Apex
Complex, long-running processes that involve thousands of records
Pro-code
Yes
Yes
Asynchronous
Schedule-Triggered Flows
Perform actions on a batch of records in the background at a specified time and at a repeated frequency via a flow.
Low-code
Yes
Yes
Synchronous
Bulk API
Insert, update, upsert, query, or delete many records asynchronously.
Pro-code
Yes
Yes
Asynchronous
### Batch Apex
You can use Batch Apex to build complex, long-running processes that involve thousands of records. Batch Apex operates by dividing up your record set and processing it in manageable chunks. As an example, you can build an archiving solution that runs on a nightly basis and adds records older than a certain date to an archive. Or you can build a data cleansing operation that looks at all Accounts and Opportunities on a nightly basis and performs any necessary updates based on a set of predefined criteria.
#### Considerations for Batch Apex
- Batch Apex is best at processing large amounts of data because asynchronous Apex has higher limits than synchronous Apex. Batch Apex also performs more efficiently when it processes more items per batch because it uses bulk operations that incur less overhead from queue management. Therefore, to avoid triggering the flow control mechanism via queue flooding and avoid exhausting the daily asynchronous Apex limit, don’t create batches with small scope sizes or that have fast processing times.
- Avoid enqueueing batch jobs directly from actions generated by large volumes of end-user activity or integration API calls. This approach can quickly exhaust the flex queue. If you plan to invoke a batch job from a trigger, then you must guarantee that the trigger doesn’t add more batch jobs than the limit.
- Batch Apex is limited to a maximum of five simultaneous threads, which limits its throughput much more than future methods or Queueable Apex.
- Batch jobs involving large volumes of data should ideally be scheduled to run during off-peak hours in order to free up resources for processes that require real-time or near real-time responses.
- When you call System.scheduleBatch, the platform schedules your job for execution at the time that you specify. Actual execution occurs on or after that time, depending on service availability.
- The scheduler runs in system context. All classes are executed, regardless of whether or not the user who scheduled the execution has permission to execute the class.
- All scheduled Apex limits apply for batch jobs scheduled using System.scheduleBatch. After the batch job is queued (with a status of Holding or Queued), all batch job limits apply, and the job no longer counts toward scheduled Apex limits.
- For a batch job with a recurring schedule, consider the correct behavior if the previous job is still executing when the new job starts running.
- Batch jobs enqueued from synchronous Apex transactions use the [flex queue](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm#Flex_Queue). The flex queue is limited to a maximum of 100 items at any point. If a transaction attempts to add more entries, then the platform generates errors and doesn’t submit the batch job.
- Callouts and other non-transactional operations from batch jobs must follow idempotent design considerations. Batch jobs queued before a Salesforce service maintenance downtime remain in the queue. After service downtime ends and system resources are available, the queued batch jobs are executed. If a batch job is running when downtime occurs, the batch execution is rolled back and restarted after the service is restored. Because execute methods can therefore run multiple times, any non-transactional operations, such as callouts, can be retried.
- Consider configuring the batch job to raise BatchApexErrorEvent events to handle error and exception scenarios.
### Schedule-Triggered Flows
A schedule-triggered flow is a flow scheduled to execute at a specified time and at a repeated frequency (daily, weekly, or once) to perform actions on a batch of records. (Example: update a field in all cases with a status of "Open" at 2 a.m. every night.) Scheduled Flows are executed via the cron trigger mechanism and are bulk processed.
#### Considerations for Schedule-Triggered Flows
- A schedule-triggered flow executes 200 records per invocation, but will be executed with multiple concurrent threads if more than 200 records are present.
- Schedule-triggered flows are executed in a synchronous context with synchronous limits.
- There is no way currently to control the number of records processed per scheduled flow invocation. If the execution is for more than 200 records, there is a real danger of Concurrent Apex errors.
### Bulk API and Bulk API 2.0
Bulk API is based on REST principles and is optimized for working with large sets of data. You can use it to insert, update, upsert, query, or delete many records asynchronously and process the results later. The Salesforce Platform processes the request in the background. In contrast, SOAP API and REST API use synchronous requests and are optimized for real-time client applications that update a few records at a time. You can use both of these APIs for processing many records, but when the data sets contain hundreds of thousands of records, they are less practical. Bulk API’s asynchronous framework is designed to make it simple and efficient to process data from a few thousand to millions of records.
The easiest way to use Bulk API is to enable it for processing records in [Data Loader](https://developer.salesforce.com/tools/data-loader) using CSV files. With Data Loader, you don’t have to write your own client app. Sometimes, though, unique requirements necessitate writing a custom app.
There are two Bulk APIs available within the Salesforce Platform.
- [Bulk API 2.0](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm) is the newer API. It provides a streamlined and easier-to-use workflow, and is the focus for enhancements.
- The original [Bulk API](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/api_asynch_introduction_bulk_api.htm) is still fully supported, but is no longer being enhanced. We recommend that you use Bulk API 2.0 where possible.
For more information on API limits, see [Bulk API Limits](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_concepts_limits.htm) and [Bulk API 2.0 Limits](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/bulk_common_limits.htm).
## Closing Remarks
Refer to this guide when building or considering asynchronous processing on the Salesforce Platform. It’s always a good idea to understand the full scope of options available to you, and how they may fit with your specific use case. Be sure to thoroughly assess your current landscape before making changes to any of your existing architectures, especially if your current solution is working well.
# Overview
This document outlines the current options for deploying applications to CloudHub 2.0 to meet high availability and disaster recovery requirements. It uses the US region as an example and can be applied to other regions.
CloudHub 2.0 is a fully managed, cloud-native integration platform that eliminates infrastructure overhead by automating the deployment, scaling, and management of MuleSoft APIs and integrations in the cloud. It's MuleSoft's modern cloud deployment platform, running on Amazon AWS infrastructure.
## Disaster Recovery Requirements
In most cases, the default High Availability (HA) and Disaster Recovery (DR) provided by CloudHub 2.0 is sufficient. CloudHub 2.0 provides HA and DR at a regional level (for more details refer to [CloudHub 2.0 Outage Scenarios](#cloudhub-20-outage-scenarios)). [The CloudHub 2.0 Key Considerations](#cloudhub-20-key-considerations) section provides more details about CloudHub-2.0-supported HA and DR.
Conditions that mandate a design beyond CloudHub 2.0’s default availability include:
- An application needs to ensure no data loss in a disaster scenario (for example, a region of Amazon going down).
- An application depends on the Object Store and needs to ensure continuity if the deployment region goes down.
## Assumptions
- Backend systems are configured for equivalent availability. CloudHub 2.0 can sometimes provide reliability through queues or similar mechanisms, but whether the integration is real-time or asynchronous, backend systems must support a comparable level of HA and DR.
- When an AWS region-level outage affects backend systems, their recovery is assumed to run in parallel with CloudHub 2.0 recovery.
- Private space setup is complete in multiple regions.
## Out of Scope
The design options in this guide focus on solutions for application availability in CloudHub 2.0 when an entire AWS Availability Zone or region becomes unavailable.
This guide does **not** address these recovery scenarios, though it does note implications where relevant:
- Recovery of backend systems, applications, databases, network components, and data centers that are managed and provisioned outside Anypoint CloudHub, whether on-premises or in the cloud.
- Recovery of VPN links between CloudHub 2.0 and the customer's private data center (for example, IPsec tunnels and VPN gateways). Some DR options in this guide may partially address these scenarios.
- Changes to MuleSoft egress IPs during disaster recovery when IP allowlisting is used for integrations. Some DR options in this guide may partially address these scenarios.
- External messaging systems used in customer solutions, whether provided by MuleSoft (such as Anypoint MQ) or other vendors (such as AWS MSK or Heroku Kafka).
## CloudHub 2.0 Key Considerations
When evaluating CloudHub 2.0 for [disaster recovery requirements](#disaster-recovery-requirements), think about these key considerations.
**CloudHub 2.0 Dependency on AWS Regional Availability**
- CloudHub 2.0 runs on AWS; its availability is tied to AWS regions.
- Deployments and application availability are organized by region. These regions correspond to AWS regions.
If an entire AWS region fails, applications in that region are unavailable and are not automatically replicated elsewhere.
**Application High Availability (HA) and Replica Management**
- CloudHub 2.0 automatically redeploys applications within the same region when hardware fails, but an application with a single replica can experience downtime.
- Applications with multiple replicas are deployed across separate availability zones by default, providing HA across zones.
- If the availability zone for a single-replica application fails, the application is automatically brought up in another availability zone within the same region.
**US East Region Specific Impact**
- In the event of a US East region outage:
- The CloudHub 2.0 management UI and deployment REST services are unavailable, and new applications cannot be deployed.
- Applications in other regions remain unaffected under most failure scenarios. These applications continue to operate normally; however, monitoring and management capabilities via the control plane will be unavailable during the outage.
- Core CloudHub 2.0 modules (such as application settings) are maintained in US East, so settings cannot be edited during the outage.
**Monitoring and Alerting**
- Configure alerting for availability zone or region-level failures via [status.mulesoft.com](http://status.mulesoft.com).
- Use a separate health-check and alerting mechanism outside CloudHub 2.0 so teams are notified if replicas fail or applications stop responding.
**Data Persistence (Object Store V2)**
- Object Store V2 is tied to the region where the application is _first_ deployed.
- If you move the application to another region, Object Store V2 stays in the original region to avoid data loss.
- If the region where Object Store V2 is deployed fails, the object store is unavailable.
**Ingress Controllers and Private Spaces**
- CloudHub 2.0’s ingress controllers are highly available at the region level.
- In a shared space, if one region fails, an ingress controller in another region remains available but can serve only applications deployed in that region.
- In a private space, if a region fails, ingress controllers in other regions are unavailable unless they were set up there in advance.
- Private space setup is regional; if a region fails, the private space is unavailable unless another region has been set up.
## CloudHub 2.0 Outage Scenarios
CloudHub 2.0 provides resilience across multiple levels: replica, availability zone, and region. This section describes Salesforce responsibilities and customer options for each outage scenario.
### Replica / Availability Zone / Region Outages
#### Salesforce Responsibility
| Component Status | Salesforce Responsibility |
| -------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Replica Down** | **Action**: CloudHub 2.0 automatically restarts the replica in a different availability zone if there is something wrong with the current availability zone. But the application will be offline until the new replica is fully started. **Condition**: Default configuration. **Time Taken**: Approximately 2-15 minutes depending on application complexity, and replica size. |
| **Availability Zone Down** | **Action**: Same as the replica down. **Condition**: Default configuration. **Time Taken**: Same as the replica down. **Notification**: Same as the replica down. |
| **Region Down** | **Action**: No automatic recovery. A failover design must be in place. |
#### Customer Responsibility
| Component Status | Customer Responsibility |
| -------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Replica Down** | **Notification**: Perform periodic health checks using a heartbeat mechanism built into the APIs. **Mitigation**: Deploy the application to multiple replicas in the same region. **Test / Simulation:** Raise a Ticket with MuleSoft Support and they will support a failover test to check if a new replica spins up in a different AZ in 1 to 15 minutes. |
| **Availability Zone Down** | **Notification**: Same as the replica down. **Mitigation**: Deploy the application to multiple replicas in the same region or in different regions. **Test / Simulation:** The AZ Down scenario is difficult to simulate. It requires involvement of MuleSoft Engineering to support possible test scenarios. |
| **Region Down** | **Notification**: Same as the replica down. Also check status updates at [https://status.aws.amazon.com](https://status.aws.amazon.com). **Mitigation**: Same as AZ Down. Disaster Recovery contingency plan: 2 private spaces with the same configuration in different regions. **Test / Simulation:** Same as AZ Down. |
### VPN Gateway and Ingress Controller Outages
#### Salesforce Responsibility
| Component Status | Salesforce Responsibility |
| :------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **VPN Gateway Down** | **Replica Status**: Running but not able to connect to any resources hosted on premises and reachable through the VPN tunnel. **Action**: No automatic recovery. A failover design must be in place. |
| **Ingress Controller (Shared Space) Down** | **Replica Status**: The Ingress controller is a clustered setup with multiple instances, similar to application replicas. If an application replica fails, a new one is created and started automatically. If one ingress controller instance fails, applications remain available through the other instance. If the entire Ingress controller is down, the region is considered down. |
| **Ingress Controller (Private Space) Down** | **Replica Status:** Same as Ingress Controller in shared space down. |
#### Customer Responsibility
| Component Status | Customer Responsibility |
| :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| VPN Gateway Down | **Notification**: Perform periodic health checks using a heartbeat mechanism built into the APIs. **Mitigation**: CloudHub 2.0 VPN gateways support high availability through a dual-tunnel architecture with automatic failover between tunnels; a customer must configure this pattern. **Test / Simulation:** The VPN Gateway Down scenario is difficult to simulate. Requires involvement of MuleSoft Engineering to support possible test scenarios. |
| Ingress Controller (Shared Space) Down | **Notification**: Same as VPN Gateway Down. **Mitigation**: Same as Region Down. Migrate applications to a standby or active space in another region. **Test / Simulation:** Same as VPN Gateway Down. |
| Ingress Controller (Private Space) Down | **Notification**: Same as VPN Gateway Down. **Mitigation**: Same as Region Down. Migrate applications to a standby or active private space in another region, in coordination with AWS Route 53 (or equivalent) configuration. **Test / Simulation:** Same as VPN Gateway Down. |
### Object Stores and Persistent Queues
**Overview Platform Services Down Scenario – Object Store**
In-Memory Object Store
Persistent Object Store v2
Location of Data
Local to the application only.
In the same region where the MuleSoft application was first deployed.
Shared Across Replicas?
No
Yes
Object Store Recovery in Applications
Data is lost; all in-memory data is lost on app restart, new deployment, or replica failure.
Data is not lost. unless the app is deleted.
Object Store Recovery within Region
Data is lost (same as above).
Data is not lost (same as above).
Regional Recovery
Same as above.
Data is unavailable. Even with an active-active DR configuration, Object Store is available only in the original deployment region.
Mitigation
Externalize data for regional recovery.
Data remains available while the original deployment region is available. For cross-region HA or DR, externalize data outside the object store.
## High Availability vs. Disaster Recovery
**High Availability** (HA) is the measure of a system's ability to remain accessible in the event of a system component failure. Generally, HA is implemented by building in multiple levels of fault tolerance and/or load balancing capabilities into a system. It is typically an Active-Active configuration and results in limited or no impact to Business Services.
**Disaster Recovery** (DR) is the process by which a system is restored to a previous acceptable state after a disaster scenario, either natural (like flooding, tornadoes, earthquakes, or fires) or man-made (like power failures, server failures, or misconfigurations). DR is typically an Active-Passive configuration and results in some impact to Business Services.
## Regional Availability in CloudHub 2.0
If Regional High Availability or Regional Disaster Recovery is desired to reduce business impacts in the event of an AWS regional failure, consider these points when designing your solution in MuleSoft CloudHub 2.0:
- CloudHub 2.0 replicas and related capabilities—private spaces, ingress controllers, and Anypoint MQ destinations—are region-specific.
- If an entire AWS region fails, all replicas and associated services in that region become unavailable.
- When a region recovers, configurations are restored; you must restart applications.
- If the US East region fails, Anypoint Platform services (for example, Access Management and Runtime Manager) are also unavailable.
- MuleSoft provides an SLA of 99.95% availability for Platform Services, including CloudHub 2.0 replicas in an active-active configuration within a region; refer to the latest MuleSoft cloud offering SLA for current details.
- CloudHub 2.0 does not support multi-region HA or DR out of the box; availability is provided only within a single region.
## Common Design Guidelines
These design guidelines apply regardless of which setup you choose.
**Multi-Region Private Spaces Setup**
All options described in the following sections require applications to be deployed in separate regions. That is possible only if private space setup is completed in advance, before a disaster. Because private space setup is regional, a DR strategy requires at least two private spaces—one per region—and a mechanism to switch traffic to the appropriate VPN endpoint.
**Highly Available Private Space Setup Within a Region**
CloudHub 2.0 does not provide automatic failover when a private space within a region fails. A workaround is an active-passive setup across multiple environments, which requires:
- Configuring multiple VPN gateways on the private space.
- Establishing separate environments in the CloudHub 2.0 region, each with its own private space.
- Designating one of these environments as passive (where applications are not initially deployed but are brought up if the primary private space fails).
If a high availability setup without VPN Gateway being a single point of failure is a hard requirement, deploying to two regions is the best option. A VPN Gateway failure in this scenario could be resolved by failing the affected region over to the alternative region where the private space is already configured.
**Zero Message Loss**
To achieve zero message loss when an entire region fails, an application must prevent data loss and address these points:
- Use external messaging to achieve message reliability.
- Ensure that Object Store is not used for in-flight transactional data that is transactional in nature. If the deployment region where the MuleSoft application was first deployed goes down, the Object Store will be unavailable.
- Wrap all Object Store access in a separate flow or section that continues to function—for both exception handling and behavior—when Object Store read or write operations fail.
**Note**. In most cases, DR requirements do not need to ensure a zero message loss in case of a disaster and need to ensure data loss is less than a given period’s worth of data (for example, 1 hour).
**Keep Integration Stateless**
As a general design principle, it is always important to ensure the integrations are stateless in nature. This means that no transactional information is shared between various client invocations or executions (in case of scheduled services). If some data has to be maintained by the middleware due to a system limitation, it should be persisted in an external store, such as a database or a messaging queue and not within the MuleSoft infrastructure or memory. It is critical to note that as we scale, especially in the cloud, the state and resources used by each replica should be independent of other replicas. This model ensures better performance, scalability, and reliability.
## Additional DR Considerations for Multi-Region Deployment
**Networking and Traffic Management**
- Vanity domains are required for regional availability; they act as a global DNS for all ingress controllers across regions.
- A **global load balancer** routes traffic between the primary and DR region private spaces. Customers provide this component; use AWS Route 53 or a global CDN with routing policies to route traffic across regions.
- Configure Ingress controllers in both primary and DR regions with a custom vanity domain.
- Plan and maintain firewall rules and VPN tunneling so that on-premises applications are reachable from both the primary and DR region private spaces.
- **TLS certificate maintenance** must cover private spaces in both primary and DR regions for seamless recovery.
**Application Deployment and Configuration**
- **Application names** must be unique across regions. For example, a CI/CD pipeline can append the region name (or a region code) to application names before deployment to maintain uniqueness across primary and DR regions.
- Configure the CI/CD pipeline to deploy applications to both the primary and DR regions so that all applications are available in both regions.
**Infrastructure and Capacity**
Performance is best when all infrastructure aspects have identical primary and DR region capacity. Performance degrades when these infrastructure aspects are not identical.
**Data Persistence and Storage**
- **Persistence storage** must be synchronized periodically between the two regions. Customers are responsible for storage replication; MuleSoft does not provide it. A single shared store between VPCs in the primary and DR regions is possible, but the shared storage must be highly available or it becomes a single point of failure for both regions.
- **Object Store V2** is regional and is available only in the region where the Mule application was first deployed. If the application is moved to another region, Object Store V2 remains in the original region to avoid data loss. Use other persistent storage for multi-region DR strategies.
**Testing and Operational Procedures**
Adopt a formal DR test strategy and run periodic DR drills. For active-active DR, use a canary deployment strategy to validate both regions.
**Performance and Service Level Agreements (SLAs)**
Some performance degradation may occur because the DR region may be farther from end users or backend systems than the primary region. Define and communicate a DR SLA to stakeholders.
**Recovery Mode Behavior (Contextual Note)**
In active-active mode, failover from the primary region to the DR region’s private space is fast: the global load balancer detects that the primary is unhealthy and routes traffic to the healthy (DR) region. In active-passive mode, you must deploy the application to the DR region private space when a disaster occurs.
## Regional Availability Options
There are 3 options to achieve a higher DR level availability:
[**Active-Active Configuration**](https://docs.mulesoft.com/cloudhub-2/ch2-ha-dr#use-case-1-active-active-configuration)
An active-active setup is based on active workers distributed across regions, using an External Load Balancer to route traffic between the two instances.
[**Warm Standby Configuration**](https://docs.mulesoft.com/cloudhub-2/ch2-ha-dr#use-case-2-warm-standby-configuration)
An active-passive setup would be based on an active worker in one region and a passive worker in another region. The Passive Region would be started when needed.
Some elements of the passive region must remain active for failover or be set up beforehand, including private spaces, VPNs and transit gateway attachments.
[**Cold Standby Configuration**](https://docs.mulesoft.com/cloudhub-2/ch2-ha-dr#use-case-3-cold-standby-configuration)
As above, replicas and Ingress controllers are provisioned in a second region via a fully automated DevOps process upon failover. Some elements of the passive region need to remain active for failover, including private spaces, VPNs and Transit Gateway Attachments.
## Vanity Domains for High Availability
The basic components of the CloudHub 2.0 networking architecture are:
- An HTTP load balancer
- Mule replica DNS records
- Private spaces
- Regional services
For more details, see [CloudHub 2.0 Networking Architecture](https://docs.mulesoft.com/cloudhub-2/ch2-networking-guide).
**Vanity Domains**
When a Private Space is created, it receives a DNS target name in the format: \.\.cloudhub.io . On deployment of an app named test-api in that Private Space, its endpoint will follow this format:
CloudHub 2.0 also supports custom, or vanity, domains by configuring them within a Private Space using TLS contexts and DNS records. To create a TLS context in Runtime Manager for a Private Space, upload the public certificate and private key, then add a custom endpoint in your application's settings to use that domain. Create a DNS record (such as a CNAME) that points your vanity domain to your private space's default hostname.
For example, an application named test-api deployed in us-west-2 with default DNS 42y52r.usa-w2.cloudhub.io has an API endpoint of:
https://test-api-mwsklu-42y52r.usa-w2.cloudhub.io
This URL does not use a vanity or custom domain. To use `acme.com` so that API URLs appear as `https://test-api.acme.com`, follow these steps.
1. Create TLS Context in Runtime Manager with public and private keys.
2. Add a vanity domain in the application's settings to use that domain.
3. Create a DNS record in AWS Route 53 and configure a simple routing policy (for example, CNAME) so that the vanity domain resolves to the private space’s default hostname.
For custom domains, you can use AWS Route 53 or any other global CDN services with routing policies. In the diagram below, AWS Route 53 is used with “simple” routing policy. When a consumer from a public (external) network requests acme.com, AWS Route 53 routes the request to the MuleSoft private space ingress controller.
## Failover Strategy
Use this option when applications require failover: deploy one instance in the primary region (for example, us-west-2) and another in a secondary region (for example, us-east-1).
Use an existing environment in the secondary region when possible; creating a new environment requires additional effort.
**Example of Apps Deployed in one region (US West 2\) with a failover to another region ( US East 1\)**
| Record Name | Value/Route Traffic To | Routing Policy | Health Check ID |
| :---------: | :-----------------------: | :------------: | :-------------: |
| acme.com | 42y52r.usa-w2.cloudhub.io | Failover | 31s3wseq121 |
| acme.com | 31e51s.usa-e1.cloudhub.io | Failover | 43e131s131sq |
In this configuration, AWS Route 53 routes traffic to the ingress controllers for the private spaces in US West 2 and US East 1\. A failover routing policy is configured with a health check.
## High Availability and Low Latency
For lower latency along with high availability, use the deployment strategy described in the diagram. With this strategy, apps can be deployed in two regions (us-west-2 and us-east-1 in this example).
Use the latency routing policy in AWS Route 53 to route requests to the region that offers the lowest latency while retaining high availability. “latency” routing policy in AWS Route 53 to route the request for lower latency still having high availability.
**Apps Deployed in both region (US West 2 and US East 1\) for lower latency and high availability**
| Record Name | Value/ Route Traffic To | Routing Policy | Health Check ID |
| :---------: | :-----------------------: | :------------: | :-------------: |
| acme.com | 42y52r.usa-w2.cloudhub.io | Latency | 31s3wseq121 |
| acme.com | 31e51s.usa-e1.cloudhub.io | Latency | 43e131s131sq |
## Conclusion
MuleSoft CloudHub 2.0 provides a robust foundation for intra-region resilience, primarily leveraging automated replica redundancy and intelligent load balancing. Within a single cloud region, deploying applications with multiple replicas ensures that if one instance fails, others can immediately take over the workload. The integrated load balancer efficiently distributes incoming traffic across these healthy replicas, minimizing downtime and ensuring continuous service availability under normal operating conditions.
However, relying exclusively on this single-region architecture, even one with high redundancy, presents a significant risk of a widespread, catastrophic regional outage. History has shown that even the most highly reliable and technologically advanced cloud providers are susceptible to disruptive incidents that can affect an entire geographical region. These single points of failure, though rare, can arise from various events, including:
- Large-scale infrastructure incidents
- Major power failures
- Widespread network interruptions
Therefore, to achieve true high availability (HA) and disaster recovery (DR), an architecture must be designed to transcend the limitations of a single-region model. The recommended strategy is deployment across multiple, geographically distinct regions. This inter-region resilience ensures that if an entire cloud region becomes unavailable due to an unexpected disaster, traffic can be seamlessly failed over to an application instance running in a separate, unaffected region, guaranteeing minimal service disruption and achieving maximum uptime goals.
## References
[CloudHub 2.0 Networking Architecture](https://docs.mulesoft.com/cloudhub-2/ch2-networking-guide)
[Configuring Cross-Region Failover for Standard Queues](https://docs.mulesoft.com/mq/mq-failover)
[Object Store V2 Deployment Regions](https://docs.mulesoft.com/object-store/osv2-faq#osv2-regions)
[Your Object Store Deployment Region](https://docs.mulesoft.com/object-store/osv2-faq#is-object-store-v2-persistent-in-the-same-region-as-the-worker)
## About the Authors
Gulal Kumar is a Software Engineering Architect at Salesforce, with a focus on data and integration architecture. With over 20 years of experience in integration and APIs, modernization programs, security, and AIML initiatives, he brings a wealth of expertise. Gulal has been committed to advancing business transformation initiatives, enhancing security and resiliency, promoting architecture excellence, and leading AIML initiatives across various domains.
Ajay Nagaraju is an Enterprise Architect and Senior Director at MuleSoft with over 28 years of experience in enterprise architecture, system integration, and large-scale digital transformation. He has led architecture and delivery for complex, multi-million-dollar programs across Fortune 100 and Fortune 500 organizations, with deep expertise in API-led connectivity, SOA, cloud technologies, and enterprise integration patterns. Ajay has partnered closely with executive leadership to modernize business processes, data platforms, and integration ecosystems and is passionate about building scalable architectures, mentoring teams, and driving measurable business outcomes through technology.
# Data 360 Architecture
## Overview
Data platforms have been evolving for over three decades. Initially, the industry was dominated by on-premise, centralized, and structured (mostly relational), operational OLTP (online transaction processing) databases. The landscape then expanded to include data warehouses: OLAP (online analytical processing) / Big Data platforms that remained relational and centralized. Cloud storage drove distributed architectures like lakehouses and disaggregated storage. However, operations platforms and analytical platforms stayed separate. Today, cloud computing and the AI revolution are fundamentally changing the data platform architecture.
Enterprises already invest in mature Big Data platforms like Snowflake, Databricks, BigQuery, and Redshift. These platforms create data silos. Enterprises don’t derive business value from this data, because they can’t act directly on the data via business flows and applications. These platforms lack agentic AI processing and can't deliver data access in real time, so they're unable to deliver AI-driven personalization at the moment of customer engagement.
Future data platforms will be characterized by unified, flexible, accessible, and open data infrastructure. At the heart of Salesforce AIforce — a new architecture that opens every layer of the platform (data, business logic, orchestration, and engagement) to any agent, model, or tool — sits Data 360, the System of Context. Built on modern compute and storage capabilities — GPUs, large memory, NVMe SSDs, and cloud storage — this architecture integrates directly with cloud computing and AI. It delivers real-time insights, powers autonomous decision-making, and drives real-time applications. This architecture supports agentic AI, predictive AI, analytics, real-time high-scale OLTP databases, data lakes, and lakehouses. These modern data platforms are designed for simplicity, scalability, agility, performance, security, availability, and cost efficiency.
### Key Trends in Next-Generation Data Platform Architecture
The following data trends drive the next-generation data platform architecture.
- **AI, Machine Learning, and Analytics at the core**: Agentic AI understands conversation/query intent and can plan, generate workflows, and automate decision making. Short- and long-term agentic memory is constructed from conversation history, personalizing agent planning, decisions, and real-time conversation modeling. Agents assist in automating operational capabilities like data governance (security, compliance, trust), performance (auto scaling for concurrency, throughput, and latency), failover and availability, and observability and maintenance. Standard capabilities include AI-powered analytics, forecasting, analytics on unstructured data (PDFs, images, audio, video), and natural language processing (NLP), which enables users to ask questions in plain language, receive contextual follow-up clarifications, drill down into results interactively, and get explainable, citation-backed answers grounded in live data. AI Models (formerly Einstein Studio) is a simplified, centralized experience for building and managing machine learning models. New built-in AI functions including Forecasting, Clustering, Sentiment Detection, Text Classification, and Multiclass Classification are now available directly in the Data 360 data processing engine, accessible from DCSQL, Batch Data Transforms, and Flow.
- **Headless and API-First Architectures:** Agentic applications increasingly require programmatic access to data and orchestration. Data 360 now supports Hosted MCP Servers (Model Context Protocol), enabling tools like Claude, Cursor, and Databricks to connect natively — no browser required.
- **Decentralization of Data but Unified Data Access**: Agents need enterprise data to derive insights, to make decisions, and to automate business activities, but that data is inherently decentralized in enterprises across disparate applications and data platforms. Unifying data involves:
- **Data Sharing** — via ingestion or federation
- **Data Preparation** — harmonizing raw data and modeling it for analytical and AI processing
- **Storage & Management** — managing data at scale for efficient access with low cost to serve (CTS)
- **Data Access** — via query and analytics mechanisms and tools that are deeply integrated with the underlying storage and data access platforms
- **Cloud-based Open Lakehouses**: Cloud-based Big Data (OLAP) platforms are converging on adopting open file formats (for example, Parquet) and table formats (for example, Iceberg), enabling data federation (“data in”) and sharing (“data out”).
- **Unstructured Data Processing**: With the emergence of generative AI, enterprises are beginning to extract valuable insights from the enterprise corpus of data that constitutes large volumes of text documents, audio transcripts, video recordings, and other media. Unstructured data processing (including chunking, vectorization, semantic search, and knowledge graphs) makes these insights possible. Retrieval augmented generation (RAG) retrieves relevant data at query time to ground agent responses in enterprise context; cache augmented generation (CAG) reuses precomputed context to reduce latency on repeated queries. Together, they power fast, agentic search. Visual data in RAG now allows agents to extract insights from diagrams and flowcharts embedded in documents using LLM and Docling image processing.
- **Knowledge Management**: Knowledge goes beyond the raw content itself (documents, articles, videos). It includes augmentation of that content by deriving meaning, curating metadata, and placing it in context to develop a shared understanding of content across an organization or enterprise. Knowledge management includes content management, knowledge extraction, graph-based representation, and navigation.
- **Rich Data Access**: Data, analytics, and AI tools must be accessible to a variety of personas, including end users, business users, admins, and analysts. Accessibility requires mechanisms such as ensemble querying (with relational, keyword, and semantic query), natural language to SQL (NL2SQL) querying, and real-time access. AI Functions in SQL run sentiment analysis and classification directly in SQL within Data 360, bridging structured querying and AI-powered enrichment.
- **Real-Time Processing**: Agentic applications make real-time decisions based on current state and new events, personalizing responses and actions on the fly. This requires the underlying data platform to support up-to-date data access from both operational and analytical stores, with low latency (point lookups and queries), high data scale, and high throughput.
- **Data Security, Governance, and Residency**: The valuable customer and personal data that's stored and modeled for agentic applications must be secured and governed with well-defined access and sharing policies. Increasingly, customers must comply with regulations that require data residency in their own country or region, especially those *in* government or *working with* governments. Data 360 now supports Platform Encryption with Bring Your Own Key (BYOK), giving enterprises full control over their encryption keys.
Salesforce Data 360 is designed for the future, to address these data trends. Data 360 is a cloud-native, metadata-driven data platform that unifies siloed data across the enterprise, allowing companies to store, model, and process their data.
This document is a guide for enterprise architects and CTOs. It details the architecture, capabilities, design principles, and use cases of Data 360. It introduces the fundamentals of the Data 360 architecture as a primer, followed by a series of deep dives into its key differentiators such as interoperability with existing data platforms, including multi-org strategy, security, governance and privacy, real-time activation, and data clean rooms.
## Design Principles
Salesforce Data 360 is built on a core set of principles that make enterprise data operational, trusted, and real-time.
- **Openness and Interoperability**: Built for multi-cloud ecosystems. Federates with major cloud data platforms without duplication, extending Customer 360 while preserving existing investments. Supports Hosted MCP Servers enabling headless, API-first integration.
- **Storage-Compute Separation**: Scales storage and processing (batch, streaming, and interactive) independently. Delivers elasticity and efficiency for high-volume, high-performance workloads.
- **Multi-Model Storage and Processing**: Supports both structured and various unstructured data types like text, image, audio, and video. Provides efficient storage, real-time and batch processing, extensible indexing, unified search, querying and analysis.
- **Metadata-Driven Design**: Applications are defined by metadata instead of by code. Metadata is treated as a first-class asset, enabling unified governance, flexibility, and deep integration into the Salesforce platform.
- **Real-Time Hybrid Processing**: Allows you to simultaneously query and unify data from both ingested sources and zero-copy federated sources in real-time. This enables you to create Unified Individual profiles, segments, and activations by combining operational data with large-scale historical or analytical datasets, optimizing for both performance and cost.
- **Intelligent and Active Data**: Continuously ingests, analyzes, and pushes insights directly into business workflows. Powers no-code, low-code, pro-code and AI-driven automation with the most current context.
- **Governance and Privacy by Design**: Lineage, access control, residency, data encryption, audit trail, and compliance are built in. Trust and regulatory confidence are reinforced at every layer.
- **One-to-Many Tenancy**: A centralized Data 360 Org is the Single Source of Truth (SSOT) for Customer 360, seamlessly supporting multi-org Salesforce environments.
- **Cloud Provider Abstraction**: The complexity of underlying cloud environments is entirely hidden from client services, allowing them to focus purely on business logic. This principle provides a consistent API and operational experience regardless of the backend cloud substrate — enabling Data 360 to run across AWS, Azure, and GCP without exposing infrastructure details to users or applications.
These principles ensure that Data 360 makes data open, intelligent, and actionable in real time.
### Platform Capabilities
Salesforce Data 360 is a modern data platform built on design principles that address current data trends. Its architecture capabilities ensure that enterprise data is trusted, unified, and actionable in real time, aligning with its guiding principles.
- **Cloud-Native Foundation**: Salesforce Data 360 runs on Hyperforce, deployed on Hyperscalers (like AWS), with an immutable, microservices-based infrastructure. It provides elastic scaling, continuous delivery, and global compliance.
- **Salesforce (Core) Metadata-Driven**: Metadata is designed, modeled, and stored as Salesforce metadata, enabling immediate use by all Salesforce applications. It's stored in a fully ACID-compliant RDBMS. This metadata ensures governance, lifecycle consistency, and deep integration with Salesforce Lightning Platform.
- **Lakehouse Storage**: Built on Apache Iceberg and Parquet, this storage combines data lake scale with warehouse governance supporting schema evolution, time travel, and high-volume updates. Data 360 stores, models, and processes structured and unstructured data with extreme-scale storage with modern, open standards, and with rich transformation and data processing capabilities for batch and event-driven workloads.
- **End-to-End Data Pipeline with Flexible Ingestion**: Covers the full lifecycle—ingest, prepare, model, unify, analyze, and activate—reducing reliance on fragmented point solutions. Supports batch, near real-time, and streaming with 270+ connectors for common use cases, and MuleSoft for custom use cases. ELT-first approach enables fast data availability with downstream transformation flexibility.
- **Enterprise Data Interoperability with Open frameworks and Federation**: Unifies siloed data across the enterprise with bidirectional, zero-copy federation with Snowflake, Databricks, BigQuery, and Redshift, avoiding data migration or duplication.
- **Data Classification, Modeling, and Organization**: Data 360 organizes data as raw ingested data, cleaned and stored data, and data modeled conforming to a common information schema known as single source of truth (SSOT). SSOT objects form the basis for defining Semantic Data Models (SDM) and other curated and application-specific models.
- **Built-in Semantic Data Modeling:** A business-friendly abstraction layer that maps raw data to business concepts (customers, revenue, engagement scores), enabling both human analysts in Tableau Next and Agentforce agents to query data using natural language and consistent definitions. This open semantic query API layer powers application-specific analytics while allowing Agentforce agents to autonomously discover, understand, and act on unified enterprise data by reasoning about business terms.
- **High Performance SQL query engine:** Supports unified Data 360 SQL queries across structured, unstructured, and graph data.
- **Low-Latency Data Stores**: Key-value storage for hot data with millisecond response times, powering personalization and event-driven scenarios. Unifies identities, interactions, and conversations into a single, trusted unified individual profile and context graph.
- **Data 360 Sandboxes:** Data 360 supports full sandbox environments for building, testing, and deploying configurations with confidence. This includes Data Kit deployment across data spaces and migration of configurations from Sandbox to Production via CLI and APIs.
- **Unstructured Data Processing Pipelines** provide flexible and extensible support for unstructured data. These pipelines handle storage, chunking, embedding generation (vectorization), metadata extraction and augmentation, summarization, indexing, knowledge extraction, intelligent document processing, and both short-term and long-term conversation memory.
- **Native Keyword, Vector, and Hybrid Indexing** for accurate and efficient unstructured data access like fast and agentic search, RAG, knowledge extraction, and agentic memory derivation.
- **Profile, Personalization, Context services** for enabling AI/ML and agentic applications.
- **Built-in governance and security** at every layer for lineage tracking, data masking, data residency, auditing, and zero-trust security to provide compliance and trust.
- **Elastic Compute Fabric**: Kubernetes-native, multi-tenant compute fabric. Runs Spark for distributed processing and Hyper for SQL workloads. Scales elastically across diverse jobs and supports isolation for running untrusted code.
All of this runs on Hyperforce, Salesforce’s cloud foundation. Hyperforce provides:
- **Zero-trust security** with encryption, isolation, and least-privilege policies.
- **Resilience** through multi-AZ deployments and platform-level fault tolerance. Enterprise-grade disaster recovery builds on this with replayable ingestion pipelines, replication, and metadata-driven rehydration across dependent ecosystems.
- **Data Residency** through provisioning each org into a customer-selected country, keeping stored data in-region.
- **Observability** with monitoring, metrics, and tracing built in.
- **Automated scale and FinOps awareness** for efficiency without cost overflow.
Data 360 does not replace existing enterprise investments. Instead, Data 360 makes the data you already have trusted, governed, and actionable—delivering real-time, AI-driven engagement where it matters most.
The following figure illustrates the Data 360 Reference Architecture:

Let’s consider a hypothetical Agentforce Loan Agent layered on Data 360 to describe an example architecture flow. Say the Loan Agent is a customer-facing agent where customers (consumers) apply for loans and get instant loan approvals.
Data 360 performs these steps as scheduled, preparing data for use by the Loan Agent.
1. Data 360 ingests structured Customer Account data from CRM and stores it in the data lake.
2. Data 360 processes unstructured company loan and financial policy data.
3. Data 360 federates personal data from external data platforms and warehouses such as Snowflake, BigQuery, and Databricks.
4. Data 360 transforms and models ingested and federated data.
5. Data 360 builds and maintains the profile data graph.
Each time a customer applies for a loan, these actions are performed.
1. A customer signs into the Loan Agent, which begins a customer session in the real-time layer. The customer’s unified profile is pulled into the real-time layer from the ingested CRM data and zero copy from the data warehouse.
2. The customer completes a loan application by providing the required information.
3. The customer uploads financial documents (like tax returns, investments, bank statements) to Data 360 for unstructured data processing.
4. Uploaded data is chunked and vectorized (embedding generation), and indexes (keyword and vector) are created.
5. Next, the customer fills out the loan application document and uploads it. Data 360 extracts the loan amount and duration in real time.
6. The Loan Agent retrieves relevant financial data using Data 360 query and hybrid search over profile and other pre-created indexes.
7. The Loan Agent activates an Approval Agent with loan data and other financial profile data to make the loan approval decision.
8. The Loan Agent responds to the customer with a decision.
9. This entire interaction between the customer and the Loan Agent is also captured and stored in Data 360.
The above example provides an overview of Data 360 architecture components used to build an agentic application like a Loan Agent. In the next section we describe the Data 360 architecture layers and components.
## Data 360 Architecture
This section covers the building blocks of Salesforce Data 360, starting with its storage model and the mechanisms for connecting, ingesting, and preparing data. It then examines how structured and unstructured data is stored, modeled, and processed, then harmonized, unified, retrieved, and activated.

Data 360 is the foundation layer — the System of Context — in the AIforce architecture, serving every agentic, analytics, and AI workload on the Salesforce platform.
### Data 360 Storage
Salesforce Data 360 uses a tiered but integrated storage model that combines the strengths of a lakehouse with real-time storage. The lakehouse layer provides scalable, cost-efficient storage for large volumes of historical and batch data, enabling advanced analytics and machine learning use cases. Real-time storage, on the other hand, handles low-latency access and high-frequency updates, ensuring that customer interactions, profiles, and engagement signals are always current. Together, these tiers allow data to move fluidly between historical and real-time contexts—delivering both depth and immediacy in a unified data foundation for personalization, AI, and activation.
#### Data Encryption
Data 360 encrypts data at rest, with support for customer-managed keys via Salesforce Shield Platform Encryption. See the Data 360 Encryption: Bring Your Own Key (BYOK) section for details.
#### Lakehouse
Data 360 features a native lakehouse architecture based on Iceberg/Parquet, designed to handle large-scale data management and processing for batch, streaming, and real-time scenarios across both structured and unstructured data for AI and analytics applications.
In cloud-based data lakes like Azure, AWS, or GCP, the fundamental storage unit is a file, typically organized into folders and hierarchies. Lakehouse enhances this structure by introducing higher-level structural and semantic abstractions to facilitate operations like querying and AI/ML processing. The primary abstraction is a table with metadata that defines its structure and semantics, incorporating elements from open-source projects like Iceberg or Delta Lake, with additional semantic layers added by Data 360.
Data 360 Lakehouse supports B2C scale, real-time ingestion, processing, schema enforcement and evolution, snapshots, and uses open storage formats.

Abstraction Layers in Lakehouse:
1. **Parquet File Abstraction**: At the base, storage consists of data lake files (for example S3 in AWS or Blob in Azure) in Parquet format. Data for a source table is stored across multiple partitions as Parquet files, with each table being a collection of these files.
2. **Iceberg Table Abstraction**: Tables are organized as folders, with data partitions stored as Parquet files within these folders. Modifications to a partition result in new Parquet files as snapshots. Iceberg manages a metadata file for each table, detailing schemas, partition specs, and snapshots.
#### Real-Time Storage
To support real-time analytics and agentic applications, Data 360 augments the Lakehouse big data storage with Low Latency Store. Data 360 Real-Time Layer processes real-time signals and engagement data in memory. However, since the memory-based storage capacity is limited, all data cannot fit and processing may not be done in real-time. Data 360 adds a low latency store to remove such limitations, enabling scalable real-time processing.
The low latency store is a petabyte scale multi-availability zone cluster of NVMe (SSD) instances on the Lakehouse. Not all data needs to be kept in the low latency store. It is a durable cache. Most data eventually makes it to the Lakehouse for long term persistence. In-session data in the real-time layer can be flushed to the low latency store for subsequent fast access. For example, in an agentic conversation, recent messages can be processed in memory; older messages can be flushed to the low latency store. If a previous conversation is required, it can be accessed within a few milliseconds from the low latency store. NVMe based storage allows for large amounts of data to be stored and accessed at millisecond latencies.
In addition, data from Lakehouse that is required for real-time processing or to augment real-time experiences is fetched and kept in the low latency store. For example, customer Profile Context is pre-fetched or brought from the Lakehouse and cached in the low latency store. Also, any lakehouse objects and other objects that are required for real-time processing during in-session processing can also be cached in the low latency store.
The low latency store supports both Data Graph APIs (create/update/lookup Data Graphs) and session stores for the real-time layer. This creates a true three-tier storage hierarchy: Memory → NVMe SSD → Lakehouse Cloud Storage.
### Data Organization
Salesforce Data 360 is engineered to standardize, harmonize, and activate all customer data — structured and unstructured — following a rigorous lifecycle that transforms raw input into a unified, current data model. Data 360's data organization model ensures every AI agent, model, and tool operates against governed, semantically consistent data.
#### Raw Ingested Data and Initial Transformations
The lifecycle begins with raw data ingested as-is from source systems — including CRM, Marketing platforms, files, and other external inputs. Data 360 handles both full data loads and continuous change events (deltas), merging incoming updates with persisted data to maintain an always-current state. To establish a baseline level of data quality from the outset, inline transformations — such as trimming whitespace, normalizing values, and field concatenation — are applied immediately during ingestion. These operations ensure data meets a minimum cleanliness standard before any deeper processing or modeling.
#### Data Lake Objects (DLOs): The Persistent Layer
Data Lake Objects (DLOs) form the core persistent storage layer within Data 360 — the long-term repository for all customer information, regardless of origin. They store clean, transformed data from ingestion, federation, and processing pipelines in a consistent, queryable, and governable form, giving downstream harmonization, analytics, and AI workloads a stable foundation to build on.
Data 360 organizes DLOs into three distinct types, each designed to capture a different category of customer data:
- **Engagement DLOs** capture behavioral and interaction data — such as clicks, transactions, campaign responses, and other signals generated through customer touchpoints. These objects provide the time-series activity history that powers segmentation, journey analytics, and real-time personalization.
- **Profile DLOs** store core identity and attribute data about individuals and accounts — including demographic information, preferences, and relationship data sourced from CRM and other systems of record. Profile DLOs form the backbone of unified customer identity within Data 360.
- **Other DLOs** accommodate reference data, lookup tables, and supplementary datasets that support enrichment and context — such as product catalogs, geographic hierarchies, or third-party data assets that augment the core customer model.
Beyond ingested source data, advanced transformations — including joins, aggregations, and calculated insights — can be applied to source DLOs to produce derived DLOs: highly curated datasets tailored for specific analytics, AI, or activation use cases. Data made available through Zero Copy Data Federation is also represented directly as DLOs, allowing externally managed data to participate in the same unified model without duplication.
**Unstructured Data** Not all customer-relevant data arrives in structured form. For unstructured content (such as text, media, and documents), Data 360 incorporates this data by extracting and persisting its structured metadata within specialized objects called Unstructured Data Lake Objects (UDLOs). These objects function as directory tables, providing a map to the physical location and context of unstructured assets. This allows architects to relate unstructured metadata with the rest of the structured customer data model, enabling unified querying and harmonization across content types.
UDLOs can be related to structured DMOs via standard foreign keys, enabling agents to retrieve both structured profile context and unstructured document context in a single unified query — valuable for agentic and generative AI applications that reason across diverse data types.
#### Data Model Objects (DMOs): The Harmonized Layer
At the heart of Data 360's data architecture is the Data Model Object (DMO) layer — the final, harmonized, and structured representation of customer data. DMOs provide a consistent, platform-native view of customer information by mapping raw and processed data from Data Lake Objects (DLOs) — including source, derived, and unstructured metadata DLOs — to the standard Customer 360 Data Model. This harmonization step is what transforms disparate, multi-source data into a coherent, unified foundation that the rest of the platform can reliably build upon.
The DMO layer is the single source of truth (SSOT) for all customer data, enabling unified profile creation, segmentation, and activation across the broader Salesforce ecosystem. DMOs ensure that every product and team operates from the same consistent, well-structured model — reducing ambiguity and increasing confidence in the data powering decisions and experiences.
Standard DMOs are defined as Schema Interfaces built directly into the platform. As standard objects evolve across Salesforce releases, DMOs automatically update to reflect those changes — keeping the harmonized layer current without manual intervention. Both custom and standard DMOs point to the same underlying DLO, so existing reports and analytics continue to work without disruption.
Analytics and reporting can be built on standard DMOs for generative AI audit and feedback use cases across Tableau Next and other Salesforce products. To further reduce the complexity of setting up and maintaining this layer, Data 360 includes an ML-driven Auto Mapping feature that recommends appropriate DMOs and field-level mappings for selected DLOs. The pre-trained MPNet model considers field names, synonyms, and data type compatibility — reducing manual mapping effort and helping prevent incorrect DMO selection.
#### Data Space: The Logical Container
A data space is the fundamental logical container for organizing all data and metadata within Data 360, including all DLOs (structured and unstructured) and DMOs. Data spaces offer a secure, isolated environment for data processing and modeling.
Data spaces act as logical and governance boundaries, enabling internal multitenancy by separating data for distinct entities such as business units, regions, or brands while maintaining enterprise-wide visibility, lineage, and compliance. They also serve as the basis for defining coarse-grained access control. For example, a large enterprise may create a separate data space for each subsidiary company within the Salesforce org.
Isolation within data spaces is enforced at multiple layers of the platform:
- **Data-level isolation**: Each DLO/DMO belongs to a single data space, meaning that queries, transformations, and object mappings cannot cross data space boundaries unless explicitly authorized.
- **Access control integration**: Permission sets are natively tied to data spaces, allowing control over read, write, and administrative operations. These controls ensure that only authorized users and services can access objects, insights, and activations within a data space.
- **Governance and audit**: All operations within a data space are logged with enterprise-grade audit trails, enabling traceability for compliance, stewardship, and regulatory reporting.
By integrating data space boundaries with Data 360’s security and governance architecture, architects can confidently implement both centralized and decentralized governance strategies while maintaining consistency across multiple clouds and business domains.
#### Compute Fabric
Data 360 compute fabric provides a unified layer for managing and executing all big data workloads, simplifying underlying infrastructure complexities. It offers a unified, cloud-agnostic interface for submitting and managing data jobs, so teams work through a single Data 360 API without managing the underlying cloud infrastructure. It also provides built-in resilience — automatic failure handling, retries, and dynamic load balancing — so workloads run reliably without manual intervention.
The compute fabric provides strong security — TLS, PKI, IAM isolation, and automated patching — and supports multitenancy, enforcing Data 360 tenancy boundaries and resource separation. It ensures security and compliance by enforcing Salesforce-certified machine images, managing service-specific IAM roles, and guaranteeing encryption both in transit and at rest.
The compute fabric also enables easy usage and cost tracking, allowing cluster utilization and costs to be segmented by service for accurate accounting. Data 360 now supports custom tagging in the Digital Wallet, enabling teams to tag and track compute usage by service, team, use case, or data space — making cost attribution and chargeback models more granular and accurate.
### Data Processing in Data 360: From Raw to Actionable
Data 360 refines and enriches raw data, complementing the data object lifecycle by preparing complex data for activation and analysis. Data 360 supports various processing types, including Batch and Streaming Data Transforms, Batch and Streaming Calculated Insights, Unstructured Data Processing, and Identity Resolution. The processing layer keeps AI agent interactions trustworthy, ensuring agents operate on governed, incrementally fresh data. To enable these diverse operations efficiently, especially in near real-time and across massive datasets, a sophisticated mechanism is required to handle data changes effectively.
#### Powering Incremental Processing
To achieve efficient, near real-time processing on terabyte-scale tables with millions of potential updates, Data 360 needs to know precisely when data changes and then process only what changed. It does this with two complementary mechanisms: native change notifications that signal when something has changed, and snapshot-based change extraction that identifies exactly what changed. This matters for more than performance; it is foundational to agentic AI correctness. Identity resolution run on stale data, or segments evaluated against out-of-date profiles, produce incorrect agent actions. Reacting to changes as they commit, rather than polling potentially stale tables, keeps agents working from the latest state of enterprise data.
This shifts the platform from actively polling the data lake to passively reacting to atomic commit events, using a standardized event format and a high-throughput delivery system. Every successful write (INSERT, UPDATE, DELETE) to an Iceberg table ends in an atomic swap of the table's current metadata pointer in the catalog. Data 360 configures the underlying object storage layer to emit a native notification whenever a new metadata snapshot is written to the table's directory.

A standardized client library consumes these notifications and can enrich them with snapshot metadata on request.
This lets downstream pipelines (streaming calculated insights, identity resolution, and segmentation) subscribe and act only when data has changed, avoiding costly full-table scans. This native-notification path applies to data ingested into Data 360's managed lakehouse.
To process those changes efficiently, Data 360 uses Iceberg snapshots to generate the stream of changed records directly, so streaming transforms and streaming calculated insights process only the altered rows instead of running an expensive snapshot diff. For large datasets this lowers cost and latency, and enables incremental identity resolution. Real-Time Insights can also reference non-real-time DMO fields, so not every upstream object has to be real-time, broadening the scope of streaming analytics.
### Connect, Ingest, and Prepare
Data 360 provides native ingestion support for Salesforce products. For external sources, it provides extensive connectivity through over 270 connectors, APIs, SDKs, and MuleSoft. Data 360 features zero-copy federation, enabling BI and analytics without data duplication. Additionally, a new Connector Hub makes browsing and searching for all Data 360 connectors easier.
#### Data 360 Connector Framework
The Data 360 connector framework (DCF) is the foundation for Data 360 connectivity. It enables ingestion, federation, and egress through a unified architecture. DCF defines the standards for building and managing connectors, from the UI for setup and administration to metadata persistence, data extraction, and delivery into the Lakehouse or via live queries against external sources. It also supports private connectivity options (such as private links, VPNs, and secure tunnels) to ensure enterprise-grade data security and compliance when connecting to customer or partner environments. By providing a consistent approach across all connectors, DCF empowers Data 360 to connect to the broader ecosystem — ensuring extensibility, reliability, and secure integration across all connector types: ingestion (batch), federation (zero-copy), and egress/activation.
#### Data 360 Connectors
Data 360 provides connectivity to a vast ecosystem of data sources, supporting both native Salesforce products and numerous external systems. This connectivity unifies siloed enterprise data and enables AI/ML, advanced analytics, real-time user activations, and agentic applications.
Data 360 offers over 270 connectors natively or through MuleSoft, APIs, and SDKs to support its end-to-end data pipeline capabilities with batch, streaming, or real-time ingestion. These connectors can be broadly categorized by the type of source system they integrate.
**Salesforce Native Connectors**
These connectors provide native data flow from Salesforce products. Examples include connectors for Salesforce CRM, Data Cloud One, Marketing Cloud Engagement, Marketing Cloud Account Engagement, and B2C Commerce. The CRM Connector is the primary bridge from the CRM system of record, supporting both full loads and incremental change capture so the data layer continuously reflects the current state of CRM. For the detailed CRM ingestion patterns and stream customization, see the dedicated [Data 360 Integration Patterns guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360_integration_patterns_and_practices.html#bulk-data-ingestion-from-salesforce-clouds).
**External Applications and SaaS**
Connectors for various business applications and cloud services allow data ingestion from external software platforms.
Examples include Adobe Marketo Engage, Microsoft Dynamics 365, Mailchimp, Power BI, Microsoft Fabric and Airtable.
**Databases and Data Warehouses**
Data 360 connects to many relational and cloud-based data storage platforms.
Examples include Amazon Redshift, Amazon DynamoDB, Amazon RDS (MySQL, PostgreSQL, Oracle), Google BigQuery, Snowflake, and Microsoft SQL Server.
**Cloud Object Storage and File Systems**
These connectors integrate with hyperscaler storage solutions for both structured and unstructured data.
Examples include Amazon S3, Google Cloud Storage (GCS), and Azure Blob Storage.
**Streaming and Messaging Services**
Connectors that handle continuous, real-time data streams support event-driven scenarios and real-time processing.
Examples include the Amazon Kinesis Connector.
**Integration Platforms**
The MuleSoft Anypoint Connector extends Data 360's reach by integrating it with a wider range of applications and databases via the Anypoint Exchange.
**Unstructured Data Connectors**
These connectors support ingesting and referencing unstructured data — data that lacks a pre-defined model — to power capabilities including analytics, search, AI-driven automation, and generative AI applications. All of these connectors are built on the Data 360 Connector Framework, providing a consistent experience across setup, administration, and data delivery.
Examples include Box, YouTube, GitHub, Jira, Helpjuice, Adobe Experience Manager (AEM), Microsoft SharePoint, Google Drive, and web crawlers.
Paid-media and advertising-performance data (impressions, clicks, spend, conversions) reaches Data 360 through Marketing Intelligence, which is built natively on Data 360. Rather than a separate category of the Data 360 Connector Framework, these are licensed Marketing Intelligence connectors that land ad-platform data as standard Data 360 data streams and DLOs, mapped to a marketing-specific semantic data model.
#### Data Transforms
Data transformation in Data 360 cleans, enriches, and shapes raw ingested data into normalized, actionable data assets aligned with the Customer 360 data model. It supports data harmonization, quality improvement, and readiness for downstream use cases like profile unification, segmentation, and activation. Transformations use both source data lake objects (DLOs) and Data Model Objects (DMOs) as input, writing the results to new DLOs or DMOs, respectively.
Data 360 provides two primary transformation paradigms to address different data velocity requirements: batch data transforms and streaming data transforms.
##### Batch Data Transforms
Batch Data Transforms are designed for high-volume processing based on a defined schedule or on-demand trigger. This engine handles complex, resource-intensive restructuring operations.
The Batch Transform process is configured using a visual, low-code pipeline canvas that enables users to define multi-stage transformation logic. This engine supports complex restructuring operations for canonical data model alignment: data structuring and normalization. This includes pivoting (decomposing denormalized records into multiple normalized records) and flattening (restructuring hierarchical data, like JSON, into structured tables). The system’s execution mode supports both full synchronization (processing all records) and a highly efficient incremental processing mode. The incremental mode reduces processing time and resource consumption by only processing records that have changed since the last successful run. Batch transforms are ideal for tasks where real-time updates are not essential, such as periodic aggregations and complex data restructuring.
Data 360 lets you create Engagement DLOs and DMOs directly within the batch transform editor, eliminating the need to exit your workflow to manually set up targets. Data Transforms can now be deployed into any Data Space via Data Kits, enabling multi-data-space transform management from Sandbox to Production via CLI and APIs.
##### Streaming Data Transforms
Streaming data transforms process data continuously and incrementally in near real-time as it flows into the system, making them suited to low-latency use cases.
The primary interface is an SQL-first approach, where transformations are defined as a SQL SELECT query that continuously executes against the incoming stream of record changes. This engine supports core transformation functions, including data cleansing and standardization (for example, validating PII and standardizing data formats) and data enrichment and merging (using Joins and Unions). Transform results can be written directly to Engagement DMOs in streaming transform mode, enabling immediate persistence of processed engagement signals without additional pipeline steps. The engine also supports Real-Time Insights over non-real-time DMOs.
The engine supports Streaming Lookup JOINs to enable real-time data enrichment and lookups against static or slowly changing reference data, producing instant profile updates. Streaming transforms suit use cases like event monitoring, immediate personalization, and real-time profile updates.
### Zero Copy Data Federation and Data Sharing
Data 360 supports Zero Copy federation and data sharing, which eliminates the need to move or duplicate data. This capability lets users directly access data from external sources and share data with external environments, reducing complexity and storage costs while working from the freshest data.

#### Data Federation
Data 360 supports zero-copy federation with external data warehouses (Snowflake, Redshift), lakehouses (Google BigQuery, Databricks, Azure Fabric), SQL databases and many other sources. Its abstraction layers enable direct querying of external data without duplication, reducing ingestion time and storage costs while keeping information up to date.
Data 360 simplifies access to external and federated data by providing a unified metadata layer that abstracts both Salesforce and external objects. This layer enables the entire Salesforce platform and its applications to use this data.
Data 360 supports both file and query-based federation, with live query and access acceleration as shown in the figure. Labels (1) and (2) illustrate Data 360’s query (including live query pushdowns) and file-based federation for accessing data from external data lakes/warehouses/data sources; and label (3) highlights acceleration of federated access from external data lakes/data sources.
##### Query Federation
The core of Data 360’s federation capability lies in its query federation layer, which manages the complex process of accessing external data and performing intelligent query pushdowns (illustrated by label 1). Data 360 connects to and retrieves data from sources using the JDBC protocol, enhanced with additional logic for improved efficiency. The Query Federation Layer understands and translates different SQL dialects, figuring out the optimal part of the query to be pushed down to external systems for efficient processing, retrieving the results, and performing any necessary further processing to derive final insights.
Data 360 provides an optional acceleration feature for its federated capabilities. When acceleration is activated, Data 360 caches the federated data (illustrated by label 3) to achieve faster access and lower costs—as it avoids repeated, direct access to external sources. This cache is treated as an acceleration layer and is incrementally updated to quickly reflect any changes in the external source data, ensuring the accelerated view remains near real-time.
##### File Federation
Data 360 supports file-based federation (illustrated by label 2) for accessing data from external data lakes and sources. The technical basis for this zero-copy capability relies on standardization: the underlying data must be in the Apache Parquet file format and use the Apache Iceberg tabular format. Data 360 can federate into any source that exposes an Iceberg REST Catalog (IRC) for metadata and storage access, ensuring governed access to files residing outside the platform.
File Federation currently supports querying Iceberg V1 tables, while querying Iceberg V2 tables that use Merge-on-Read (row-level or equality deletes) is not currently supported; this includes many managed Iceberg tables from Snowflake and Databricks. This is an important architectural consideration for Zero Copy federation patterns involving managed Iceberg sources.
With file-based federation, Data 360’s compute framework handles all data processing because it directly accesses the underlying storage. This eliminates the need for query pushdown and managing various SQL dialects, which are required with query-based federation.
The File Federation capability also extends to unstructured data sources like hyperscaler storage solutions (S3/GCS/Azure storage), Slack and Google Drive, which can be accessed by Data 360’s unstructured processing pipelines.
#### Data Sharing
Data 360 facilitates both query-based and file-based sharing of data it manages with external data lakes and warehouses (labels 4 and 5).
##### Query-Based Sharing
For query-based data sharing, Data 360 exposes a JDBC driver by which external engines and applications can get secure access to the data. This mechanism allows external systems to connect, authenticate, and execute live queries directly against the data within Data 360.
##### File-Based Sharing (Data Share & DaaS)
The primary mechanism for file-based sharing involves two concepts: data share and data share target, which use the DaaS (Data as a Service) API.
- Granular Control: The data share concept allows customers to precisely define what objects (DLOs, DMOs, CIOs etc.) are shared externally, preventing unintended data exposure.
- Secure Targeting: It also controls the data share target, making sure that data is only available to explicitly authorized external environments, accounts, or partner organizations (for example, sharing with a specific Redshift or Databricks instance).
DaaS API provides a secure and governed interface for external engines to consume data. It grants access to both the essential metadata and the underlying table storage while preserving all the Data 360 semantics. This ensures external engines access the data in a consistent and meaningful context in a secure way.
### Private Connectivity
Many security-sensitive customers (regulated industries, public sector, large enterprises) block all public-internet access to their data lakes, which otherwise prevents Data 360 and Agentforce from reaching those environments. Because Data 360 runs on AWS, reaching a customer data lake on another hyperscaler requires a private, cross-cloud network path.
#### Private Links
On AWS, Data 360 connects to customer-managed sources (including third-party lakes such as Snowflake) through Private Connect for Data 360 (PC4DC), built on AWS PrivateLink, so traffic never traverses the public internet. PC4DC uses a **proxyless** architecture with a unique DNS per customer, deployed to a Data 360 functional domain (FD) for dedicated capacity and tenant isolation.
#### Private Interconnect
For multi-cloud customers, Private Connect Multicloud extends the same backbone-only, zero-internet-exposure path to data lakes in Azure or Google Cloud, under two deployment models:
- **Customer-Managed Interconnect**: integrate existing private circuits (Azure ExpressRoute, Google Cloud Interconnect, Equinix Fabric) directly with Data 360’s VPCs.
- **Salesforce-Managed Interconnect**: Salesforce provisions and operates the cross-cloud link via **Equinix Fabric Cloud Router (FCR)**, exposing private endpoints in the target cloud.
For the full private-connectivity framework (AWS PrivateLink specifics, compliance alignment such as ISO 27001/SOC 2/FedRAMP, and connector-by-connector support), see the dedicated [Data 360 Security Architecture guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360_security_architecture.html#securing-cross-cloud-data-access-the-private-connectivity-framework).
### Data Governance in Data 360
Salesforce Data 360 provides a governance framework spanning data quality, security, and adherence to regulatory mandates across the entire data lifecycle.
Data 360 adopts Attribute-Based Access Control (ABAC) as its core authorization model for fine-grained access, chosen over traditional Role-Based Access Control (RBAC) for the flexibility and scale that dynamic enterprise environments demand. Access decisions are evaluated at runtime from attributes of the user, the data (classification, sensitivity, data space), and the environment, rather than from pre-assigned roles alone. Policies are expressed in the CEDAR policy language and enforce object-, field-, and row-level security as well as dynamic data masking at the point of access. Automated LLM- and ML-driven tagging and classification (for example, PII.Email, PHI) propagate along data lineage (DLO → DLO → DMO), so sensitivity follows data through every transformation. Critically, this single ABAC framework enforces consistently across every consumption pattern (direct query, GenAI RAG retrieval, and CRM enrichment) and is administered natively with familiar Salesforce platform tools, avoiding a parallel governance stack.
For the full governance architecture (the Policy Information, Decision, and Enforcement Points, CEDAR policy authoring, and the tagging and classification pipeline), see the dedicated [Data 360 Security Architecture guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360_security_architecture.html#data-governance-in-data-360-the-foundation-of-trust-control-and-intelligence).
### Data 360 Encryption: Bring Your Own Key (BYOK)
Data 360 encrypts all data at rest with Salesforce-managed keys by default. For regulated enterprises, Platform Encryption for Data 360 adds customer-managed encryption (Customer-Managed Keys, CMK), where the customer controls the root key through one of two methods. With External Key Management (EKM), the root key stays in the customer’s own AWS KMS and Data 360 calls out to it; with Bring Your Own Key (BYOK), the customer uploads their own root key material directly into Salesforce. In both cases Data 360 still generates and wraps the underlying data encryption keys, and the customer-managed root key protects data at rest and search indexes. Because no party (including Salesforce) can decrypt the data without that root key, it stays cryptographically protected even against a platform-level breach.
For setup, key rotation and lifecycle, and the EKM-versus-BYOK trade-offs, see the dedicated [Data 360 Security Architecture guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360_security_architecture.html#foundation-of-protection-encryption-at-rest-and-in-transit).
### Data Residency and Regional Processing
Data 360 residency follows Hyperforce. Each org is provisioned into the Hyperforce region closest to the associated core Salesforce org, within a customer-selected country, and Data 360 runs on a subset of the [published Hyperforce regions](https://help.salesforce.com/s/articleView?id=000314281&type=1). Residency is set once, at provisioning, and is per-org: a single org's data resides in one region, and customers choose a country rather than a specific cloud region. Stored customer data remains in that region, with limited exceptions for operating the service (for example, support and operational access, Salesforce controller data that is not customer data, integrations to services not yet available on Hyperforce, and any movement the customer initiates).
Changing region is not an in-place operation. Data 360 cannot be migrated between regions; moving it requires de-provisioning and re-provisioning into the new region, effectively rebuilding the tenant. Data 360 also does not automatically follow its core org if that org is later migrated to a different region, so region alignment between CRM and Data 360 is an explicit provisioning concern rather than something that self-corrects. Cross-region replication, backup, and disaster recovery are provided through the Advanced Cross-Region Continuity add-on.
#### Regional Processing of AI and LLM Inference
Data-at-rest residency does not by itself guarantee that AI processing of that data stays in region. Einstein and Agentforce route generative-AI requests through geo-aware routing that prefers a model hosted in the org's own geography, but when the requested model is not available in region the request falls back to a region where that model is hosted (often the United States). The practical consequence is that an org whose stored data is pinned to, for example, an EU or Canadian region can still have prompts (and the grounding data sent with them) processed by a model hosted elsewhere, purely because the chosen model is not offered locally.
Architects designing for strict residency should treat per-region model availability as a first-class constraint, not an afterthought. Data 360 provides a Setup control that suppresses this final cross-region fallback: when it is enabled, a request that would otherwise route out of region returns an error instead, trading feature availability for a hard residency boundary. Coverage depends on the model provider, and the control prevents data from leaving rather than creating an in-region model where none exists. Where a stronger contractual boundary is required, the EU Operating Zone commits to keeping customer data within the EU, but satisfying that commitment with generative-AI features still depends on pinning to models that are actually hosted in region.
Finally, regional processing is distinct from the Einstein Trust Layer's data-handling guarantees. Zero data retention and prompt/response masking apply regardless of which region serves the request; they govern what a model provider may retain and see, not where the inference physically runs. Both matter for a residency assessment, but they answer different questions.
### Unstructured Data Storage and Processing
Data 360 supports storage and management of structured (tables), semi-structured (JSON), and unstructured data across data ingestion, processing, indexing, and query mechanisms. Data 360 supports unstructured data types beyond text, including audio, video, and images.
The image below illustrates the two sides of grounding (ingestion and retrieval).

Data 360 manages unstructured data by storing it in columns as text or in files for larger datasets. It supports data federation for unstructured content, which allows for the integration and management of data from multiple sources.
The data is then prepared and chunked, embeddings are generated, and both keyword and vector indexes are built. Data 360 hosts multiple out-of-the-box and pluggable models for chunking and embedding generation. Data 360 supports automated and configurable transcription of audio and video content for subsequent processing and indexing. The search service is used for keyword indexing. For vector indexing, Data 360 supports both native indexing (with Hyper) and dedicated vector databases. Data 360 also integrates with Salesforce Search platform to support keyword indexing on unstructured data. Such integrated multi-modal indexing in Data 360 powers search on any unstructured data, as discussed in the Agentforce Coworker section later in the document.
For retrieval, Data 360 provides APIs for search. The Hyper-based unified query facilitates ensemble queries across structured data, keyword indexes, and vector indexes, maintaining strict visibility and permissions, thus enhancing RAG and Search.
#### Extensible Pipelines
Data 360’s unstructured data indexing pipeline is a modular, extensible architecture.
**Pipeline Stages**
1. Parsing
2. Pre-Processing
3. Chunking
4. Post-Processing
5. Embedding
All stages also support LLM-based processing, letting customers write custom prompts. Both the pre-processing and post-processing phases can include multiple sequential steps, allowing complex transformations to be composed flexibly. Each stage is entirely metadata-driven, so every stage can be configured and extended from one place without code changes.
Examples of pre-processing include operations such as noise elimination, language normalization, and image understanding (optical character recognition and captioning), while post-processing stages may include metadata enrichment, semantic grouping, or advanced techniques such as Raptor chunking.
**Code Extension**
The pipeline fully supports Data 360 Code Extension, allowing enterprises to plug in custom logic at any stage. The code extension components are lightweight Python functions whose lifecycle (execution, scaling, and failure handling) is fully managed by Data 360. This lets domain-specific processing be introduced quickly while maintaining consistency and governance across the platform.
**Intelligent Context**
For setting up RAG with unstructured processing, two factors are key:
1. **Rapid Iteration**: The ability to quickly validate with sample test queries.
2. **Persona-Specific Content**: The capacity to configure content tailored to the consuming persona.
Intelligent Context is a tool designed to address both of these aspects. This interactive UI is powered by a Real-Time (RT) pipeline that executes all five previously outlined stages. The pipeline utilizes GPUs when necessary for tasks such as embedding generation and Optical Character Recognition (OCR). Furthermore, it allows customers to quickly test the RAG pipeline with an Agent before deploying the configuration for comprehensive content processing.
#### Document AI
Data 360 Document AI extracts structured, queryable data from unstructured and semi-structured documents such as invoices, resumes, lab reports, and purchase orders. Architects define an extraction schema (the fields, their types, and per-field extraction instructions) and choose between a batch pipeline over ingested documents and a transactional REST API that returns structured JSON synchronously; extracted data lands in Data Lake Objects that architects then model and route onward. For schema design, the batch-versus-transactional decision, governance, and a quick-start sequence, see the dedicated [Data 360 Document AI](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360-document-ai) guide.
### Enterprise Knowledge
Enterprises possess knowledge spread across disparate systems like wikis, file shares, content management systems, internal databases, and more. This fragmentation makes it difficult for employees (especially service agents and sales reps) and customers to find relevant information efficiently. Key problems include:
- Lack of a single, unified search experience across all knowledge sources
- Inconsistent presentation and rendering of content from different sources
- Lack of access governance for sensitive information scattered across systems
- Difficulty using authoritative knowledge sources within core business workflows (for example, attaching relevant articles to a Case)
Enterprise Knowledge represents content that has been curated, either manually or automatically, from the broader pool of enterprise data. Manual curation involves deliberate actions, such as creating Salesforce Knowledge Articles or developing knowledge within external systems which is then ingested. Whether curated manually or automatically, internally within Salesforce or externally before ingestion, the outcome is value-added content distinct from raw data.
The Enterprise Knowledge Hub solution uses Data 360 capabilities for:
- **Ingestion and Storage**: CRM Connector ingests Salesforce knowledge articles, and data connector framework (DCF) unstructured connectors ingest raw content and metadata from external sources. The content is ingested into source-specific unstructured data lake objects (UDLOs) mapping to the content on SFDrive (or source in case of zero copy). Data 360 supports a variety of unstructured connectors, including web-based sources (Web Crawler, Sitemap), collaboration and file platforms (Microsoft SharePoint, Google Drive, Box), developer and support tools (GitHub, Jira, Confluence, Zendesk), knowledge management systems (Guru, Helpjuice), content platforms (Adobe Experience Manager, YouTube), and cloud storage providers (Amazon S3, Azure Storage, Google Cloud Storage).
- **Harmonization & Structuring**: The Harmonization Pipeline processes UDLO and file data, performing cleaning, normalization, enrichment (NLP, etc.), PII masking, and transformation into the harmonized intermediate format, stored in SF Drive and a harmonized UDLO (HUDLO) that maps to it.
- **Indexing**: Unstructured Pipeline (UDS) is triggered over the harmonized content and Search Indexes are configured for each harmonized UDMO (HUDMO).
- **Consumption**: Consuming applications include search, retrieval, rendering, and linking to business objects like Case. Engagement by consuming applications is collected to provide usage analytics (like clicks, reviews, etc.)
### Calculated Insights
Calculated insights (CIs) in Data 360 allow customers to define and generate aggregated metrics from their data. These metrics are then used for timely customer engagement, analysis, segmentation, and activation. CIs are defined either through no-code/low-code drag-and-drop or direct SQL authoring. The aggregated data computed by CIs is written to Lakehouse and represented as a calculated insight object (CIO).
There are two main types of calculated insights:
- **Batch Calculated Insights**: Designed for complex, high-volume data aggregation, where metrics can be computed immediately or periodically (for example, hourly, daily, or weekly).
- **Streaming Insights**: Provide the ability to generate metrics and actions from real-time event data, enabling immediate, low-latency customer engagement. Streaming CIs use Spark Structured Streaming and support windowed aggregations (for example, 60-minute tumbling windows) on high-velocity event data.
Calculated insights are defined on data model objects (DMOs) or on other calculated insight objects, and can surface real-time insights even from non-real-time DMOs. The calculated insights service manages the orchestration of both batch and streaming jobs.
Both batch and streaming computations run on Spark: batch as periodic scheduled jobs, streaming via Spark Structured Streaming. For cost efficiency, the calculated insights service groups CIs that share dependencies or source data objects into the same job.
Streaming Insights computation relies on incremental change processing: native change notifications signal when new data has arrived (avoiding costly full-table scans), and snapshot-based change extraction supplies the precise set of changed records for the engine to process incrementally.
### Identity Resolution
Identity resolution transforms disparate data from multiple sources into a single unified profile.
A unified profile isn’t a “golden record”, and identity resolution doesn’t pick winning values or override any existing data while unifying profiles. Unified profiles serve as a set of keys — often referred to as a "key ring" — that unlock your source data by identifying all matching records that relate to the same entity, within one data source or across many sources. With this information, you can select the right source system data to use for a given business use case. Data 360 Identity Resolution supports real-time engagement and activation — it is not a replacement for a Master Data Management (MDM) system like Informatica. MDM provides strict governance, stewardship workflows, and an immutable Golden Record for enterprise-wide systems of record. Data 360 IR is optimized for "best view for action right now" instead of a legally binding truth.
Identity resolution can consolidate a variety of record types, including Individuals, Accounts, and Households. It can also be used to match leads to existing accounts. Unification supports a complete Customer 360 view across both B2C and B2B scenarios.
The identity resolution pipeline is cloud-native and processes large data volumes continuously. The process involves four key stages, relying on a search index to manage matching:
- **Matching (Candidate Selection)**: The goal of the match process is to search for records that may belong to the same entity. Records are analyzed against a customizable set of rules, each of which contains a set of criteria that define what data to match at which level of strictness. To efficiently retrieve potential matches from the data store, the system generates indexes to find likely matching records using two techniques:
- **Blocking Keys**: A blocking key is a value generated from a record's data and match rules (like the first few letters of a name, normalized phone number, etc) to group potentially similar records together. Each record has multiple blocking keys that are indexed and stored as an inverted index, ensuring the system only performs detailed comparisons on small groups of records, rather than across the entire dataset.
- **Locality Sensitive Hashing (LSH)**: For match rules with fuzzy matching, hashes are generated based on embeddings from trained models.
- **Deep Matching**: After the candidate selection step creates smaller groups of potential matches, the system begins a more detailed comparison. In this stage, AI models and advanced algorithms analyze each pair of records to calculate a probabilistic match score. This score quantifies the likelihood that two records refer to the same entity by intelligently comparing fields that often contain misspellings, variations, or formatting differences. Supported match methods include Exact Match (high-fidelity identifiers like Party ID or email), Fuzzy Match (for names with variations, nicknames, or typos — scored using Jaro-Winkler and name variant algorithms), and Normalized Match (standardizes formatting, for example, stripping country codes and spaces from phone numbers before comparison).
- **Clustering and Unification**: Once matching records are identified from the candidates, they are grouped into a cluster. This process includes resolving transitive matches. For example, if Record A matches Record B, and Record B matches Record C, all three are linked into the same cluster even if A and C were never directly compared. These complete clusters form the foundational structure of the unified profile. This clustering process ensures that all related source records are correctly linked under a single, persistent identifier. The maximum supported cluster size is 50,000 records per profile. If exceeded, IR splits them into singleton profiles and logs a warning (ExceededMatchingRecordsPerCluster). This typically indicates bad data quality or overly relaxed match rules.
- **Reconciliation**: Data values from all clustered source records are evaluated using defined Reconciliation Rules (for example, *Most Frequent*, *Most Recent*, or *Source Priority*) to populate the resulting unified profile with an excerpt of profile data. Reconciliation doesn’t overwrite any existing data, as all source data is available using the keys linked to the unified profile.
#### Identity Resolution Types
The architecture supports the resolution of multiple entity types to fulfill a variety of use cases.
- **Individual Matching**: Focuses on creating the Unified Individual profiles, which link all known personal identifiers (emails, phone numbers, loyalty IDs, cookies) to a single person.
- **Account Matching**: Focuses on creating the Unified Account profiles, which link data about accounts. When matching on company names, the engine uses a finely tuned model when fuzzy matching.
- **Household Matching**: Extends the matching logic to aggregate Unified Individual records into groups of related individuals.
- **Cross Entity Matching**: Apart from unification, identity resolution also creates links between profile objects by using the same match rules. For instance, a Lead can be linked to an Account using fuzzy matching on Account Name.
#### Near Real-Time Processing
To keep the unified profile current, the identity resolution engine runs continuously in near real time. Under normal operations, identity resolution runs incrementally, processing only new or modified records, which keeps costs proportional to data change volume instead of total data size. A change to any field mapped to the profile DMOs triggers reprocessing (even fields not used in match rules); unmapped fields neither trigger it nor count toward credit consumption. Map only the fields needed for identity resolution and activation. While processing speed varies depending on how source data is received, small batches of changes can be processed by identity resolution as frequently as every 60 minutes to 24 hours for standard IR (depending on the data source), with real-time IR (Sub-Second Real-Time / SSRT) available for use cases that require profile updates within milliseconds — such as in-session personalization and live segmentation evaluation. It's important to understand the distinction between the two processing modes:
- **Near Real-Time IR (standard):** Processes new and changed records incrementally on a scheduled cadence (as frequently as every 60 minutes to 24 hours, depending on the data source). This is the default mode and is suitable for the vast majority of use cases including segmentation, activation, and Agentforce grounding. Segments and Calculated Insights run against the Data 360 Lakehouse and are updated on their own scheduled cadences (hourly, 6 hrs, 12 hrs, daily, weekly) — they are not automatically updated in sub-second time.
- **Real-Time IR (SSRT — Sub-Second Real-Time):** Enables profile updates, segment evaluation, and Calculated Insight computation within milliseconds of an event. This is a separately licensed capability (available under the Sub-Second Real-Time Profiles & Entities add-on) and is architecturally distinct from the standard near-real-time path. **Real-time segment evaluation and CI computation require the Sub-Second Real-Time Profiles & Entities add-on.**
#### Source Profile Linking
The system maintains identity link objects, specifically the IndividualIdentityLink DMO and PartyIdentificationIdentityLink DMO, that map every source record ID to its corresponding unified profile ID. This foundational data structure allows the engine to efficiently track relationships and quickly propagate changes and updates to the unified profile, ensuring that customer experiences (such as website personalization, next-best-action recommendations, and segmentation) always use the freshest available customer data. A source profile is defined as a group of records from the Individual DMOs and related objects, such as the Contact Points DMOs and Party Identifiers.
### Segmentation
Segmentation is the core process of transforming unified individual profiles into actionable audiences. The Data 360 Segmentation platform supports complex rules, aggregation-based filters, and window-based ranking at petabyte scale, over a data model of thousands of objects and relationships. Data 360 serves as the System of Context, with segmentation at the core of real-time audience evaluation.
#### Segmentation Types and Cadences
Data 360 supports various segment types to meet distinct business requirements for speed, complexity, and hierarchy:
1. **Standard Segment**: The primary, batch-processed segment type. It publishes on a customizable schedule, with a Standard Publish cadence of a minimum of 12 hours up to 24 hours, or a faster Rapid Publish cadence of 1 to 4 hours, which is optimized for recent engagement data. Rapid Segments are limited to processing 600 million total records and can publish a maximum of 24 times per day. The event lookback window for Rapid Segments is 7 days; segments error if the date range exceeds it.
2. **Real-Time Segment**: This segment completes on-demand in milliseconds for immediate action based on recent events and profile data. It is optimized for instant personalization but cannot utilize exclusion criteria or nested segments.
3. **Waterfall Segment**: A hierarchical structure of subsegments used to prioritize a customer into a single, most valuable segment if they qualify for multiple criteria.
4. **Nested Segment**: This allows for reusing an existing segment as a filter for a new, more specific segment (a refinement of a base segment), inheriting the schedule of the parent segment.
5. **Einstein Segment (AI-Generated):** Data 360 also supports Einstein Segments, where AI automatically generates segment criteria based on natural language prompts.
Data 360 surfaces two types of population counts during segment authoring:
- **Filter-Level Counts**, for direct attributes (1-to-1 traits where one match = one unique person). Use the "Calculate Population" option to identify restrictive filters causing audience drop-off.
- **Container-Level Counts**, for related attributes (groups multiple related events, for example, 50 orders, into unique individual occurrences). This count ensures that you're counting unique people rather than total transactions.
#### Segmentation Engine: Architecture Fundamentals
The segmentation engine operates on a cloud-native architecture that ensures speed, scale, and resilience.

Although Data 360 Query handles segmentation count computations, the Spark compute layer calculates the actual Segment membership. The Spark application executes Spark SQL queries on extensive customer data. This data can reside in the Data 360 Lakehouse, external systems via Zero Copy data federation, or a combination of both.
The architecture uses adaptive resource management, adjusting compute to workload size and complexity, and manages SLO adherence with adaptive durations and retry logic. Accelerated segment counts use sampling to provide rapid size estimates during segment creation, avoiding a full query run.
Observability and root-cause attribution rely on Spark execution metrics and automated error classification (for example, customer-side vs. system issues), reducing diagnosis time.
### Activation
Activation is the final step in the Data 360 lifecycle. Its core function is to transform static, segmented, unified individual profiles into actionable and enriched data and deliver this data to internal and external endpoints (such as Marketing Cloud, Commerce Cloud, and Adtech platforms like Facebook, LinkedIn, and Google). This process is designed to trigger personalized customer journeys and near real-time interactions. It supports advanced capabilities like related attributes, activation membership filtering, consent filtering, limiting, and ranking.
Activation offers three distinct methods for external delivery and channel compliance:
- **Batch Activation**: Designed for high-volume, scheduled operations such as large-scale email campaigns and advertising audience refreshes. Data is delivered by staging it to Secure Internal Buckets (Cloud Object Storage) or via Secure File Transfer, followed by an API ingest process initiated by the target system. Batch activations can utilize special refresh mode (incremental) to reduce volumes sent to and processed by Salesforce partners. Batch DMO Activations can also be published on-demand via the Connect API, eliminating reliance on manual activation scheduling.
- **Streaming Activation**: Optimized for near real-time use cases requiring event-driven automation. Delivery is achieved through direct API calls sent to the destination endpoint.
- **Activation-Triggered Flows (ATF)**: This highly platformized channel provides a no-code/low-code approach for integrating audience data with hundreds of API-enabled engagement platforms. Upon activation completion, Data 360 populates an Audience DMO, which then triggers a High Scale Flow. The Flow engine subsequently consumes the audience data and utilizes platform capabilities like External Services and Mule Outbound destinations to make calls to the final API-based destination. This method reduces the time to onboard new activation targets. ATF supports Batch DMO Activations, not just segment-based activations, allowing any DMO (Engagement, Profile, or Other category) to trigger a flow upon activation.
- **Flow-Orchestrated Activations (FOA):** FOA allows customers to call Data 360 Activations directly from the Flow canvas, using Flow's native logic (Decisions, Loops, Waits) to orchestrate fully automated, multi-channel journeys. Unlike traditional activations driven solely by segment publish schedules, FOA enables behavior-driven journeys where customers are automatically moved across channels based on real behavior (for example, email → ads → data systems).
Activation utilizes the same patterns as segmentation for job management, distributed execution, and monitoring. This includes the principles of the job orchestration service for lifecycle management and the compute layer (Spark) for processing, and relies on job telemetry for performance observability and service level objective (SLO) adherence.
Activation also includes several supporting capabilities:
**Activation Target Management** oversees the secure connections, credentials, and configurations for all destination endpoints. It guarantees that data formats and security protocols are standardized, ensuring dependable outbound delivery to various platforms, including Marketing Cloud, Adtech partners, and other external applications. Credentials are secured through Named Credentials and External Credentials, and for high-security environments, outbound connections can be restricted to Private Connect links, ensuring activation traffic remains within a private network.
Activation tailors the payload for specific targets. For Salesforce Marketing Cloud, this includes Business Unit (BU) Aware Filtering, Multi-EID support, and cross-pollination controls.
**Communication Governance** acts as a gatekeeper, ensuring data usage and communication are compliant with customer preferences and legal requirements. A centralized consent model unifies all customer preferences (from global opt-outs to channel- and purpose-specific consent) and stores them on the Unified Individual profile. During execution, the platform strictly enforces these policies by using exclusion filtering to automatically remove non-consenting individuals from the final payload. Consent flags evaluated include "Do Not Share," "Do Not Sell," and "Email Opt-Out," aligning with GDPR and CCPA requirements, with automated lineage and audit logs generated for each outbound activation event. Data 360 is also a HIPAA Covered Service under Salesforce's Business Associate Addendum, so activation supports protected health information (PHI) under a signed BAA, subject to the applicable restrictions such as PHI encryption.
Furthermore, the system applies contact point selection rules to ensure it uses the single, most compliant, and preferred contact point for the intended channel before any data is transmitted. Dynamic data masking and access controls protect sensitive data fields throughout activation.
**Auditability** provides administrators with visibility into activation events — who was included, which segment they belonged to, what consent flags were evaluated, and which target received the data. Each outbound activation generates a detailed audit log capturing the segment definition, execution timestamp, applied governance rules, and the resulting audience payload. Admins can trace individual records through the activation pipeline, from profile match to final delivery, using activation history views and data lineage tools. This supports accountability for compliance reviews, troubleshooting, and regulatory inquiries.
### Unified Query
Salesforce Data 360's Unified Query capability abstracts the complexities of diverse data stores behind a single query interface.
The Unified Query layer supports diverse consumption patterns:
- **Hybrid Structured & Unstructured Querying**: The Unified Query layer provides extensive SQL support to seamlessly query both structured data and the structured metadata of unstructured data. This is enhanced by operator extensibility via table functions, enabling specialized search across text, image, and spatial types. Hyper is extended to perform queries combining structured (relational), keyword (full-text) search, and semantic (vector) search, enabling hybrid search across all data types.
- **Accelerated Performance with Hyper**: Data 360 uses Hyper, a high-performance, in-memory engine, to accelerate complex analytical queries and interactive dashboards.
- **Unified Approach for AI & Personalization**: Unified access supports Retrieval Augmented Generation (RAG), grounding LLM responses in enterprise data.
- **Integration with Downstream Consumption**: This integration is the foundational data access layer for UI-driven experiences, APIs, Generative AI workflows, and CRM enrichment, connecting data to activation. As part of AIforce, the Connect REST API is the primary public API for headless, API-first, and MCP-based access to all Data 360 capabilities — enabling any agent, model, or tool to interact with Data 360 without a browser or UI.
### Data Actions
Data 360 is an active platform that supports the activation of pipelines in response to data events. For instance, an event, such as a drop in a customer’s account balance or a Calculated Insight detecting "High Churn Risk," can trigger a Salesforce Flow to orchestrate a corresponding action. Similarly, updates to key metrics, such as lifetime spend, can be automatically propagated to relevant applications.
Data Actions continuously monitor for data changes using native change notifications and snapshot-based change extraction. This data is evaluated against tenant-configured action rules, such as threshold monitoring or state changes. When these rules are met, a data action event, specifically a `DataObjectDataChgEvent`, is generated. This event is enriched with additional information (for example, customer loyalty status) and immediately sent to its configured destination, such as Salesforce Flow or an external application, to trigger business orchestrations.
Data 360 now includes monitoring alerts for Data Action failures. A "Data Actions Failure" alert surfaces errors in near-real-time integrations with platforms like MuleSoft and Marketing Cloud that can disrupt data synchronization across systems.
#### Customer Data Platform
Data 360 provides native CDP (Customer Data Platform) capabilities across both business-to-business (B2B) and business-to-consumer (B2C) models, building on the identity resolution and identity graphs described above. It is built natively into the Salesforce platform, letting Sales, Service, Marketing, and Commerce operate on a single unified data foundation.
Identity graphs enriched with engagement data from across channels feed the profile graphs used for analytics and segmentation.
#### Data Graphs
A key concept that supports the customer profile is the data graph. Data 360 offers an enterprise data graph in JSON format, which is a denormalized object derived from various Lakehouse tables and their interrelationships. Data Graphs can be refreshed on a batch schedule or via Streaming — an event-driven mode that provides near real-time, low-latency data propagation, keeping incrementally refreshed graphs complete even when related records arrive late or out of order.
This includes a "Profile" data graph created by CDP that encompasses a person’s purchase and browsing history, case history, product usage, and other calculated insights, and is extensible by customers and partners. Data Graphs support ABAC governance controls — access policies can restrict or filter what data is returned in queries, ensuring that even real-time profile retrieval respects row-level and field-level security.
These data graphs are tailored to specific applications and enhance generative AI prompt accuracy by providing relevant customer or user context. The real-time layer of Data 360 utilizes the Profile graph for real-time personalization and segmentation.
#### Data 360 and MCP
Data 360 is accessible as a Salesforce MCP server, allowing any AI agent, including Claude, ChatGPT, or custom-built agents, to connect directly to Data 360 capabilities without a browser or Salesforce UI. Data 360 defines what the agent knows; Agentforce defines what it's allowed to do; and the LLM defines how it reasons. Clean, unified, governed data in Data 360 ensures that agents connected via MCP don't inherit data quality issues from siloed systems.
### Real-Time Layer
Data 360’s real-time layer is backed by the Data 360 CDP and extends its concepts for real-time use cases, processing events such as web and mobile clickstreams, visits, cart data, and checkouts at millisecond latencies. It continuously monitors customer engagement and updates the unified individual profile with real-time engagement data, segments, and calculations for immediate personalization.
For example, when a consumer purchases an item on a shopping website, the real-time layer quickly detects and ingests this event, identifies the consumer, and enriches their profile with updated lifetime spend information. This allows for the personalization of their experience on the site with sub-second latency. Additionally, this layer includes capabilities for real-time triggering and responses, enabling immediate actions based on customer interactions.

Data 360's real-time platform combines a streaming pipeline, low-latency storage, and a sub-second processing layer. As interactive data is ingested from web and mobile channels, it goes through a series of rapid processes.
Web & Mobile SDKs (including a JavaScript tag-based Web SDK) and REST APIs collect behavioral and interaction data from web and mobile applications and transmit it to Data 360. Standard event types such as cart, order, catalog, and behavioral events are supported out of the box. From there, the data is routed along two parallel paths: to the Real-Time Layer for millisecond-latency processing, and to the Lakehouse Layer for integration with batch and streaming data pipelines.
The Real-Time Layer processes incoming data in the context of a user profile — whether anonymous or authenticated — updating attributes such as total spend or lifetime value to power in-session, real-time personalization. To meet strict latency requirements, the Real-Time Layer is backed by main memory and NVMe (SSD) storage, optimized for high-speed reads and writes of real-time data and customer profiles.
Once data lands in the Real-Time Layer, it passes through a series of processing steps before being committed to the Real-Time Data Graph:
- **Simple Ingest and Transformations**: The data is ingested and transformed for further processing.
- **Identity Resolution**: Exact match rules are applied to unify profiles with all existing match rules sets, so data-aware specialists don't have to create new identity resolution rules sets specifically for real-time.
- **Computed Insights**: Every engagement is evaluated; simple computations such as sum and count run in milliseconds and update the Real-Time Data Graph. Streaming Calculated Insights use Spark Structured Streaming with windowed aggregations (for example, 60-minute tumbling windows).
- **Real-Time Segments**: Every engagement data is evaluated to determine if it meets the criteria for defined real-time segments, and users are added to qualifying segments in milliseconds.
- **Real-Time Actions and Triggers**: Every engagement is evaluated against defined rules; when rules are met, a `DataObjectDataChgEvent` is generated in milliseconds and delivered to configured destinations such as Salesforce Flow (High Scale), Platform Events, Internal Webhook, or MuleSoft and external APIs.
- **Real-Time Data Graph and API**: Real-time data graph, which also includes a real-time API, allows brands to retrieve updated JSON-format data for each user, ensuring that all customer interactions are informed by the freshest data. The API delivers sub-second (P99 < 200ms) retrieval latency under normal operating conditions.
#### Personalization
Personalization is all about knowing who to target, when and where to deliver relevant content and recommendations, what to say and what frequency. Salesforce Personalization is the orchestrator of what decisions are made to optimize goal achievement through personalized experiences. It combines profile understanding via Profile Data Graphs with business context via Item Data Graphs (catalog, offers, promotions) to deliver personalized recommendations and content across channels.
Salesforce Personalization uses any data in Data 360 — including segments, real-time behavioral data, Calculated Insights, and affinities — to better target customers throughout their lifecycle.
**Personalization Services** integrates with Data 360 in the following ways:
- Interprets profile, activity, and asset data from Data 360 through a consistent set of models
- Writes engagement and interaction data back into Data 360 (as engagement DMOs), where analytics, reporting, and re-segmentation run
### Agentforce Coworker
Agentforce Coworker is the conversational AI experience built into Salesforce that understands the intent and context behind queries, surfaces the right information from across the entire enterprise, and puts plans into motion using Agentforce — all from inside the CRM search bar. It builds on existing Data 360 services and integrates deeply with Agentforce.
#### Using Data 360's Core Strengths
Our approach to Agentforce Coworker is based on these principles:
- Enterprise data is kept in siloed services or stores, with secure permissions needed for access. The ability to access this data and process it while maintaining the source permissions is vital to ensure trust.
- Cross-ranking and relevance across the complete corpus of data enable better results, which in turn can provide better context for agentic experiences.
To deliver these experiences, Agentforce Coworker is built on top of these key architectural components:
- **Connectors**: The broad set of connectors available in Data 360 enables one to access and ingest data from a wide variety of sources.
- **Unstructured Data Processing**: This is foundational for handling non-tabular content, enabling the system to derive meaning and context from diverse data. It also supports Docling parser (complex tables and layouts), LLM-Based parser (holistic document processing), Visual Data in RAG Responses (diagrams, flowcharts, infographics), and UDMO Context — enabling metadata such as Titles and URLs to be prepended directly to chunks for better agent retrieval accuracy.
- **Governance**: Ensuring enterprise-grade security, compliance, and access controls for all data consumed by search. Support for source visibility permissions ensures that the data is accessible only to authorized users, for both simple search and agentic experiences. To ensure fast retrieval, security permissions are evaluated and enforced natively by the search backends at the earliest stage of data access. For permission-aware sources, Data 360 ingests and automatically creates and applies governance policies, source permissions are inherited from the source. For non-permission-aware connectors, governance policies can be created manually using Data 360 ABAC capabilities
- **Unified Retrieval Layer**: To address the challenge of siloed data, the connectors feed into a comprehensive Unified Retrieval layer. This layer provides a single access point to all data, whether it remains in external systems accessed via Federated Search or is managed natively through advanced indexes for zero-copy and ingested data.
- **Intelligent Query Understanding**: Before retrieval, the system uses AI-powered mechanisms to interpret user intent. In addition to embedding representations of the query for semantic vector matching, it can rewrite and expand keyword-based searches to improve accuracy. The system also uses the Data 360 semantic layer (DMOs, Calculated Insights, Data Graphs) to translate natural language into precise, governed business logic, ensuring agents don't just retrieve rows, but retrieve contextually assembled entity packages.
- **Hybrid Search and Advanced Querying**: To find the most relevant information, the platform uses multiple strategies in parallel. Hybrid search provides precise keyword matching with semantic vector search on optimized chunks of data, while Full-record search simultaneously retrieves entire documents. Both are combined to ensure both semantic relevance and complete content coverage. The hybrid score is a relative relevance signal — it should not be used to compare scores across separate query executions, only within a single result set.
- **Hierarchical Ranking**: After data is retrieved, a multi-stage hierarchical ranking architecture scores, merges, and re-ranks the results from every source and method. This process creates a single, unified list that surfaces the most pertinent information for the user or agent.
#### Agentic Search Applications
Generative AI is shifting the primary consumer of enterprise search from human users to Large Language Models (LLMs). Data 360 Search is engineered from the ground up to serve both. It is optimized to handle the longer, more complex queries from agents and return the rich, contextual results necessary for programmatic consumption and reasoning loops. At the same time, the system can handle the shorter, often ambiguous queries typical of human users, providing features like snippets and highlighting for rapid assessment in a UI.
The ultimate delivery of agentic search experiences combines both approaches:
1. **Direct Search Results**: application can display a traditional list of ranked results by using a metadata-driven API built on the Data 360 unified search foundation.
2. **Agentic, multi-turn conversational answers**: agentic answers are implemented through native integration with Agentforce. This conversational experience is driven by a primary agent that orchestrates actions and queries, delegating all information retrieval tasks to a specialized, internal Search Agent.
This specialized Search Agent is optimized for enterprise information retrieval. It uses a reasoning loop to formulate and execute parallel searches to explore different facets of a user's request. It utilizes a powerful set of tools, including the Data 360 unified search for all data types and structured query languages to retrieve precise data from tables and entities. The Search Agent is grounded in the Data 360 unified search foundation, which combines keyword search and semantic vector search through Hybrid Search, ensuring both intent-based and exact-match queries are served accurately.
##### Advanced Retrieval Capabilities
The precision of agentic search is directly determined by retrieval quality. It introduced several capabilities that significantly improve retrieval accuracy for enterprise deployments:
- **Enhanced Retriever Pre-Filters**: Up to 10 pre-filters with compound AND/OR logic and LIKE operator support — a 10x increase in filtering capability. This reduces retrieval noise and keeps the AI context window focused on the most authoritative content. Pre-filters can be configured at setup time, tested in the Retriever Playground, and applied programmatically at query time.
- **Retriever Playground**: A dedicated testing environment allowing architects and data stewards to validate retriever behavior end-to-end against fully built search indexes, without invoking an LLM. Users can view retrieved chunks, scores, adjust settings, validate against ground truth, and save improved configurations.
- **Visual Data in RAG Responses**: LLM + Docling image processing enables agents to extract insights from diagrams, flowcharts, and infographics embedded in documents, not just text content.
- **Dynamic Retrievers**: A distinct retriever type whose filter values are populated from the prompt at query time, so a single retriever can serve many personas instead of requiring a separate retriever for each filter value.
### Agentic Context and Memory
By default an agent is stateless across sessions. It retains nothing from one conversation to the next, so any memory of a customer's prior preferences, decisions, or history must be rebuilt from source data or re-elicited from the user. Absent a shared substrate, each agent implements that memory itself (its own storage, retrieval, and access control), usually without inheriting the governance that applies to the underlying data. The Agentic Context Engine (ACE) is that shared substrate: a Data 360 service that provides agent memory as a governed, cross-session context store. Any agent (Agentforce or third-party) uses it instead of building and securing its own.
ACE is a headless context service: an agent registers with Data 360 and then stores and retrieves context through a consistent interface, without handling the underlying stores directly. Conversation history flows through the real-time layer and persists to the low-latency store, and the unstructured processing pipelines distill that history into durable memory (concise conversation summaries, plus profile-level facts and preferences). For each turn of a conversation, ACE assembles the relevant slice of this context and serves it to the agent — drawing on the unified individual profile for long-term, per-person context and on session state for the current interaction.
Because ACE is built on Data 360, agent memory inherits the platform's governance model. An agent operates in the security context of the user it serves, so it retrieves only the conversations and context that user is permitted to see, and memory is partitioned by data space like other Data 360 objects. (Encryption, residency, and subject-rights handling follow the platform-wide model covered in the dedicated [Data 360 Security Architecture guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360_security_architecture.html).)
### Extending Data 360 with Custom Code
Extensibility is a key feature in the Salesforce platform. Code Extension, also referred to as Bring Your Own Code (BYOC), provides extensibility in Data 360, allowing pro-code users to run custom Python logic directly within the Data 360 environment, supplementing its rich declarative and low-code functionalities. Using Code Extension, users can securely extend Data 360 core capabilities like Batch Data Transforms and Custom chunking in Unstructured Data Pipelines (custom chunking).
Our design for Code Extension prioritizes flexibility, security, efficiency, and a streamlined developer experience. It supports two primary execution models, each tailored for specific architectural needs:
- **Script Model**:
- **Purpose**: For comprehensive custom logic requiring direct interaction with the Data 360 Lakehouse.
- **Functionality**: Customers write full Python scripts using the Code Extension SDK, enabling read and write access to the Lakehouse via SDK APIs. Scripts can read from multiple Data 360 objects, apply complex processing logic, and write results back to target objects. Ideal for custom/complex data preparation, or bespoke data manipulation, custom decryption logic, parsing of nested legacy formats (for example, XML), or complex financial calculations.
- **Isolation and Security:** While scripts access the Lakehouse, their execution is confined to a secure, isolated environment within the Data 360 runtime, preventing interference with other processes or unauthorized system access.
- **Function Model**:
- **Purpose**: Analogous to a serverless function, for modular, stateless computations invoked from existing Data 360 pipelines (for example, custom chunking in an Unstructured Pipeline).
- **Functionality**: Customer-provided functions take input, compute, and return output. Example use cases include chunking by HTML tags to preserve structural context, chunking by speaker turns to maintain conversational flow, or chunking by slide to retain presentation context — all critical for ensuring Agentforce agents retrieve the correct context from complex document structures.
- **Isolation and Security**: These functions are designed for strict isolation; they do not have direct Lakehouse access. Their execution is sandboxed, stateless, and resource-constrained, making them suitable for focused, stateless processing steps, ensuring security, predictable execution, and minimizing blast radius.
Both the Script and Function models securely execute customer code, preventing one tenant's code from affecting others or gaining unauthorized access to other tenants' data, Salesforce resources, or external resources. This layered (defense-in-depth) architecture provides an isolated execution environment for each tenant's custom code, incorporating guardrails such as logical isolation at the Kubernetes (K8s) level, network isolation, runtime sandboxing, and least-privilege permissions, all complemented by operational monitoring and incident-response readiness.
#### Securely Integrating External Calls
Beyond extending internal Data 360 features, Code Extension also enables secure invocation of external services directly from within the Data 360 execution environment. Using the Data 360 SDK, scripts and functions can invoke registered LLMs, AI/ML models (for example, a BYOM model registered in the AI Models tab), and registered external API endpoints — without data leaving the Salesforce trust boundary.
#### Developer Experience & Operational Visibility
To support a robust development lifecycle, Code Extension offers:
- **External Authoring and Debugging**: Developers can craft and debug Python code in familiar environments like VSCode, using the SDK.
- **Flexible Deployment**: Custom code can be packaged and deployed using SDK utilities, the Data 360 UI, or API, enabling integration into CI/CD.
- **Operational Logs**: Access to detailed execution logs provides transparency and aids troubleshooting in production.
### Extending Data 360 by Bringing Your Own AI Models
As enterprises accelerate AI adoption, most maintain heterogeneous ML ecosystems — including Amazon SageMaker, Google Vertex AI, Databricks and custom Python-based environments — hosting models that drive mission-critical predictions, such as credit risk scoring, churn propensity, product recommendations, and next-best-action decisions.
Traditionally, integrating these external models into Salesforce required bespoke API layers, ETL pipelines, or middleware orchestration, introducing data duplication, governance overhead, latency, and operational complexity—challenges that conflict with a unified, compliant, and real-time Customer Data Platform (CDP) vision.
**Bring Your Own Model (BYOM)**: Delivered via the AI Models tab in Data 360, addresses these challenges by enabling direct invocation of externally trained models within Salesforce workflows, Apex logic, and automation tools—without moving or replicating data. Through zero-copy federation, Data 360 is the governed single source of truth, exposing harmonized Customer 360 data for inference at external endpoints. Prediction outputs flow back in real time, powering business processes with scalable intelligence.
BYOM effectively closes the gap between data science and operational execution by decoupling model development, governed data, and consumption layers. It preserves platform independence, reduces integration complexity, accelerates AI deployment, and maintains governance over sensitive data through the Einstein Trust Layer — ensuring all BYOM model invocations route through Salesforce's trust boundary, with PII masking, audit trail, and zero data retention enforced.
The architecture operates as follows: Data 360 provides a unified customer 360 data foundation, while AI Models orchestrates connections to external ML platforms (SageMaker, Vertex AI, or custom endpoints). External models execute inference in real time, batch, or streaming modes. Salesforce layers—Flow, Apex, and Query APIs—consume outputs to deliver personalized, automated, and analytical insights across Sales, Service, Marketing, and Industry Clouds.
In addition to BYOM for connecting externally trained models, the AI Models tab now includes a no-code Model Builder for building predictive models natively within Data 360. Furthermore, a brand-new set of native AI functions is built directly into the Data 360 processing engine. These native AI functions are deeply integrated: they connect directly to DCSQL for use in the Tableau Next Semantic Layer, are available in Batch Data Transforms for Customer 360 enrichment, and can be invoked in Flow for intelligent automation.
**Bring Your Own LLM (BYO-LLM)**: Offers the same extensibility mechanism but for generative models. By enabling direct invocation of external LLMs, we allow customers to use them in the Agentforce Platform in place of Salesforce-provided models. All BYO-LLM requests route through the Einstein Trust Layer's LLM Gateway, ensuring PII masking, toxicity detection, audit trail logging, and TLS-encrypted communication are applied regardless of which external LLM is used. For enterprises, BYO-LLM allows:
- Access to fine-tuned models
- Integration of models not currently provided by Salesforce
- Usage of models in customer-provided accounts
### Data Collaboration
Modern enterprises operate within a complex data landscape characterized by two major architectural challenges:
1. **Intra-Enterprise Fragmentation**: Large organizations frequently utilize multiple Salesforce Orgs (often segmented by region, business unit, or historical acquisition) and numerous other data systems. This fragmentation creates internal data silos, making it impossible to establish a single, trusted, and unified view of the customer for real-time engagement across the business. The challenge is to unify this data without physically consolidating or duplicating it across all systems, and while keeping governance intact.
2. **Cross-Enterprise Collaboration**: Companies often need to share data with partners and suppliers for joint marketing, measurement, and business intelligence. The challenge is enabling this collaboration while protecting sensitive, proprietary data and adhering to privacy regulations like GDPR and CCPA, as well as competitive barriers.
Salesforce Data 360 addresses these challenges with a zero-copy, trust-by-design framework built on the principle of sharing access and insights instead of moving or duplicating data.
#### Data 360 Collaboration Mechanisms
Data 360 offers three collaboration mechanisms, each serving a different purpose. The right choice depends on whether the goal is centralized unification (Data Cloud One), selective cross-instance exchange (Data Sharing between Data 360 instances), or privacy-preserving collaboration across organizational boundaries (Clean Rooms).
##### Internal Enterprise Enablement with Data Cloud One
Data Cloud One is the foundational architectural solution for enterprises operating multiple Salesforce orgs. Its purpose extends beyond simple data sharing; it establishes a single, trusted customer view and enables full Data 360 platform capabilities across the entire organization.

This mechanism centers on a designated Home Org Data 360 instance, which serves as the central authority for data management and building the unified individual profile. The Home Org is the org that Data 360 is provisioned on. A Data Cloud One connection is established between Data 360 and other Salesforce orgs, called Companion Orgs. As part of the Data Cloud One connection, Data 360 shares one or more of its data spaces with each companion org, providing access to both data and metadata in each shared data space. This works through a zero-copy federation model and cross-org metadata synchronization.
Data Cloud One also allows Companion Orgs to use the Home Org’s Data 360 instance for their own activation, personalization, and intelligence needs. This strategy is essential for eliminating internal data fragmentation and ensuring all business units activate against the same, governed, and unified individual profile, maximizing the ROI of the core Data 360 implementation.
##### Data Sharing Between Data 360 Orgs
For distributed internal environments (where full centralization is not feasible) and for collaboration with trusted external partners, Data 360-to-Data 360 data sharing connects independent Data 360 instances.

This zero-copy sharing model establishes a connection between separate Data 360 tenants provisioned on different Salesforce orgs for the purpose of secure exchange of data objects (DLOs, DMOs, and CIOs). Once connected, the entire data object becomes accessible in the recipient Data 360. The recipient Data 360’s administrator can then set governance rules to manage user access to this data.
##### Privacy-First Collaboration with Data 360 Clean Room Collaboration
When collaboration requires the highest levels of privacy and compliance, or when competitive concerns forbid sharing raw data, Data 360 Clean Rooms let two or more data owners jointly analyze data and derive insights without exposing the underlying sensitive data or match identifiers.
Architecturally, Data 360 Clean Room Collaboration is built on top of the Zero-Copy Sharing framework used by Data 360-to-Data 360 data sharing, with additional layers of governance and computational constraints applied. Rather than copying data into a neutral third-party environment, computation executes in place within each participant’s governed data domain, and parties join their datasets on hashed or tokenized match keys without either party ever seeing the other’s raw identifiers.
Because Clean Rooms are natively embedded within Data 360, they reuse existing DMOs, identity resolution rules, consent models, and ABAC governance policies, eliminating duplicate security layers and reducing time-to-collaboration. External sources connected through zero-copy accelerated query federation, such as Snowflake or Databricks, can participate directly in a collaboration without first ingesting their data into Data 360. Collaborations are established either through the AppExchange, where providers publish Clean Room packages for consumers to discover and install, or through an Allow-List model for direct peer-to-peer invitations between known organizations.
For the privacy-enhancing mechanics — Private Joins, query-limiting use case templates, minimum-aggregation thresholds, and the full set of industry use cases — see the dedicated [Data 360 Clean Rooms guide](https://architect.salesforce.com/docs/architect/fundamentals/guide/data360-cleanrooms.html).
#### Data 360 and Informatica Integration
Informatica’s Intelligent Data Management Cloud (IDMC) acts as a powerful enterprise engine for feeding high-quality, reconciled data into Data 360. Through its advanced data integration capabilities, Informatica extracts, cleanses, and transforms complex data from diverse on-premises and multi-cloud systems before loading it into Data 360's Lakehouse. Furthermore, Informatica’s Master Data Management (MDM) works in tandem with Data 360 by matching, merging, and resolving identities across disparate enterprise systems to create a golden record. This record ensures that the unified individual profiles and identity resolution processes within Data 360 are built on accurate, deduplicated, and trusted enterprise-wide data.
On the governance and discoverability front, Informatica's Enterprise Data Catalog actively scans and indexes enterprise-wide metadata, providing a clear lineage of where data originates, its quality, and how it transforms. When integrated with Data 360, Informatica's catalog shares this rich technical and business metadata with Data 360's own metadata-driven architecture. This integration ensures that the data ingested or federated into Data 360 is fully governed and easily discoverable, empowering Data 360's Activation Layer, Semantic Layer and Data Governance controls to operate on trusted data assets.

## Conclusion
Data 360 is an extensible, trusted data fabric for powering next-generation AI. Its architecture addresses the problem of fragmented data, enabling organizations to unify, process, and activate all customer data at scale, using Data Federation for efficiency.
Its Data Organization establishes a harmonized view from DLOs (including unstructured data) to DMOs, all secured within partitioned Data Spaces. Data 360’s data processing capabilities (including batch and streaming transforms, calculated insights, unstructured data processing, and identity resolution) are powered by an incremental change-processing architecture, enabling efficient, near real-time processing and cost savings.
Extensibility is provided by the Code Extension architecture, securely enabling custom Python logic via Scripts or isolated Functions. A data governance framework built on attribute-based access control (ABAC) with CEDAR policies enforces granular security, dynamic data masking, and consistent enforcement across all data consumption. Segmentation and activation then translate unified individual profiles into multi-channel, real-time engagement.
Data 360's ability to unify vast, diverse data, provide real-time context via its unified query (including hybrid structured/unstructured search and Hyper acceleration), and enforce governance is central to powering AI agents. It provides the trusted, fresh, relevant data needed to ground Generative AI workflows (RAG) and to fuel the multi-turn, action-oriented capabilities of Agentforce-powered agents, so they operate with precision and accuracy.
# Overview
Enterprise data architecture is at an inflection point. Organizations must simultaneously support real-time AI systems, comply with increasingly strict privacy regulations, and collaborate with external partners who cannot share raw data. These requirements are fundamentally reshaping how data platforms are designed.
Traditional architectures built on ETL pipelines and centralized data warehouses struggle to meet these demands. Replicating data across systems increases latency, cost, and governance complexity. Each copy becomes a new compliance obligation, complicating consent management, deletion requests, and policy enforcement across distributed environments.
To address these challenges, the industry is shifting toward zero-copy, policy-enforced collaboration models. Data clean rooms have emerged as a key architectural capability, enabling multiple organizations to analyze shared signals without exposing or transferring raw data. Instead of moving data into centralized environments, computation executes within each participant’s governed domain, and only privacy-safe results are returned.
This architectural shift is increasingly visible across industries. For example, the acquisition of InfoSum by WPP, which is the largest company in marketing and advertising, reflects the growing importance of clean rooms as infrastructure for privacy-safe collaboration. Financial institutions use them to detect fraud across institutions, retailers to coordinate promotions with consumer brands, and healthcare organizations to analyze cross-provider patient cohorts, without sharing sensitive underlying records.
Salesforce Data 360 operationalizes this model through a zero-copy architecture built on Hyperforce. Data remains in its source systems while federated queries enforce privacy, consent, and residency policies at runtime. This approach enables real-time insights, cross-cloud collaboration, and AI-driven decisioning without expanding the risk surface created by data replication.
This document examines how data clean rooms function as a foundational architectural pattern for the modern enterprise, supporting AI innovation, regulatory compliance, and secure cross-domain collaboration simultaneously and at scale.
## Why Clean Rooms Matter Now
To understand why data clean rooms are necessary, enterprise architects must first confront the structural failure of legacy integration models. The industry is undergoing a decisive transition from monolithic, centralized data repositories to decentralized, federated ecosystems. Here, data is accessed, governed, and computed in place rather than physically moved. This shift isn’t incremental. It’s a direct response to systemic pressures around scale, privacy, and agility that traditional architectures can no longer absorb.
### Redefining Data Integrations in Modern Enterprise
For years, enterprises relied on ETL-driven architectures that copied data from CRM, ERP, and digital systems into centralized warehouses for reporting and analytics. This approach proved effective for historical analysis, but it was designed for a slower, batch-oriented world.
As digital interactions accelerated and AI-driven systems emerged, the limitations of this model became more apparent. ETL pipelines are inherently asynchronous, meaning insights often arrive hours or days after events occur. Such latency is increasingly incompatible with modern use cases like real-time personalization, adaptive decision-making, and AI systems that require immediate, contextual data.
Replication also introduces growing governance and security complexity. Each new copy of data requires additional policies, monitoring, and compliance controls. In regulated environments, frameworks such as the General Data Protection Regulation (GDPR) require organizations to manage deletion, consent, and usage restrictions everywhere the data exists—an operational challenge when datasets are duplicated across multiple systems.
At scale, this duplication compounds cost and operational overhead. Organizations repeatedly pay for ingestion, storage, security, and processing across multiple platforms while the marginal value of additional copies declines.
As a result, modern data architectures are shifting toward models that minimize data movement and enforce governance directly at the source. Zero-copy integration and federated data access enable organizations to generate insights without replicating sensitive datasets, providing a more scalable, secure, and policy-aligned approach to enterprise data collaboration.
### The Emergence of Data Mesh and Data Fabric
In response to these pressures, the industry has coalesced around two complementary architectural paradigms: Data Mesh and Data Fabric. Together, they represent a shift away from centralized control toward federated, domain-aware data architectures.
Data Mesh decentralizes data ownership to domain-aligned teams such as Sales, Marketing, or Supply Chain. Each domain treats its data as a product, with clearly defined contracts, quality standards, and service-level objectives. This model improves accountability and business alignment, but at enterprise scale it introduces new challenges around coordination, interoperability, and consistent governance across domains.
Data Fabric addresses these challenges by providing the connective layer that binds decentralized domains into a coherent system. It delivers shared metadata, common semantics, automated policy enforcement, lineage, and governance, enabling data to be discovered, accessed, and governed consistently without forcing physical consolidation into a single repository.
Together, Data Mesh and Data Fabric establish the foundation for federated data access. However, they stop short of solving a critical next-order problem: enabling secure, governed collaboration across domains and organizational boundaries, where data must be analyzed jointly without being copied or exposed.
### The Strategic Pivot to Clean Rooms
As enterprise data becomes more distributed and privacy regulations grow stricter, organizations face a core architectural challenge. How do they collaborate across teams, partners, and platforms without sharing raw data? Traditional data integration approaches weren’t designed for this level of distribution or regulatory scrutiny, which created tension between collaboration and compliance.
This challenge has led to a shift toward data clean rooms as a foundational architectural capability. Clean rooms move collaboration away from data transfer and toward governed computation. Instead of copying or exchanging datasets, analytics and AI workloads run where the data already lives by sharing the metadata. Queries are evaluated in real time against privacy, consent, and usage rules, and only approved, aggregated results are returned.
In this model, data clean rooms act as the trust boundary of modern data architectures. They allow organizations to work with partners and subsidiaries without losing control of their data, enforce privacy and consent through system controls rather than policy alone, and operate across clouds while respecting data residency and contractual limits.
For activation, analytics and AI use cases, clean rooms provide a secure way to generate insights from external data without exposing sensitive information. They enable a shift from data sharing to trusted collaboration. For Activation use cases, clean rooms provide a secure way to generate audiences that can be activated directly to an allowed destination. All this is achieved without exposing any personally identifiable information (PII) to either party.This marks a turning point in enterprise data architecture. Data clean rooms are no longer niche tools. They are becoming core infrastructure for federated, privacy-preserving, AI-ready data platforms.
## Stakeholder Personas and Technical Guardrails
A successful data clean room architecture is a multi-interface system designed to resolve the competing pressures of data utility, security, and speed. There are three primary personas whose distinct friction points must be addressed by the underlying technical design.
### The Privacy and Compliance Officer (The Risk Mitigator)
Privacy and compliance officers use the data clean room as a governance tool. Their primary concern is compliance drift, the risk that external collaboration environments fail to enforce the same rigorous standards as internal systems.
* **Friction Points:** Regulatory exposure (GDPR, CCPA, DMA) and "phishing" attacks where a partner attempts to triangulate a user's identity through repeated granular queries.
### The Data Scientist and Analyst (The Utility Optimizer)
Data scientists view the data clean room as a safe haven for advanced modeling. Their primary concern is utility preservation, ensuring that privacy measures don’t render the data statistically useless.
* **Friction Points:** High latency and restricted access to granular attributes needed for machine learning (ML), lookalike modeling, and churn prediction.
### The Marketing and Business User (The Value Realizer)
This persona is focused exclusively on time to value (TTV). Their concern is that data clean room projects often become technical bottlenecks requiring weeks of data engineering support.
* **Friction Points:** Complex setup processes, manual data cleaning, and the "blank page" problem of needing to write code to get simple overlap results.
### The “Business First” Persona Model
While traditional architectures focus on building the data layer before the user layer, our strategic approach, aligned with the "Business First" methodology, inverts this model. We prioritize a no-code to few-clicks approach that allows business users to generate insights and take immediate action.
**"Insight-to-Action" Workflow:** The architecture is designed as an active workspace rather than as a passive repository. By providing use case templates (for example, segment overlap, activation, and campaign performance), we enable business users to self-serve insights. This ensures that an insight, such as an optimized lookalike segment, is immediately available for activation across the marketing ecosystem without the need for a data engineer to manually move files.
**Zero-Copy Federation as a Strategic Asset:** To maximize TTV, the architecture adopts a zero-copy logic. Instead of the traditional ETL process, which introduces latency and security risks, our architecture federates queries directly to where the data resides (for example, Snowflake, BigQuery, or Amazon S3). This turns the organization's existing data investment into a strategic asset, allowing business users to act on the most current data in real-time while maintaining strict governance and eliminating the cost of data redundancy.
## Key Data Clean Room Use cases
Data clean rooms emerged in advertising as a response to cookie deprecation and privacy regulation, but have evolved beyond measurement into customer analytics, audience segmentation, and activation use cases across industries. According to the 2025 State of Retail Media report, 66% of organizations now use clean rooms in some capacity, driven by the need for privacy-safe collaboration that delivers measurable business outcomes.
The pattern is consistent across sectors: data stays with its owner, computation is governed, and only privacy-safe insights are shared.
### Marketing and Advertising: Measurement Without Third-Party Cookies
**The Challenge:** Marketers need to measure campaign effectiveness, avoid duplicate ad impressions, and optimize reach/frequency—but can no longer rely on third-party cookies or device identifiers.
**The Clean Room Solution:**
* Advertisers contribute hashed customer or campaign exposure data
* Publishers contribute impression and engagement signals
* Clean room computes reach, frequency, attribution, and lift
* Activation occurs via approved platforms without raw data exports
**Business Outcome:** Clean rooms provide closed-loop attribution linking ad impressions to actual transactions, incrementality analysis isolating true campaign lift, and unified measurement across channels —capabilities traditional digital advertising can’t offer.
**Industry Evidence:** Measurement is the most established clean room use case today, with major media networks like Pinterest, Disney, and Paramount creating their own clean rooms.
### Retail Media and CPG: Monetizing First-Party Data
**The Challenge:** CPG brands spend heavily on retail media but lack visibility into purchase outcomes. Retailers own rich point-of-sale data but can't expose it without violating privacy commitments.
**The Clean Room Solution:**
* Retailers and CPG companies combine point-of-sale data from retail locations with marketing data to optimize promotional activities
* Brands contribute hashed CRM or loyalty identifiers
* Clean room links ad exposure to in-store/online purchases
* Activation stays within retailer's media ecosystem
**Business Outcome:**
* Retailers monetize first-party data without selling raw customer information
* Brands gain closed-loop attribution showing which campaigns drove purchases
* Retail Media Networks scale without privacy risk
**Industry Evidence:** Retail Media Networks like Walmart's Luminate and Kroger Precision Marketing offer clean rooms that help CPG brands analyze customer behavior and optimize marketing strategies using retailer data.
### Financial Services: Collaborative Fraud Detection
**The Challenge:** Fraud networks operate across institutions, but banks can’t openly share customer or transaction data due to regulations like GLBA and emerging privacy laws.
**The Clean Room Solution:**
* Multiple banks pool anonymized data to identify patterns indicative of fraud, such as unusual cross-bank activity
* Federated analytics or models run across shared fraud signals
* No institution sees another's customer-level data
**Business Outcome:**
* Earlier detection of cross-institution fraud patterns
* Fewer false positives through richer signal sets
* Regulatory compliance without centralizing sensitive data
**Industry Evidence:** Financial services solutions from Experian and TransUnion offer clean room technologies enabling banks and insurers to collaborate on fraud detection and risk assessment while maintaining strict data privacy controls.
### Healthcare and Life Sciences: Research Without Patient Data Exposure
**The Challenge:** Pharmaceutical companies need real-world patient outcomes for drug development, but data resides in hospital EHR systems protected by HIPAA and similar regulations.
**The Clean Room Solution:**
* Doctors and pharmaceutical researchers share data within a clean room to learn how patients are reacting to treatments.
* Patient data remains within provider environments.
* Researchers run approved statistical analyses via a clean room.
* Differential privacy prevents re-identification.
**Business Outcome:**
* Statistically valid real-world evidence at scale
* Streamlined patient recruitment for clinical trials by matching anonymized patient data with trial criteria, finding eligible candidates without violating healthcare privacy laws
* Reduced dependence on limited clinical trial populations
**Industry Evidence:** Healthcare-focused clean rooms like Datavant provide HIPAA-compliant environments for researchers and healthcare organizations to securely analyze patient data for clinical trials and drug development.
### Cross-Industry Patterns: The Collaboration Imperative
Beyond these primary use cases, clean rooms enable:
* **Supply Chain Optimization:** Manufacturers and suppliers collaborate to share inventory details, production schedules, and demand forecasts, enabling better coordination while protecting proprietary information.
* **M&A Due Diligence:** When one company acquires another, due diligence requires examining financial projections and customer databases without sharing sensitive information directly; clean rooms reveal insights like customer segment alignment and compliance risks.
* **Media and Entertainment:** Publishers prove audience value to advertisers while protecting subscriber identities, enabling premium CPMs backed by trusted measurement instead of probabilistic targeting
Across AdTech, retail, financial services, healthcare, and media, Data Clean Rooms have become foundational trust infrastructure. They enable high-value collaboration that was previously blocked by privacy, regulatory, or competitive constraints. Clean rooms are **core architectural components** that enable secure, governed collaboration—unlocking insight and monetization without surrendering data control or compliance.
## Data Clean Rooms: The Foundation of Trusted Data Collaboration
A data clean room is a secure, governed environment that enables multiple parties to generate joint insights without exposing or exchanging raw data. Instead of replicating datasets, approved analytics, AI, and activation workloads execute in place, and only policy-compliant outputs are returned. Where activation requires individual-level records, data is delivered directly to the intended destination without being exposed to collaborating parties.
Architecturally, clean rooms shift collaboration from data sharing to controlled computation. Each participant retains custody of their data, while runtime enforcement governs query behavior, output constraints, consent, and usage policies.
Collaboration is further enabled through privacy-preserving identifier alignment mechanisms, allowing datasets from different parties to be correlated without exposing the underlying identifiers—a capability explained in more detail later in this document.
As a result, data clean rooms serve as foundational infrastructure for privacy-regulated, multi-cloud, AI-driven enterprises operating on zero-copy, federated data strategies.
Early data clean rooms followed a centralized “bunker” model. All participants were required to copy data into a neutral third-party environment for analysis. While straightforward in concept, this approach introduced significant friction. Data movement increased latency and cost, complicated legal and compliance agreements, and forced organizations to give up direct control of sensitive data. In regulated industries, these tradeoffs often made collaboration impractical.
Modern data clean rooms have evolved toward a distributed, federated model. Data remains in the owner’s environment, and analytics are executed in place through federated queries. The clean room itself functions as a governance layer that intercepts each query, enforces privacy and policy controls at execution time, and returns only approved, aggregated outputs.
Dimension
Traditional Clean Room ("Bunker" Model)
Modern Clean Room (Distributed/Federated Model)
Data Location
Data is copied into a centralized third-party environment
Data remains in the owner's environment
Data Movement
Requires physical transfer and duplication of datasets
No raw data movement, queries run in place
Control and Custody
Custody partially relinquished to third-party platform
Raw data ownership and custody retained by each party
Architecture Model
Centralized aggregation
Distributed, federated computation
Governance Enforcement
Policies applied after data is moved
Policies enforced at query execution time
Privacy Model
Relies heavily on contractual and procedural controls
Enforced technically through runtime controls and aggregation thresholds
Latency
Higher latency due to ingestion and synchronization
Lower latency, near real-time federated queries
Cost Structure
Higher storage, transfer, and duplication costs
Reduced duplication, ascompute occurs where data resides
Compliance Complexity
Complex legal agreements due to cross-boundary data movement
Simplified compliance since data doesn't leave source boundary
Scalability
Scaling requires more storage and data replication
Scales through distributed compute without duplicating data
Regulated Industry Fit
Often impractical due to custody and residency concerns
Better aligned with sovereignty, consent, and regulatory constraints
Salesforce Data 360 exemplifies this federation model. Publishers and advertisers can collaborate and run analyses across cloud platforms without raw data ever leaving the security boundary of the platform. Data custody is preserved, risk is reduced, and collaboration becomes faster and easier to scale.
This shift from shared data to shared computation redefines trust in enterprise collaboration. Clean rooms are no longer destinations where data is stored, but systems that govern how insight is safely produced.
### Building Enterprise-Grade Data Clean Rooms
To operate as a core architectural capability, an enterprise-grade data clean room must meet a small set of non-negotiable requirements.
#### Zero-Copy Architecture
The most fundamental requirement for data clean rooms is zero-copy architecture. Traditional data collaboration relies on ETL pipelines that copy data into shared environments. This increases latency, cost, security exposure, and regulatory risk, while creating multiple unmanaged copies of sensitive data.
A modern data clean room eliminates this problem. Data remains in its original system of record, whether it’s a cloud data warehouse, operational platform, or SaaS application. The clean room uses federated queries across these distributed sources and returns only approved, privacy-safe results.
By avoiding physical data movement, zero-copy clean rooms reduce attack surface, preserve data residency and ownership, and align naturally with data fabric and federated data architecture principles.
#### Interoperable Data Clean Rooms
Modern data strategy depends on the ability to collaborate without moving data. Salesforce Data 360 provides a flexible framework that connects your enterprise to the global data ecosystem through two primary models:
**Native Salesforce-to-Salesforce Connectivity :** In this model, collaboration occurs directly between two Salesforce customers. A shared metadata layer allows providers and consumers to connect instantly through simple configuration . This enables teams to generate joint insights without the delay or risk of replicating data, ensuring that information remains secure in its original location.
**External Salesforce-to-Cloud Integration (AWS and Snowflake):** In this model, collaboration occurs between Salesforce and external cloud environments. A zero-copy federation allows organizations to bridge different infrastructures without the cost or risk of data movement. This enables teams to resolve identity fragmentation and expand reach while keeping data in its resident cloud, maintaining centralized governance and eliminating egress fees.
#### Privacy-Enhancing Technologies (PETs)
Zero-copy and federated architectures prevent raw data from being moved or duplicated, but they don't, by themselves, guarantee privacy. In these models, the primary risk shifts from data storage to data computation.
Sensitive information can still leak through analytical outputs, even when only aggregated results are returned. Common attack vectors include repeated or overlapping queries (differencing attacks), analysis of very small populations, and inference using external knowledge. As a result, privacy concerns move beyond access control to a dynamic requirement for query execution.
Enterprise Data clean rooms must treat Privacy-Enhancing Technologies (PETs) as mandatory, system-level controls, not optional analytics features or policy guidance.
From an architectural perspective, this means:
* Privacy is enforced by the platform, not by analysts
* Controls are consistent across users, partners, and workloads
* Privacy guarantees are deterministic, repeatable, and auditable
* The system defines which computations are allowed, how results are shaped, and when queries must be blocked
##### Core PET Capabilities
**Differential Privacy:** Differential privacy (DP) provides a mathematical guarantee that the presence or absence of any individual doesn’t materially affect query results. In practice, this means the clean room automatically injects calibrated statistical noise into outputs and tracks a defined privacy budget for each dataset. Every query consumes part of this budget, and once it is exhausted, further queries are blocked.
For architects, the value of DP lies in provability. Privacy risk is quantitatively bounded, enabling defensible compliance and reducing reliance on subjective policy interpretation.
**Secure Identifier Alignment:** Many collaboration scenarios require identifying overlap across datasets, such as shared customers or accounts. Exposing raw identifiers would violate data minimization principles. A clean-room-grade architecture instead relies on deterministic hashing or tokenization performed within the cleanroom boundary. Comparisons occur without revealing raw identifiers to any party, enabling join-like behavior without data disclosure.
**Aggregation Thresholds and Result Suppression:** Even fully anonymized outputs can be compromised when results are derived from very small populations. To prevent this, an enterprise data clean room must enforce minimum aggregation thresholds and automatically suppress results that fall below them. These thresholds must be non-overridable, ensuring consistent protection against small-segment leakage.
Without Privacy-Enhancing Technologies (PETs) enforced at the execution layer, Data Clean rooms risk becoming trust-based environments that rely on human judgment and contractual agreements. By embedding PETs directly into the platform, privacy becomes a structural property rather than a procedural one. This enables collaboration to scale across teams and partners without renegotiating trust, while regulators and risk teams can evaluate guarantees using objective, mathematical measures rather than subjective policies.
For enterprise architects, PETs are the critical mechanism that elevates a data clean room from a secure sandbox to a trusted collaboration fabric, capable of supporting regulated, multi-party analytics and AI workloads at enterprise scale.
#### Audit Trail
In a multi-party collaboration, trust is maintained through visibility. An enterprise-grade data clean room must provide a "paper trail" of every interaction between the participants and the data.
**Query Logs**: Every SQL execution is logged, capturing the identity of the requester, the timestamp, and the specific query logic used.
**Policy Enforcement Logs:** The system must record not just what was queried, but which privacy policies (e.g. aggregation thresholds or Differential Privacy) were applied to the results.
**Zero-Tamper Records:** Using an Immutable Audit Trail (dedicated data model object), the data clean room ensures that logs can't be altered or deleted by any participant, providing a single version of truth for regulators.
## Enabling Modern Data Clean Rooms with Salesforce Data 360
Salesforce enables modern data clean rooms by allowing organizations to analyze and collaborate on data without ever sharing raw datasets. Built on a zero-copy, federated architecture with privacy, consent, and governance enforced at execution, Salesforce Data 360 ensures that insights are secure, compliant, and fully actionable. By embedding clean rooms directly into the enterprise data lifecycle, Salesforce Data 360 transforms them from niche analytical tools into scalable, trusted infrastructure for AI-driven and multi-party collaboration.
### Platform Foundations for Scalable Data Clean Rooms
At the infrastructure layer, Salesforce Data 360 runs on Hyperforce, Salesforce’s cloud-native runtime that abstracts hyperscaler resources (AWS, Azure, GCP) behind a unified control plane. This architecture allows data to remain in-region to satisfy sovereignty and residency requirements, while enabling governed clean room operations globally.
Critically, this foundation enables cross-cloud clean room collaboration, including native interoperability with AWS Clean Rooms. Using Data 360 as the orchestration and governance layer, enterprises can collaborate with partners operating directly on AWS without forcing data migration into Salesforce-managed storage. Queries are pushed down to the source, privacy rules are enforced consistently, and only compliant, aggregated results are exchanged across platforms.
Compliance and trust are enforced at the infrastructure and execution boundary, rather than retrofitted at the application layer—providing a durable foundation for multi-cloud, multi-party collaboration at scale.
### The Data 360 Pipeline from Ingestion to Activation
Data 360 implements a traceable, end-to-end data pipeline, ensuring that clean room operations run over harmonized, governed, and identity-aware data rather than raw extracts.
Key stages include:
* **Connect**: Data ingestion and virtualization via out-of-the-box connectors, APIs, SDKs, MuleSoft, or zero-copy connectors
* **Persist**: Storage of raw data in native formats (Parquet / Iceberg)
* **Harmonize**: Mapping to canonical Data Model Objects (DMOs) for consistent joins
* **Unify**: Identity resolution creates Golden Records
* **Derive Insights**: Calculated insights compute aggregated metrics inside the governed boundary
* **Act**: Governed outputs flow to Salesforce Orgs, marketing platforms, ad networks, external data platforms, **or other clean rooms**, closing the insight-to-action loop
This pipeline ensures clean rooms operate on enterprise-grade data, not ad-hoc extracts.
### Native Integration and “Clicks-Not-Code”
Unlike standalone data clean room platforms that require separate provisioning and SQL development, Salesforce clean rooms are natively embedded into Data 360\. This enables reuse of DMOs, identity rules, consent models, and governance policies, eliminating duplicate security layers.
Salesforce’s template-driven clean room model is a key accelerator, using:
* **Out-of-the-box templates** to support common collaboration patterns such as audience overlap, suppression, reach, and lift measurement.
* **Custom templates** that allow architects and advanced users to define reusable analytical logic tailored to industry-specific or partner-specific needs—without exposing raw data or policy complexity.
This approach standardizes collaboration while still allowing flexibility, enabling clean rooms to scale as a repeatable enterprise capability, not a one-off analytics project.
### The “Golden Path”- Closing the Insight-to-Action Loop
Data 360 addresses a common failure mode of traditional clean rooms: the Activation Gap. Its Golden Path framework ensures that insights generated inside a clean room can be acted upon immediately, without exporting raw data.
* **Setup and Discovery**: Partners share schema metadata and leverage templates to evaluate feasibility before contracts are finalized.
* **Analysis**: Pre-built and custom templates drive overlap analysis, suppression, lookalike modeling, and lift measurement, all executed inside the governed boundary.
* **Activation**: Approved segments are pushed directly into Marketing Cloud, ad platforms, or partner systems, with only aggregate, compliant results shared.
Templates become opinionated execution paths, ensuring collaboration moves predictably from analysis to activation.
## A Playbook for Salesforce Data 360 Clean Rooms
Deploying a Salesforce Data 360 Clean Room isn't just a configuration exercise—it is a disciplined architectural workflow spanning data readiness, governance design, secure connectivity, and operational monitoring.
### Step 1: Define the Collaboration Use Case (Start with Intent)
Before touching data or configuration, architects must clearly define:
* What question are we trying to answer?
* What outcome is expected? (e.g., overlap analysis, lift measurement, suppression, fraud detection)
* What level of aggregation is required?
* What regulatory or contractual constraints apply?
* What activation path will consume the results?
Understanding the collaborator’s objective shapes everything that follows – join keys, identity rules, governance thresholds, and cost modeling. Clean Rooms are purpose-built environments. hey should be designed around a defined analytical goal, not generic data exposure.
### Step 2: Preparing the data for Clean Room Collaboration
Before collaboration can begin, enterprise data must be structurally and semantically prepared. Clean rooms amplify both strengths and weaknesses in underlying data. Garbage in, garbage out is all the more true here.
**Ingestion:** Connect source systems such as Salesforce CRM, Marketing Cloud, AWS S3, and Google Cloud Storage to Data 360\. Wherever possible, use zero-copy connectors (for example, Snowflake) to avoid unnecessary movement or duplication of data.
**Semantic Mapping:** Map data streams to the Customer 360 data model. Standardize key fields like phone numbers (E.164 format), country/state codes (ISO standards), and email addresses. Misalignment (for example, one party using “CA” and another “California”) can silently fail joins and reduce match rates.
**Identity Resolution:** Configure deterministic (exact match) and probabilistic (fuzzy match) rules to create a Unified Individual (Golden Record). This unified entity is the surface for clean room matching.
The quality of identity resolution directly impacts collaboration value. Higher match accuracy increases overlap rates, analytical confidence, and reduces false negatives.
### Step 3: Provisioning the Clean Room
Once data is harmonized, the clean room itself must be provisioned to define collaboration boundaries.
**License Validation:** Confirm that all participating organizations have the necessary Data 360 and clean room entitlements.
**Data Space Scoping:** Clean room objects must be scoped to a specific data space. Only objects mapped to that data space are visible to the clean room. This ensures collaboration is logically isolated without requiring the creation of a new data space solely for clean rooms.
**Define Governance Rules:** Establish policies declaratively before queries are executed:
* **Aggregation Thresholds:** for example, a minimum of 100 records per output
* **Join Keys:** for example, Email\_Hash\_SHA256
* **Allowed Operations:** only aggregate functions such as COUNT, SUM, AVG
* **Explicit Restrictions:** block row-level exports (SELECT \*)
Governance rules are enforced at execution time, making privacy and compliance system-level properties rather than procedural guidance.
### Step 4: Establishing Secure Multi-Party Connectivity
Clean rooms often span organizational and platform boundaries. Connectivity must be explicit and tightly controlled.
**Account Linking:**
* **Salesforce-to-Salesforce:** Use Data Cloud One or approved cross-org sharing mechanisms.
* **Multi-cloud scenarios:** Validate region alignment and residency before queries are enabled.
**Authentication and Authorization:** Configure OAuth-based access for dedicated integration users with the Principle of Least Privilege—limit access strictly to necessary data spaces and avoid administrative permissions.
Security failures often result from over-permissioned integration users rather than weaknesses in cryptography or platform controls.
### Step 5: Running, Monitoring, and Controlling Clean Room Workloads
Once live, focus shifts to operational oversight, query quality, and cost management.
**Query Execution:** Analysts or workflows perform overlap analysis and aggregations via Calculated Insights or approved SQL interfaces. All queries automatically enforce aggregation thresholds and privacy controls.
**Audit and Traceability :** Salesforce Data 360 clean rooms provide audit trails in the form of an audit data model object (DMO). This captures metadata about query activity, including who executed the query, when it was run, and what policies were applied. Audit DMO enables compliance reporting, governance validation, and forensic traceability — ensuring collaboration is both privacy-safe and reviewable.
**Consumption Monitoring:** Data Cloud uses a consumption-based credit model. Key drivers include:
* Rows processed (for example, 1M rows \= baseline credit unit)
* Query complexity
* Identity resolution operations (higher multiplier)
* Batch ingestion (lower multiplier)
**Digital Wallet and Alerts:** Use Digital Wallet to track real-time consumption and configure alerts at 50%, 75%, and 90% thresholds. Correlate spikes with specific workloads to avoid unexpected costs.
Note that zero-copy doesn’t eliminate compute costs. While physical duplication is removed, execution occurs at the source system. Architects must manage query patterns, join selectivity, and execution frequency to control cost and performance.
## Governance, Security, and Compliance
### Architecting Clean Rooms for Trust at Scale
In modern enterprises, trust isn't bolted onto a data clean room. It is an architectural outcome. Salesforce Data 360 enforces governance, security, and compliance continuously and automatically, shifting clean rooms from policy-driven environments to platform-governed systems.
Execution-time controls (locked identities, audit trails, and differential privacy) apply consistently whether collaboration occurs within Salesforce, across partners, or across clouds.
### Execution-Time Trust and Governance
The most important shift for architects is that trust is enforced during execution, not assumed beforehand. Salesforce Data 360 achieves this through a number of core platform controls:
* **Locked Identity:** Partner access is cryptographically tied to verified Salesforce Org identities, preventing spoofing or unauthorized participation.
* **Audit Trails:** Every query, join, segment overlap, and activation is logged for full auditability and regulatory compliance.
* **Differential Privacy:** Row-level inspection is structurally impossible. Outputs are aggregated and statistically bounded. Collaborators see only privacy-safe results, such as reach metrics or lift percentages, never individual transactions or identities.
These controls replace contractual trust with mathematical guarantees and platform-level enforcement, reducing operational and legal risk.
### AI Governance Through the Einstein Trust Layer
As AI agents increasingly interact with Clean Room data, Salesforce introduces the Einstein Trust Layer. It acts as an architectural airlock between sensitive enterprise data and external LLMs. This ensures clean room insights can safely power AI-driven decisioning without exposing underlying data.
**Key capabilities:**
* **Zero Data Retention:** Data sent to LLMs is ephemeral. Model providers can't store prompts or responses for training.
* **Toxic Language Detection and PII Masking:** Inputs and outputs are automatically scanned, and PII is masked according to Data Masking Policies configured in Data 360.
### Logical Isolation Through Data Spaces and Permission Sets
**Data spaces** provide logical isolation within an org and should align with regulatory, geographic, and partnership boundaries like:
* EU Data Space
* North America Data Space
Only datasets assigned to a data space are visible within its clean rooms, preventing accidental cross-boundary exposure.
Permission sets offer fine-grained control over who can create or manage clean rooms, execute queries, or activate segments. Data-aware permissions enforce field-level restrictions within data model objects—for example, marketers may see segment names and audience size but not income or health indicators.
Security is enforced at the semantic layer, allowing safe self-service for business users without constant IT oversight.
### Compliance and Consent by Design
Consent signals propagate automatically through Data 360 into clean room execution. Users who revoke consent are excluded from analysis and activation by default—ensuring compliance is system-enforced, not manually policed.
Salesforce Data 360 treats governance, security, and compliance as first-class architectural primitives, not optional add-ons. By combining execution-time auditability, locked identities, differential privacy, data spaces, consent-aware identity resolution, and the Einstein Trust Layer, enterprises can scale clean room collaboration across partners, multi-cloud systems, and AI-driven workloads—all without compromising trust, privacy, or regulatory compliance.
## Conclusion and Path Forward
### A Practical Path Forward for Architects
To capture the full value of data clean rooms, architects must treat them as core architectural infrastructure, not as isolated analytics tools. The following priorities define a pragmatic and scalable path forward:
**Make Collaboration a First-Class Architectural Concern :** External data collaboration should be designed with the same rigor as internal integration. Clean rooms should be embedded within enterprise reference architectures alongside data platforms, integration layers, and AI systems—not deployed as ad hoc extensions. As interoperability expands (for example, Data 360 clean room integration with AWS clean rooms and future cross-clean-room compatibility), architects must design collaboration patterns that anticipate multi-platform ecosystems rather than single-vendor silos.
**Design for Privacy by Default at Source**
**Design for Data Fluidity : **Rather than defaulting to heavy ETL and central replication, architects should first consider federation and zero-copy access. Moving computation to data (when appropriate) reduces unnecessary duplication, lowers cost, and preserves source-of-truth integrity. “Connect vs. copy” should be a conscious architectural decision, not an inherited habit.
**Close the Insight-to-Action Gap :** Clean rooms that stop at analysis fail to deliver business value. Architectures must natively connect clean room outputs to activation systems and AI workflows. Feedback loops, performance measurement, and downstream execution must be designed from the outset.
**Prepare for the Agentic Enterprise :** As AI agents increasingly use enterprise data, clean rooms will serve as controlled execution environments where agents can operate without exposing raw data. Architects who align clean room strategy with AI governance and trust frameworks will be best positioned for this next phase.
### Conclusion
Modern data clean rooms represent a fundamental shift in enterprise data architecture. They resolve the long-standing tension between data utility and privacy by enabling collaboration without data exposure.
Architectures such as Salesforce Data 360 demonstrate that this tradeoff is not an “either-or” consideration. By decoupling data storage from activation through zero-copy patterns, and by embedding privacy-enhancing technologies directly into execution, enterprises can collaborate on high-value analytics without relinquishing control of their data. Privacy moves from contractual obligation to architectural guarantee.
Most importantly, clean rooms transform data from a static, siloed asset into a governed, actionable resource. When connected natively to activation and AI layers, insights no longer stall in dashboards. They flow directly into decisions, campaigns, and autonomous systems—closing the loop between data, action, and outcomes at enterprise scale.
## About the Authors
**Yugandhar Bora** is a Software Engineering Architect at Salesforce, specializing in data architecture within the Data and Intelligence Applications platform. He leads enterprise architecture review board (EARB) initiatives focused on data governance and unified data models, while contributing to automated platform provisioning solutions.
**Birendra Kumar Singh** is a Principal Member of Technical Staff, specializing in platform and data architecture within the Data 360 at Salesforce. He is a core member of the Activation Platform and leads the Clean Room initiative focused on providing data clean room infrastructure to Data 360 customers.
**Priyanka Kshirsagar** is a Senior Product Manager at Salesforce, leading Data 360 Clean Rooms — a capability she built from the ground up to enable enterprise customers to collaborate on first-party data in a privacy-preserving environment. She drives the vision for agentic AI and ML-powered use cases, including lookalike modeling and identity enrichment on clean rooms, and has taken the product through General Availability and a Tier-1 Dreamforce launch.
## Overview
Enterprises handle a wide range of document types, including invoices, purchase orders, legal contracts, and technical manuals. Manual processing is slow, error-prone, and consumes an estimated 15–25% of employee time. Earlier automation approaches (for example, _Robotic Process Automation (RPA)_, _Optical Character Recognition (OCR)_, and workflow tools) reduced some of the burden, but produced rigid pipelines, high maintenance overhead, and siloed adoption across individual business teams.
Documents carry rich structural context (for example, table hierarchies, spatial field relationships, and cross-referenced sections) that flat-text processing can't preserve. Stripping a document to plain text discards the business context that makes extraction accurate and useful, which degrades the quality of downstream analytics, _Artificial Intelligence (AI)_ inference, and process automation.
To be effective, _Intelligent Document Processing (IDP)_ systems must classify documents by type, extract structured data accurately from variable layouts, and deliver that data in a governed, queryable form to downstream systems. IDPs must also handle document variability at scale without requiring per-template configuration for every new document format, and they must be centralized and accessible across business units. This challenge is compounded by the sheer volume of the key issue\: unstructured data accounts for approximately 80% of all enterprise data, and the majority accumulates in document form across file systems, Cloud storage, and content repositories that are outside the reach of _Customer Relationship Management (CRM)_ systems, AI agents, and analytics platforms.
_Data 360 Document AI_ is the Salesforce document processing capability within _Data 360_, which is designed to address this gap. It extracts, classifies, and analyzes unstructured and semi-structured document content using _Large Language Models (LLMs)_, _Optical Character Recognition (OCR)_, _Natural Language Processing (NLP)_, and _Machine Learning (ML)_. The output is structured, governed, and queryable data that integrates into the _Data 360_ pipeline where _Agentforce_ agents, analytics tools, and automation workflows can access it via standard interfaces without requiring custom extraction or transformation layers.
## Why Does Document AI Matter?
Enterprise data platforms process structured, tabular data. However, the majority of enterprise data arrives as documents and remains inaccessible to CRM, ERP, AI agents, and analytics pipelines until someone manually extracts it. This is an architectural gap, not a workflow problem.
### Limitations of Rules-Based Extraction
Earlier approaches combined manual re-keying, rules-based OCR, and RPA scripts. These methods worked on a small scale, but they couldn't handle the volume, variety, and velocity of the types of documents that modern enterprises generate. Rules-based tools require explicit templates per layout variant. Any format change breaks extraction and requires a developer, a new template, and a deployment cycle.
At scale, this produces fragile point solutions with no centralized governance, shared schema, and path to AI-readiness. Inconsistent extraction pipelines propagate downstream. In other words, analytics inherit data inconsistencies, AI models produce unreliable outputs, and regulated content like _Personal Health Information (PHI)_ and _Personally Identifiable Information (PII)_ lack systematic governance.
### AI-Native Document Processing
LLMs extract fields without explicit templates. A single schema configuration governs extraction across layout variants, languages, and formats, which adapts to the document rather than requiring the document to conform to a fixed structure. This shifts document processing from a maintenance-heavy, siloed operation to a governed, centralized capability.

_Data 360 Document AI_ operationalizes document processing within the _Data 360_ platform via two pipelines.
- The _Batch Pipeline_ routes extracted data through ingestion, identity resolution, calculated insights, activations, analytics, and Agentforce activation.
- The _Transactional Processing Pipeline_ exposes a REST API that returns structured _JSON_ synchronously, which allows architects to route document-derived data to Salesforce _SObjects_, the _Data 360 Data Lake Object_/_Data Model Object (DLO/DMO)_ pipeline or external databases and warehouses without batch setup overhead.
In both cases, extracted data enters a governed, schema-driven model rather than a fragmented set of point tools.
## Product In Scope
[Data 360 Document AI](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai.htm&type=5) is the Salesforce native _Intelligent Document Processing (IDP)_ capability within the _Data 360_ platform. It converts unstructured and semi-structured document content into governed, queryable data that fully participates throughout the entire _Data 360_ lifecycle.
## What Is Data 360 Document AI?
[Data 360 Document AI](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai.htm&type=5) is the Salesforce native _Intelligent Document Processing (IDP)_ capability within _Data 360_. It ingests unstructured and semi-structured documents, extracts structured data using a declarative schema configuration, and delivers that data to the _Data 360_ pipeline for harmonization, identity resolution, analytics, and Agentforce activation.
Data 360 Document AI supports two processing modalities\:
- **Bulk batch Processing\:** Processes large document sets that are defined in _Unstructured Data Model Objects (UDMOs)_ on an event-driven basis.
- **Transactional Processing\:** Processes a single document via REST API and returns a structured _JSON_ payload synchronously. Architects can then route that payload to the _Data 360 DLO/DMO_ pipeline, Salesforce _SObjects_, or external databases and warehouses via _MuleSoft_, _Apex_ callouts, or _Einstein Trust Layer (ETL)_ pipelines. The target tier is an architectural decision driven by latency, governance, and data residency requirements.
Document AI currently supports PDF files, image files (JPEG, PNG), and handwritten documents.
## Core Components
_Data 360 Document AI_ assembles four processing technologies into a single governed pipeline. Each component handles a distinct stage of the document-to-data lifecycle\:
- **Optical Character Recognition (OCR)\:** Converts scanned images, handwritten content, and image-based PDFs into machine-readable text before LLM processing. A minimum of 150 DPI is recommended for reliable extraction.
- **Large Language Models (LLMs)\:** Route extraction through the _Einstein_ LLM gateway using the user-chosen model. The LLM receives OCR output alongside the _JSON_ schema configuration and returns a structured extraction payload. _Gemini_ and additional models are being planned for future implementation.
- **Natural Language Processing (NLP)\:** Performs contextual understanding, entity recognition, date parsing, and semantic field extraction directly within the LLM via structured prompt engineering—the schema-defined prompt and OCR output serve as the sole inputs. All LLM interactions are routed through the ETL, which enforces zero data retention with model providers and masks _PII_ in text-based inputs before they reach the model. No separate NLP engine is employed.
- **Multi-Modal Processing\:** Processes embedded images within PDFs as separate extraction inputs, which allows the LLM to extract data from diagrams, image-rendered tables, and mixed-content pages that OCR alone can't parse.
In addition to the four processing technologies, _Document AI_ also handles\:
- **Einstein Trust Layer\:** Routes all LLM interactions through the ETL, which enforces zero data retention with model providers and masks _PII_ before inputs reach the LLM with the exception of multimodal data (for example, attached documents that are processed via _Document AI_) where PII masking isn't currently supported and data is sent as-is to external models. The ETL only governs the LLM interaction path. Extracted data that's written to _Data Lake Objects (DLOs)_ is stored as-is; field-level masking at rest must be addressed through downstream data governance controls.
- **File Size Limits\:** _Document AI_ processes files up to 10MB per request. LLM context length limits may further constrain processing for dense, multi-page documents within this boundary.
## Key Architectural Principles
Enterprise architects that are deploying _Data 360 Document AI_ should apply these principles before committing to an implementation design.
- **Select the pipeline before designing the schema.** The _batch_ and _transactional_ processing pipelines differ in ingestion model, schema binding, target flexibility, and latency. It's important to confirm which pipeline each use case requires before defining the schema as retrofitting adds avoidable rework.
- **Design schemas at the document-type level.** Using a single, well-crafted schema per document type is more maintainable than using per-use-case configurations, and it's also the largest lever for extraction quality. Doing this correctly requires using a diverse set of documents—including edge cases—rather than designing from a single example. Use prompts iteratively at the _field_, _table_, and _schema_ levels to find gaps, and then test and refine them against multiple document samples before finalizing. Keep in mind that a schema that works well on one document may fall short on others, so breadth and iteration are essential. Schema flexibility—including removing columns that don't reliably extract across document types—is equally important. Holding on to fields that introduce noise or inconsistency undermines the overall extraction quality, so it's important to treat column removal as a first-class design decision.
- **Choose the correct target tier per field group.** Fields that are driving CRM workflows or approvals write to _SObjects_. Fields that are enriching the unified profile or feeding analytics belong in the _DLO/DMO_ pipeline. Fields that are serving external systems belong in the _RDBMS_ tier. Keep in mind that a single schema may fan out to multiple tiers simultaneously.
- **Enforce governance before processing regulated content.** Regulated data needs protection at every layer. That's why it's important to configure _PII_ masking, data classification tags, and _Attribute-Based Access Control (ABAC)_ after extracted data is stored in the output _Data Lake Objects (DLOs)._ This provides fine-tuned enforcement and context-aware access that's based on data classification, user role, and organizational context. _Governance_ is split across two paths\: the _ELT_ governs the LLM interaction, while the extracted data that's stored in DLOs must be governed separately—directly at the DLO and database levels—through _Data Space_ configurations, _Permission Sets_, and _ABAC_ policies. These controls must maintain consistency at the storage tier—not only the application layer—so access restrictions remain intact regardless of how data is accessed after ingestion. Keep in mind that gaps in any layer may expose regulated data downstream even when others are correctly configured.
- **Design for failure modes before production.** Address null field handling, OCR quality thresholds, file size pre-validation, LLM context overflow, RDBMS write idempotency, and credit budget limits before the first production batch run. These aren't edge cases—they're predictable failure surfaces that must be explicitly handled in pipeline design, not discovered during runtime.
- **Treat confidence scores as a first-class routing signal, not a diagnostic afterthought.** Extraction results carry field-level confidence values that are derived from the log probabilities (logprobs) of the underlying model output. For every extracted field, table, or column, the score reflects the model's token-level certainty of the extracted value. This makes confidence scores a statistically grounded signal that's reliable enough to serve as the primary gate for _Human-in-the-Loop (HITL)_ escalation thresholds. Use confidence scores to systematically identify low-quality extractions and initiate HITL checkpoints for low-confidence field values, ambiguous schema matches, or repeated pipeline failures instead of relying on heuristics or manual spot-checks. When automated recovery isn't possible, HITL-backed confidence scoring ensures that human judgment is applied exactly where it's needed.
- **Design activation paths in parallel with schema design.** The value of _Document AI_ comes from being able to activate extracted data within Salesforce workflows and agents. It allows you to design Agentforce _Actions_, _Flows_, and _Calculated Insights_ alongside extraction schema design, not after.
## Architecture\: Data 360 Document AI Pipeline
_Document AI_ operates within two pipelines\:
- A _batch_ pipeline for high-volume, UDMO-backed processing
- A _transactional_ _processing_ pipeline for real-time, API-driven extraction
Both pipelines share the same schema configuration contract and ETL governance, but they differ in how documents enter the system and where extracted data lands.
Let's take a closer look at each pipeline.
### Batch Processing Pipeline
The _batch_ pipeline processes recurring document sets that are defined by a UDMO. It suits scheduled or event-driven use cases where documents are ingested from enterprise storage, then pass through document extraction, and are delivered to the _Data 360 DLO/DMO_ pipeline for harmonization, identity resolution, and activation.
**Real-World Scenario**
Each day, an insurance carrier receives thousands of medical claim documents from provider portals that are uploaded as PDFs into _Amazon S3_. The UDMO defines the in-scope document set and sends all claim PDFs to the `/claims/incoming/` bucket within a 24-hour window.

#### Stage 1\: Ingest
Documents are ingested into _Data 360_ from enterprise source systems without physical duplication. Supported sources include _Amazon S3_, _Google Cloud Storage_, Salesforce CRM file objects, _MuleSoft-orchestrated_ pipelines, and direct API uploads. In _AIforce_ deployments, documents are ingested via cloud storage connectors or the _Ingestion API_, which bypasses the CRM layer. The _Model Context Protocol (MCP)_ server exposes ingestion as a callable tool for external AI agents and LLM clients.
Upon ingestion, raw documents are stored as _Unstructured Data Lake Objects (UDLOs)_, which map to the physical location and metadata of each document without moving or transforming the source file.
**Example\:**
Claims PDFs are ingested from _S3_ into _Data 360_ via the cloud storage connector. Each document is stored as a UDLO that points to the _S3_ object. No physical duplication occurs.
#### Stage 2\: Extract
_Document AI_ processes each UDLO against a schema configuration that defines which fields to extract along with their target data types. The UDMO defines which documents are in scope. The LLM (_GPT-4o_, _Gemini_, or _Claude_) reads each document and returns a structured extraction payload.
**Example\:**
_Document AI_ processes each UDLO against a claims schema that defines fields like\: ClaimID, PatientName, DiagnosisCode, BillingAmount, and ServiceDate. LLMs then read each PDF and return a structured extraction payload.
#### Stage 3\: Persist
Once the data is extracted, it persists into DLOs, which are the raw storage layer of _Data 360_. DLOs retain extracted fields without imposing business logic, which preserves an accurate physical representation for downstream transformation and traceability. The UDLO retains a reference to the source document to enable field-level lineage at any point in the pipeline.
**Example\:**
All extracted fields land in a _Claims DLO_, which preserves a raw, accurate representation of each claim with full lineage that can be traced back to the source PDF.
#### Stage 4\: Harmonize
DLO fields map to DMOs that align with the standard _Customer 360 Data Model_. This is the boundary where document-derived data transitions from raw, extracted fields to business-meaningful entities. The _Invoice DLO_ maps to an _Invoice DMO_, and fields like _CustomerID_ and _BillingAmount_ become join keys and match attributes within the unified data model. Harmonized document data participates in segmentation, _Calculated Insights_, and activation via the same interfaces that are used by CRM and transactional data.
**Example\:**
The _Claims DLO_ maps to a _Claims DMO_. The PatientID and PolicyNumber fields become join keys that link claim records to unified patient profiles.
#### Stage 5\: Unify
Harmonized DMO data participates in identity resolution. Extracted fields (for example, customer names, email addresses, or account numbers) serve as match keys for linking document records to _Unified Individuals (Golden Records)_, which closes the document-to-profile gap.
**Example\:**
Extraction fields (for example, PatientName, DateOfBirth, and PolicyNumber) serve as match keys for identity resolution, which links claim records to the correct _Unified Individual_. This occurs even if the same patient appears under slightly different name spellings across documents.
#### Stage 6\: Derive Insights
Architects define _Calculated Insights_, which are aggregated metrics that are computed across harmonized document data (for example, the total spend from various invoice line items, contract renewal risk scores, and claim severity indices).
**Example\:**
_Calculated Insights_ compute TotalClaimsPerPatient, AverageClaimAmount, and HighRiskClaimScore across harmonized claim data for Agentforce queries.
#### Stage 7\: Act
Harmonized, identity-resolved data is accessible to Agentforce Agents, _Tableau_, marketing platforms, and Salesforce _SObjects_. The target tier is an architectural decision that's driven by latency, governance, and data residency requirements.
**Example\:**
A _Claims Adjudication Agentforce Agent_ queries the _Data 360_ DMOs and CIs to find high-risk claims for priority review. _Tableau_ dashboards show claim volume and anomaly trends. Approved claim records circle back to the _Claims SObject_ to initiate payment workflows.
In _AIforce_ architectures, activation routes directly to external systems via the _Query API_, _Pub/Sub API_, or Cloud data warehouse activation targets. Then, the MCP server finds harmonized document data and _Calculated Insights_ as callable tools for external AI agents.
### Transactional Processing Pipeline
The _transactional processing_ pipeline handles single-document extraction at runtime without a UDMO or pre-ingested UDLO, which suits event-driven use cases (for example, a customer uploading a form, an agent receiving a PDF, or an external system initiating extraction within a transactional processing workflow). ETL governance applies to both pipelines identically.
**Real-World Scenario**
While applying for a loan, a bank customer uploads a PDF of their utility bill via the bank's mobile app. The event initiates extraction in real time, which means that no pre-ingested UDLO or UDMO is involved.

#### Stage 1\: Define Schema Configuration
Before invoking the API, architects must define and store a schema in _Data 360_ that specifies the fields, data types, and extraction instructions in _JSON Schema_ format. Each schema is assigned a unique _schema ID_. At runtime, the calling application references the schema ID to keep the extraction logic centralized in _Data 360_ rather than embedding it in application code.
**Example\:**
The bank's team has a pre-defined `ProofOfAddress` schema in _Data 360_, which specifies fields like `CustomerName`, `AddressLine1`, `City`, `PostCode`, and `DocumentDate`. This information is stored as a versioned configuration that can be referenced by a _schema ID_.
#### Stage 2\: Submit Documents
The calling application submits the document and schema ID in a single REST API request as a base64-encoded payload or file reference. No UDLO ingestion is required. _Document AI_ applies the document extraction and returns the structured output based on the provided schema.
**Example\:**
The mobile app submits the utility bill as a base64-encoded payload alongside the `ProofOfAddress` schema ID in a single REST API call. This process doesn't require a UDLO ingestion step.
#### Stage 3\: Extract
The LLM processes the OCR output against the schema and returns a structured JSON payload synchronously. Fields that aren't found in the document are returned as _null_. The caller owns the full JSON response and proceeds to routing.
**Example\:**
_Document AI_ applies OCR to the PDF and the LLM returns a structured JSON payload with extracted address fields. Fields that aren't found (for example, if the `PostCode` is missing from the bill) are returned as _null_.
#### Stage 4\: Route to Target (Optional)
Once extracted, the JSON payload can be routed to one or more target tiers depending on the use case\:
- **Salesforce SObject\:** Maps directly to _SObject_ fields via _Apex_ or _Flow_ for CRM workflows and approvals.
- **Data 360 DLO/DMO Pipeline\:** Routes into a DLO for harmonization, identity resolution, _Calculated Insights_, and Agentforce grounding.
- **External RDBMS or Data Warehouse\:** Routes via _MuleSoft_, _Apex_ callout, _Platform Events_, or ETL for systems that are outside of Salesforce.
- **Custom Integration\:** Returns structured JSON payloads to the calling application for storage in any external system or data store.
- **Downstream Flow or Agent\:** Passes the structured JSON output directly to a downstream flow or agent without any persistence into a _SObject_. This is a common pattern for customers who use _Document AI_ as a real-time extraction step within a larger automation or agentic workflow.
Keep in mind that a single schema may fan out to multiple tiers simultaneously, with different field groups routing to different targets from the same extraction point.
**Example\:**
A `ProofOfAddress` payload may fan out to three tiers at once (for example, `CustomerName` and `AddressLine1` write to the _Contact SObject_), which initiates an address verification _Flow_. Then, the full payload routes into a DLO for harmonization and risk scoring, and a copy routes to the bank's KYC system via _MuleSoft_ for regulatory compliance logging.
#### Stage 5\: Act
Once it's written, extracted data activates within the target system immediately. For _SObject_ targets, the triggers, flows, and approval processes are activated in the upserted record. For _DLO/DMO_ targets, data enters the _harmonization and identity resolution_ pipeline and Agentforce context. For external _RDBMS_ targets, data is available to downstream queries as soon as the write completes.
**Example\:**
The _address verification Flow_ immediately activates in the upserted _Contact_ record, which advances the loan application to the next stage. The Agentforce _loan officer Agent_ finds the verified address from the _Data 360_, and the KYC system records the document submission for audit purposes.
## When Should You Use Document AI?
_Document AI_ is best suited for specific architectural conditions. Applying it outside of those conditions introduces unnecessary complexity and additional costs.
As architects, it's important to evaluate this criteria before committing to _Document AI_ as the extraction mechanism.
**Use Document AI when\:**
- **Documents are the primary data source.** The required information exists only in document form and is unavailable from a structured API or database (for example, scanned contracts, lab reports, intake forms, or insurance claims).
- **Document layouts vary across sources.** The same document type arrives from multiple vendors, partners, or regions with different field positions and formats. Schema-driven LLM extraction adapts without per-layout maintenance.
- **Extracted data must feed Data 360 or Agentforce.** Extraction must participate in identity resolution, _Calculated Insights_, or Agentforce grounding. _Document AI_ is delivered directly into the _DLO/DMO_ pipeline without a separate ETL layer.
- **Volume justifies governed automation.** Document volume exceeds what manual processing can handle without measurable labor costs or data quality risks.
- **Documents contain regulated content.** _PHI_, _PII_, or financial data must route through a zero-data-retention, PII-masking layer before reaching an LLM. The ETL satisfies this natively. Customers who require no extracted content to be persisted at any point should also consider the _transactional API_ flow, which returns structured output directly to the calling application without writing to any _SObject_ or data store.
- **The use case is event-driven.** A document arrives at runtime (for example, a customer upload, an agent PDF attachment, or an external system trigger). The _transactional processing_ pipeline handles synchronous, single-document extraction without batch setup.
**Don't Use Document AI when\:**
- **Source data is already structured.** If the upstream system exposes a REST API, database table, or structured file (for example, CSV, JSON, or XML), use a standard _Data 360_ connector. Running structured data through an LLM extraction pipeline adds latency and credit costs without additional benefits.
- **Documents are machine-generated with a fixed schema.** System-generated PDFs from a known ERP or billing platform with a stable layout are better suited for a deterministic parser. LLM extraction is designed for variability, and applying it to fixed-schema documents wastes context and credits.
- **Accuracy requirements exceed LLM confidence thresholds.** _Document AI_ doesn't guarantee 100% extraction accuracy. Use cases where a missed or incorrect field value carries significant financial, legal, or clinical risk requires an HITL validation step. Don't use _Document AI_ as the sole extraction layer for high-stakes decisions without a validation workflow.
- **Documents exceed platform constraints.** The current 10MB file size limit and LLM context length constraints make _Document AI_ unsuitable for large or dense documents without pre-processing to split and reassemble them outside of the platform.
- **Note\:** At Salesforce, we're actively improving these acceptance guardrails to expand supported file sizes, page counts, and file extensions. Constraints will continue to evolve moving forward.
## Use cases\: Review The Patterns in Practice
### Batch Pipeline Use Cases
Let's take a closer look at several scenarios that use the _Document AI batch_ pipeline backed by a UDMO source object. In these instances, extracted data routes through the _Data 360 DLO/DMO_ pipeline for harmonization, identity resolution, _Calculated Insights_, and Agentforce activation. Each use case is best suited for scheduled or event-driven, high-volume document processing.
**Agentforce Sales\: Contract and Invoice Intelligence**
_Contract_ PDFs are ingested from Cloud storage via the _batch_ pipeline. The schema extracts ContractValue, RenewalDate, PaymentTerms, and CounterpartyName, and then maps them to the _Account_ and _Contract_ DMOs. _Calculated Insights_ derive renewal-risk scores. Agentforce alerts account executives before renewal windows close, which eliminates manual contract review and missed renewals.
**Agentforce Service\: Case Deflection and Knowledge Grounding**
_Survey_ PDFs and case attachments are ingested via the _batch_ pipeline. The schema extracts sentiment indicators, issue categories, and resolution notes, and then maps them to the _Case_ and _Knowledge Article_ DMOs. Agentforce queries the harmonized knowledge base when the case opens and locates relevant troubleshooting steps, which reduces Agent search overhead.
**Agentforce Health\: Clinical Document Processing**
Lab reports, intake PDFs, and handwritten clinical forms are ingested via the _batch_ pipeline. The schema extracts fields—including _PatientID_, _DiagnosisCode_, _MedicationName_, and _TestResult_—and then maps them to the _Health Cloud_ DMOs, which supports HIPAA-aligned care coordination and clinical research workflows.
**Financial Services\: Loan and Tax Document Automation**
Loan applications, tax returns, and income statements ingest via the batch pipeline. The schema extracts fields—including AnnualIncome, TaxYear, and EmployerName—and then maps them to the _Financial Account_ DMOs. _Calculated Insights_ join document-derived income data and CRM data to facilitate automated credit-risk scoring. Agentforce locates the extracted loan details inline during customer service interactions. This pattern directly supports the [Loan Prequalification Agent](https://developer.salesforce.com/developer-centers/agentic-enterprise-solutions) use case that's published on the Salesforce _Agentic Enterprise Solutions_ developer center.
**HR\: Workforce Document Processing**
Onboarding documents, tax forms, and certification PDFs are ingested via the _batch_ pipeline. The extracted fields are mapped to the _Employee Record_ DMOs, and then linked to the _Unified Employee_ profile. Specific _Flows_ initiate onboarding tasks and compliance checks based on the extracted data. This pattern directly supports the [Automate Resume Processing](https://developer.salesforce.com/developer-centers/agentic-enterprise-solutions) Agentic use case. _Document AI_ extracts skills, employment history, and qualifications from resume PDFs, which Agentforce then uses to match candidates against open-role criteria and route them to hiring workflows.
**Professional Services\: Proposal and Research Intelligence**
Proposal decks and research reports are ingested via the _batch_ pipeline. Extracted frameworks, benchmarks, and engagement summaries are mapped to custom DMOs, and then indexed for vector search. Agentforce retrieves contextually relevant recommendations at query time, which are grounded in extracted document content. This pattern extends the [Ground Agentforce on Website Content](https://developer.salesforce.com/developer-centers/agentic-enterprise-solutions) pattern. Documents are indexed via _Document AI_ and serve the same grounding function for Agent responses as website content that's indexed via _Data 360_ connectors.
**HIPAA Compliance Status\:**
The _Health Cloud_ patterns described in this paper apply ETL controls (for example, zero data retention and PHI masking) for text inputs. These controls alone don't constitute HIPAA certification. Architects that are designing for regulated clinical environments must confirm current HIPAA certification status with the Salesforce compliance team before committing to a _Document AI_-based architecture within those contexts.
### Transactional Processing Pipeline Use Cases
Let's take a closer look at several scenarios that invoke the _Document AI_ REST API with a schema that isn't bound to a UDMO. Extracted JSON payloads route directly to external systems synchronously at runtime.
**Supply Chain\: Vendor Invoice Processing to ERP**
When a _vendor invoice_ PDF arrives in a monitored storage bucket or email gateway, an event trigger calls the _Document AI_ REST API with the invoice and a pre-defined schema ID. The schema extracts the VendorID, InvoiceNumber, LineItems, TotalAmount, TaxAmount, and DueDate. The JSON payload routes via _MuleSoft_ to the _ERP Accounts Payable_ module with _null_ field validation and idempotent upsert logic, which eliminates template maintenance for supplier format variability.
**Legal Operations\: Contract Review to CLM**
When a _contract_ PDF is uploaded to the legal portal, the backend calls the _Document AI_ REST API synchronously. The schema extracts the GoverningLaw, IndemnityCapAmount, TerminationNoticePeriod, AutoRenewalClause, and CounterpartySignatory. The JSON payload routes via _Apex_ callout to the _Contract Lifecycle Management (CLM)_ system. Any fields that aren't found are returned as _null_, and the CLM applies the default obligation rules to the missing values.
**Insurance Claims\: First Notice of Loss Processing**
When a policyholder submits a _First Notice of Loss (FNOL)_ form, the backend portal calls the _Document AI_ REST API synchronously. The schema extracts the PolicyNumber, IncidentDate, IncidentLocation, DamageDescription, ClaimantName, and ContactPhone. The JSON payload routes to the _claims management_ database via _Apex_ callout or ETL, which creates a pre-populated claim record for adjusters to review before the formal claim is opened.
## Design Considerations and Failure Modes
Before you move to production, you must create designs for these failure scenarios.
- **Null Field Handling\:** The LLM returns _null_ for fields it can't locate or confidently extract. Validate null-handling logic at schema design and implement default value or rejection logic in the integration layer before writing to any targets with _NOT NULL_ constraints or required match keys.
- **OCR Quality Degradation\:** OCR accuracy degrades below 150 DPI, on irregular handwriting, or on noisy scans. Misreads propagate into LLM extraction as corrupted input without error signals. Enforce minimum scan quality at ingestion and implement confidence threshold checks on numeric and date fields.
- **Schema Version Mismatch\:** Updating a schema configuration after a batch job is scheduled causes in-flight documents to process against the previous version, which produces missing or renamed fields that break downstream mapping. Version schemas explicitly and coordinate updates with batch job schedules.
- **File Size Limits\:** Documents that exceed 10MB are rejected. Batch pipeline failures are silent without monitoring configured, and transactional callers receive a _4xx_ error. Pre-validate file sizes at ingestion and implement pre-processing to split or compress documents that regularly approach the limit.
- **LLM Context Overflow\:** Dense or multi-page documents may exceed the LLM context window within the 10MB limit. The LLM silently drops content that exceeds context. Implement a chunking strategy that splits documents by page range and reassembles the extracted fields before transferring them to the target.
- **Trust Layer Masking Affecting Extraction\:** The ETL operates at the prompt level—not the document level—so masking doesn't apply to document content that passes through _Document AI_. Schema fields that depend on _PII_ values in the document aren't affected by ETL-masking policies.
- **External RDBMS Write Idempotency\:** The _transactional processing_ pipeline doesn't have any built-in idempotency for external _RDBMS_ targets. _Integration layer_ retries create duplicate rows unless the write logic handles de-duplication explicitly. Implement idempotent upserts using a document fingerprint or external ID on all external write paths.
- **Credit Exhaustion Mid-Run\:** Large batch runs may exhaust _Digital Wallet_ credits before all documents are processed, which produces incomplete DLO datasets that downstream steps view as complete. Set consumption alerts to 75% and 90% of available credits and limit batch sizes to stay within the credit budget for each cycle.
- **Schema Field Limit — Architectural Constraint\:** _Document AI_ enforces a 50-field limit for root-level fields in a schema configuration. This is a design-time constraint—not a runtime error—and architects must account for it during data model and schema design.
- For use cases that require broader extraction\:
- Prioritize ruthlessly. Narrow the schema to fields that drive automation value, not exhaustive document coverage.
- Leverage nested objects (up to 3 levels; batch mode with source object only) to reduce the root-level field count without sacrificing extraction depth.
- Decompose complex documents across multiple _Document AI_ configurations that target distinct document sections, write results to separate DLOs that join downstream in _Data 360_.
- **API Rate Limits\:** _Document AI_ enforces a limit of 50 extraction API calls per minute per tenant. The theoretical ceiling is 300 calls per minute, which is governed by the _Einstein LLM Gateway_. High-volume transactional integrations must be designed with exponential backoff, request queuing, and tenant-level throughput budgeting. Don't assume that burst capacity is available in multi-tenant production environments.
- **API Latency Profile\:** _Document AI_ extraction APIs are fully synchronous. Typical response times range from 5–15 seconds, and they vary by file size and schema complexity.
- This has direct implications for integration architecture\:
- Set caller timeouts to a 30-second minimum.
- Don't invoke _Document AI_ in flows with sub-second SLA requirements.
- Factor latency into throughput calculations against the rate limit ceiling for _batch processing_ pipelines.
- **Encrypted and Password-Protected Documents\:** _Document AI_ doesn't process password-protected files (user passwords are required to open files) or PDFs that are encrypted with an owner/permissions password, including files that open normally but restrict copying, printing, or editing at the _PDF permissions_ layer.
- This constraint sits at the ingestion boundary\:
- Design _document intake_ pipelines to detect and route encrypted files to a _rejection_ or _manual processing_ path before they reach _Document AI_.
- Don't rely on runtime error handling as the primary gate.
## Well-Architected Alignment
_Data 360 Document AI_ aligns with several pillars of the Salesforce _Well-Architected Framework_.
- **Trust\:** The ETL enforces zero data retention with LLM providers, masks _PII_ inputs before they reach the model, and scans outputs for sensitive content. Architects must extend this posture to extracted data at rest. Field-level masking in DLOs isn't applied by the ETL, and it requires downstream _Data Space_ policies and _Permission Sets_.
- **Reliability\:** Each failure mode in the _Design Considerations_ section—null field extraction, OCR misread, schema version mismatch, file size breach, LLM context overflow, ETL masking interference, RDBMS write idempotency and credit exhaustion—represents a distinct failure class with a documented detection signal and resolution path.
- **Operational Excellence (change management)\:** The schema-driven extraction model decouples the extraction logic from the document layout. When a vendor changes an invoice format or a regulatory form is updated, architects only need to update one schema configuration rather than modifying integration code.
- **Operational Excellence (maintainability)\:** Centralizing schema configurations in _Data 360_ rather than embedding extraction logic in application code makes extraction intent explicit, versioned, and auditable. All downstream targets consume the same schema contract regardless of their target tier.
- **Operational Excellence (integration reuse)\:** _Document AI_ exposes extraction across multiple integration surfaces\: REST API, _Apex_, _Flow_, _MuleSoft_, Agentforce _Actions_, and the MCP server. A single schema configuration fans out to multiple target tiers simultaneously without rebuilding the extraction capability per consumer.
- **Resource and Cost Optimization\:** The pipeline selection guidance, 10MB file size boundary, and pre-assembly LLM context length constraints represent performance-aware design decisions. The _When to Use_ section formalizes the conditions for when _Document AI_ isn't the right tool (for example, sub-second latency requirements, fully-structured source data, and fixed-schema machine-generated documents).
## Quick-Start Guide for Architects
This is a structured starting point for configuring _Data 360 Document AI_ in a sandbox environment. Complete all phases in the sandbox before moving to production.
### Before You Begin
Before beginning configuration, you must confirm\:
- **File Size\:** Validate that the representative document sizes are under 10MB.
- **Pipeline\:** Confirm whether the use case requires the _batch_ pipeline (UDMO-backed, high-volume) or the _transactional processing_ pipeline (API-driven, single-document). This drives all subsequent configuration.
- **Target Tier\:** Confirm where the extracted data lands—Salesforce _SObject_, _Data 360_ DLO/DMO, external RDBMS, or a combination.
- **Agentforce Dependency\:** Before deploying any Agentforce-powered document processing, confirm that a supported [LLM](https://help.salesforce.com/s/articleView?id=ai.generative_ai_large_language_model_support.htm&type=5) (for example, _GPT-4o_) is enabled in your org via the ETL settings. Agentforce is a hard platform prerequisite for _Document AI_. The entire _Document AI_ feature surface—including all extraction APIs—is unavailable until Agentforce is active in the target org. Factor this into org readiness assessments and provisioning sequencing. Allow a few minutes for API availability to stabilize post-enablement.
- **Agentforce Disablement Impact\:** If Agentforce is disabled after _Document AI_ is configured and deployed, then all extraction processing (UI and API) will be blocked immediately. The same applies to model disablement. Disabling the underlying model has an equivalent effect on _Document AI_ availability. In both cases, the existing schema configurations are preserved and will remain visible—no configuration or data loss will occur—but the capability is fully inoperable until Agentforce and the model are re-enabled. Design operational runbooks to treat Agentforce availability and model enablement as _Document AI_ health dependencies.
- **Credit Consumption/Pricing\:** Use _Data 360_ credits or _Flex Credits_ for TCO estimates that are derived from representative sample documents.
#### Phase 1\: Schema and Pipeline Configuration
- **Create the schema configuration.** Define extraction fields, data types, and instructions in _JSON Schema_ format in the _Data 360 Document AI_ setup. For the _batch_ pipeline, bind it to a UDMO. For the _transactional processing_ pipeline, create it without a source object. Record the schema ID.
- **Align field names to the target tier.** Match field names to DLO column definitions, _SObject_ API names, or RDBMS column names. Misaligned names create mapping overhead in the integration layer.
- **Configure the UDMO source object (batch only).** Define documents in scope and configure ingestion source connectivity (for example, _S3_, _Google Cloud Storage_, _Salesforce Files_, or _MuleSoft)_. Confirm that the ingestion service account has the required _IAM_ or _OAuth_ credential scope.
- **Apply PII masking policies.** Configure _Data Masking_ policies in the ETL settings before processing any regulated content. Define which field types (_PHI_, _PII_, and financial identifiers) are masked before inputs reach the LLM. **Don't** defer this step.
- **Assign Data Space scope and Permission Sets.** Scope processing to the appropriate _Data Space_ and configure _Permission Sets_ to control schema creation, batch job execution, REST API invocation, and downstream activation.
- **Configure API authentication (transactional processing pipeline only).** Create a _Connected App_ with _OAuth_ scopes cdp_ingest_api and api. For org-internal callers, use a _Named Credential_ that links to an _External Credential_. For external callers, configure _OAuth 2.0_ client credentials or a JWT-bearer flow. Test and validate extraction before proceeding.
#### Phase 2\: Integration and Target Configuration
- **SObject write-back\:** Implement an _Apex_ (@InvocableMethod) or _Flow_ element that maps JSON response fields to _SObject_ fields. Use Database.upsert() with an external ID to prevent duplicates. Apply _Field-Level Security_ on target _SObject_ fields.
- **Data 360 DLO/DMO pipeline\:** Map extracted DLO fields to DMOs that align with the _Customer 360 Data Model_. Configure identity resolution rules to link document records to _Unified Individuals_. Define _Calculated Insights_ and add DMOs for Agentforce. For the transactional processing pipeline, route the JSON payload to a DLO via the _Ingestion_ API first.
- **External RDBMS or data warehouse\:** Select the integration pattern\: _MuleSoft_ (existing integration fabric), _Apex_ HTTP callout (lightweight, org-native), _Platform Events_ with the _Pub/Sub_ subscriber (event-driven), or ETL (high-volume batch). Implement idempotent upserts using a document fingerprint or external ID on all external write paths.
- **Activation paths\:** Connect Agentforce actions to schema configurations for interactive extraction. Configure _Flow_ or _Apex_ triggers for automated processing workflows and establish the activation targets for each field group.
- **Error handling (transactional processing pipeline only).** Configure the full HTTP response surface\: **200** (_successful_, including partial _null_ responses), **400** (_malformed request_ or _schema ID not found_), **413** (file exceeds 10MB), **5xx** (service error). Implement exponential backoff for _5xx_ retries with a maximum of 3 attempts. Log the raw JSON response and schema ID on every call.
#### Phase 3\: Validate and Prepare for Production
- **Test schemas against sample documents.** Submit representative samples via the _Document AI_ interface or REST API. Confirm extraction accuracy, field coverage, and null handling across layout variations.
- **Validate null field handling.** Confirm that all downstream targets can handle _null_ values for _fields not found_ in a document. Keep in mind that _NOT NULL_ constraints fail silently without explicit null handling.
- **Pre-validate file sizes.** Confirm that production documents stay under 10MB. Implement pre-processing to split or compress documents that regularly approach the limit.
- **Validate end-to-end extraction.** For the _batch_ pipeline, initiate a full run and confirm that the extracted fields land correctly in each target tier. For the _transactional processing_ pipeline, trace the JSON response through the _integration_ layer to the target. Verify the trigger and flow execution for the _SObject_ targets, the identity resolution linkage for the _DLO/DMO_ targets, and the idempotency for the _RDBMS_ targets.
- **Confirm Trust Layer behavior.** The ETL doesn't apply _PII_ masking to document content, so the LLM will return _PII_ data in extracted fields as-is. Confirm that your schema fields, data routing, and downstream storage are designed to handle PII-bearing output appropriately, and ensure that any compliance or retention requirements are addressed outside of the platform.
- **Set Digital Wallet alerts.** Configure consumption alerts at 75% and 90% of available credits. Establish batch size limits and ad-hoc rate estimates within the credit budget for each cycle.
- **Validate batch monitoring (batch pipeline only).** Review extraction success rates, null field rates, and job completion in the _Data 360_ monitoring console. Confirm the tag propagation from the UDLO through the DLO to the DMO in data lineage.
- **Validate API error handling (transactional processing pipeline only).** Test all error conditions\: **413** (documents over 10MB), **400** (invalid Schema IDs), **200** (valid extractions with partial nulls). Confirm that the retry logic fires on simulated **5xx** responses without creating duplicate writes.
## Conclusion
This document highlights the architectural foundations of _Data 360 Document AI_\:
- Two processing pipelines and when to use them
- The schema configuration model
- The target tier decision framework
- Core technology constraints
- Failure modes
- _Well-Architected Framework_ alignment
The [Quick-Start Guide for Architects](/docs/architect/fundamentals/guide/data360-document-ai#quick-start-guide-for-architects) provides the configuration sequence for a sandbox proof of concept.
The core architectural posture supports document-derived data that's governed at the _Schema_ layer, processed via an ETL-enforced LLM pipeline, and delivered to the same _Data 360_ data lifecycle that governs all of our other enterprise data.
Architects who apply these principles—selecting the correct pipeline, designing schemas at the document-type level, and designing for failure modes before production—build extraction capabilities that scale and endure under regulated industry governance requirements.
### About the Authors
**Yugandhar Bora** is a Software Engineering Architect at Salesforce who specializes in data architecture within the _Data and Intelligence Applications_ platform. He leads _Enterprise Architecture Review Board (EARB)_ initiatives that focus on data governance and unified data models, while also contributing to automated platform provisioning solutions.
**Ananth Anto** is a Director of Product Management at Salesforce _Data 360_ who leads _Document AI and Data Graph_ initiatives. Based in Bangalore, he works with enterprise customers to solve real-world document-processing and data-intelligence challenges. He enjoys exploring _Enterprise_ use cases for _Generative AI (Gen AI)_.
**Nishan Naseer** is a Software Engineering Architect at Salesforce who works on _Unstructured Data Processing_, _RAG_ pipelines, and _Document Intelligence_. He's passionate about harnessing the power of AI to tackle real-world challenges and find creative solutions to complex customer issues.
# Overview
Modern Salesforce integrations must support far more than simple data exchange. They are expected to power real-time customer experiences, coordinate actions across multiple systems, and operate reliably at enterprise scale—all while meeting strict security and compliance requirements. Choosing the right integration approach is therefore a critical architectural decision, not an implementation detail.
Consider a common enterprise scenario. A customer completes a purchase in a mobile app, triggering a real-time eligibility check for a personalized offer. At the same time, transaction data must be recorded in an ERP system, customer attributes updated in Salesforce, and analytics streamed to a data lake—without introducing latency, data duplication, or compliance risk. Scenarios like this are now typical in modern Salesforce environments, where Salesforce rarely operates in isolation and must integrate seamlessly with a broader ecosystem of applications and data platforms.
This guide exists to help architects and developers design those integrations with clarity and confidence. Rather than focusing on point-to-point implementations, it presents a set of **proven integration patterns** that address recurring enterprise scenarios—such as process orchestration, data synchronization, and real-time data access. Each pattern emphasizes architectural intent, trade-offs, and execution models, enabling teams to make informed design decisions that scale and endure.
Within this document, you’ll find:
* Integration patterns that represent common enterprise “archetypes” across process, data, and virtual access scenarios
* A pattern selection framework to help identify the right approach based on integration intent and execution timing
* Practical guidance on scalability, resiliency, governance, and security considerations
* Best practices drawn from real-world Salesforce and Data 360 implementations
The goal of this document is to provide a shared architectural language for integration, helping teams design solutions that balance performance, flexibility, and trust while aligning with enterprise data and governance strategies.
## Purpose and Scope
This document is for designers and architects who need to integrate data from other applications in their enterprise with Salesforce Data 360 (formerly Data Cloud). This content is a distillation of many successful implementations by Salesforce architects and partners.
To become familiar with integration capabilities and options available for large-scale adoption of Data 360, read Pattern Summary and Pattern Selection Guide sections below . Architects and developers should consider these pattern details and best practices during the design and implementation phase of data interaction projects into Data 360\.
If implemented properly, these patterns enable you to get to production as fast as possible and have the most stable, scalable, and maintenance-free set of applications possible. Salesforce’s own consulting architects use these patterns as reference points during architectural reviews and actively maintain and improve them.
As with all patterns, this content covers most integration scenarios, but not all. While Salesforce allows for user interface (UI) integration,-mashups, for example, such integration is outside the scope of this document.
### Pattern Template
Each integration pattern follows a consistent structure. This provides consistency in the information provided in each pattern and also makes it easier to compare patterns.
* **Name**: The pattern identifier that also indicates the type of integration contained in the pattern.
* **Context:** The overall integration scenario that the pattern addresses. Context provides information about what users are trying to accomplish and how the application behaves to support the requirements.
* **Problem:** Expressed as a question, this is the scenario that the pattern is designed to solve. Read this section to understand if the pattern is appropriate for your integration scenario.
* **Forces:** The constraints and circumstances that make the stated scenario difficult to solve.
* **Solution:** The recommended way to solve the integration scenario.
* **Sketch:** A UML sequence diagram that shows you how the solution addresses the scenario.
* **Results:** Explains the details of how to apply the solution to your integration scenario and how it resolves the forces associated with that scenario. This section also contains new challenges that can arise as a result of applying the pattern.
* **Sidebars:** Additional sections related to the pattern that contain key technical issues, variations of the pattern, pattern-specific concerns, and so on.
* **Example:** An Real world scenario that describes how the design pattern is used in a real-world Salesforce scenario. The example explains the integration goals and how to implement the pattern to achieve those goals.
## Pattern Summary
Use this table as a table of contents for the integration patterns contained in this document.
### List of Patterns
Data is ingested from an enterprise cloud storage source such as Amazon S3, Azure Blob, or Google Cloud Storage into Data 360 in the form of large batches of raw data (e.g., transactions or product logs).
Data 360 subscribes to streaming ingestion endpoints that receive continuous event payloads (e.g., purchase events, IoT telemetry) from enterprise systems for real-time profile updates.
Data 360 receives CRM data updates (e.g., contact, case, opportunity changes) in nearReal-Time via event streams to maintain a continuously synchronized Customer 360 view.
Data 360 consumes streaming data directly from cloud event platforms like AWS Kinesis or Kafka (MSK) to process high-frequency operational or IoT events.
External systems such as Databricks or Tableau access enriched segments and insights in Data 360 via Zero Copy Outbound connections without data replication.
Data Cloud One unifies multiple Salesforce orgs and external data sources under a shared metadata and semantic model, providing a consistent Customer 360 without data duplication.
Data 360 exports unified or filtered datasets (e.g., consented customer records) as CSV or Parquet files to enterprise cloud storage for analytics or compliance archiving.
External applications invoke the Data 360 Connect API inReal-Time to retrieve or trigger personalized actions (e.g., loyalty balance check or AI offer generation) based on current customer data.Custom-built web or mobile applications retrieve harmonized Data 360 insights securely via the Connect REST API to display within enterprise or partner UIs.
A system retrieves a customer’s unified profile using the Data Graph API, returning a pre-joined, real-time JSON representation of the complete 360° view for decisioning or personalization.
Data 360 detects and processes a live event (e.g., consent update, purchase trigger) and immediately invokes a connected system or Salesforce Flow for downstream action.A customer activity signal (e.g., churn risk detected) in Data 360 triggers an instant real-time action — such as updating CRM, invoking Einstein scoring, or launching a retention journey.
### **Pattern Approaches**
The integration patterns in this document are classified into three categories: data, process, and visual integrations.
#### **Data Integration**
Data integration patterns in Data 360 address the movement and synchronization of data across systems to ensure that both Data 360 and external platforms hold consistent, timely, and trustworthy information. These patterns typically handle large-scale, high-volume data flows and rely on governed pipelines that enforce schema consistency, lineage tracking, and mastering rules.
* **Batch Ingestion Patterns** represent the foundational layer of enterprise data onboarding. Bulk data ingestion from cloud storage services such as AWS S3, Azure Blob, or Google Cloud Storage allows large historical datasets to be loaded periodically into Data 360 for identity resolution, segmentation, and analytics. Similarly, bulk ingestion from Salesforce Clouds—such as Sales, Service, or Marketing Cloud—uses native connectors and Data Streams to bring CRM data into the unified data layer, ensuring harmonization and continuity across systems of engagement.
* **Streaming and Real-Time Ingestion Patterns** extend this by capturing high-velocity event data. Event-driven ingestion via the Ingestion API enables external systems to continuously stream customer activity into Data 360\. Real-time web and mobile behavior ingestion captures clickstream and interaction data directly from digital touchpoints to drive immediate personalization. Near-real-time CRM synchronization through Streaming APIs ensures customer attributes and consent updates are reflected quickly across systems. Event stream ingestion from messaging platforms like Amazon Kinesis or Confluent MSK supports continuous high-throughput pipelines, aligning Data 360 with enterprise event architectures.
* **Unified Multi-Org Data Platform with Data Cloud One** further exemplifies data integration, providing a consolidated environment to unify data from multiple Salesforce orgs and external sources under a common governance and semantic layer. This enables organizations to achieve enterprise-wide data consistency, shared data models, and scalable analytics.
* In the activation phase, **Batch Activation Patterns** follow the same data integration principle. Segments curated in Data 360 are exported in scheduled jobs to downstream marketing and advertising platforms—such as Marketing Cloud, Meta Ads, or Google Ads—where they trigger campaign execution. Similarly, datasets can be exported to cloud storage targets to fuel external analytics and data science pipelines. Across all of these use cases, Data 360 acts as the source of truth for synchronized and curated customer data.
#### **Process Integration**
Process integration patterns in Data 360 involve triggering or orchestrating business processes across systems in nearReal-Time. These patterns allow Data 360 to actively participate in enterprise workflows, enabling contextual responses and dynamic data activation.
* **On-demand API-Based activation** enables real-time engagement scenarios. Through the Connect API, custom applications can query or activate customer profiles directly from Data 360 as part of operational processes—such as an agent console retrieving unified profile insights during a customer interaction. The **Complete Customer Profile Retrieval via Data Graph API** supports composite applications and microservices that rely on API-driven access to the full entity graph of a customer, allowing for dynamic experiences without pre-staged segments.
* **Real-Time Data Actions** push this integration approach further by enabling immediate responsiveness. When a customer signal—such as a purchase, form submission, or threshold event—is detected, Data 360 can trigger actions such as updating a CRM record, invoking an external webhook, or launching a personalized offer workflow. These patterns embody true process orchestration, bridging real-time customer intelligence with automated operational execution.
#### **Virtual Integration**
Virtual integration patterns in Data 360 enable live access to external or federated data sources without physically copying or duplicating data. These are critical for enterprises that require governed, up-to-date information at query time while minimizing data movement.
* **Inbound Zero Copy Data Federation(External Platforms-to-Data 360)** allows external systems—such as data warehouses or data lakes—to share datasets with Data 360 through secure, governed connections (e.g., Snowflake Secure Data Sharing). This ensures Data 360 can access and operate on external data virtually, preserving freshness and eliminating unnecessary replication.
* **Outbound Zero Copy Data Sharing(Data 360-to-External Platforms)** enables Data 360 to expose curated datasets for external consumption, such as AI modeling, business intelligence, or advanced analytics, through secure data federation and live query mechanisms.
Choosing the best integration strategy for your system isn’t trivial. There are many aspects to consider and many tools that can be used, with some tools being more appropriate than others for certain tasks. Each pattern addresses specific critical areas including the capabilities of each of the systems, volume of data, failure handling, and transactionality.
## Pattern Selection Guide
When selecting an integration pattern, start by answering two fundamental questions that shape the overall design and behavior of the integration.
**What are you integrating? — Process, Data, or Virtual access**
This dimension defines the primary purpose of the integration.
* **Process integrations** focus on orchestrating business workflows and coordinating actions across systems.
* **Data integrations** focus on synchronizing, enriching, or propagating data between systems.
* **Virtual integrations** focus on accessing external data inReal-Time without copying or persisting it in Salesforce or Data 360\.
Understanding this intent helps determine the level of orchestration, data movement, and coupling required between systems.
* **How does it need to execute? — Synchronous or Asynchronous** method defines the execution model of the integration.
* **Synchronous** integrations are real-time and blocking, where the caller expects an immediate response—commonly used for user-driven or validation scenarios.
* **Asynchronous** integrations are non-blocking and decoupled, designed to handle scale, long-running processes, retries, and high data volumes.
Together, these two dimensions—**integration intent** and **execution timing**—provide a clear, consistent framework for selecting the right integration pattern while balancing user experience, scalability, and operational resilience.
**Note:** An integration can require an external middleware or integration solution (for example, Enterprise Service Bus) depending on which aspects apply to your integration scenario.
### Integrating Data 360 with Another System
This table lists the patterns and their key aspects to help you determine which pattern best fits your requirements when your integration is from Salesforce to another system
### Integrating Another System with Data 360
This table lists the patterns and their key aspects to help you determine the pattern that best fits your requirements when your integration is from another system to Salesforce.
### Middleware Terms and Definitions
This table lists some key terms related to middleware and their definitions with regards to these patterns.
Term
Definition
Event Handling
Event handling refers to receiving, routing, and responding to identifiable occurrences from a source system or application. Middleware handles events by identifying the target endpoint, forwarding the event, and triggering the required business action (e.g., logging, retries, or activating downstream services). In Data 360 architectures, event handling is critical for real-time data ingestion, activation triggers, and publish/subscribe patterns. Events may originate from external systems (Kafka, AWS Kinesis) or Salesforce Platform Events and are routed by middleware or the Data 360 event bus for immediate processing.
Protocol Conversion
Protocol conversion allows communication between systems using different data transport standards. Middleware translates proprietary or legacy protocols (like AMQP, MQTT, FTP) into supported Data 360 protocols (REST, gRPC, or HTTPS). This ensures interoperability across heterogeneous systems. Since Data 360 doesn’t natively handle protocol conversion, middleware provides the adaptation layer, encapsulating or transforming messages into a format Data 360 APIs and connectors can interpret.
Translation and Transformation
Translation and transformation ensure interoperability by mapping one data format or schema to another. Middleware performs these transformations to align diverse data payloads (CSV, XML, JSON) with Data 360 data model objects (DMOs) and Unified Data Layer Objects (UDLOs). This includes cleansing, enriching, and applying semantic or ontology-based mapping before ingestion. While Salesforce offers transformation tools like Data Prep Recipes, complex transformations (especially for semantic harmonization) are best handled in middleware.
Queuing and Buffering
Queuing and buffering rely on asynchronous message passing to ensure resilient, decoupled communication. Middleware platforms (e.g., MuleSoft, Kafka, or Azure Event Hub) provide persistent queues that temporarily store data when Data 360 or downstream systems are busy or unreachable. This prevents data loss and supports near-real-time ingestion or activation retries. Data 360 supports streaming ingestion and flow-based outbound messaging, but durable queuing and guaranteed delivery are typically handled by middleware.
Synchronous Transport Protocols
Synchronous transport protocols involve blocking, real-time request/response operations. The sender waits for a reply before proceeding. In Data 360, these are used for on-demand API-based activations, real-time enrichment, or profile lookups, where responses are required immediately. Middleware ensures connection reliability and manages retries or fallback handling for synchronous Data 360 API calls.
Asynchronous Transport Protocols
Asynchronous transport protocols support non-blocking, decoupled communication where the sender continues processing without waiting for a response. Middleware handles asynchronous flows for batch activations, streaming ingestion, and event-driven activation. This allows high throughput and resilience — critical for event streaming and near-real-time data ingestion patterns in Data 360.
Mediation Routing
Mediation routing defines complex message flow between systems, ensuring that the right data or event reaches the correct consumer. Middleware acts as the mediator, handling routing logic based on rules, headers, content, or event type. In Data 360 integrations, mediation ensures events and profile updates from multiple systems are properly routed to Data Ingestion APIs, activation endpoints, or external consumers. This simplifies orchestration and supports multi-system data synchronization.
Process Choreography and Service Orchestration
Process choreography and orchestration coordinate multi-system processes. Choreography supports autonomous, asynchronous event-driven flows, where systems act based on shared rules without a central controller. Orchestration is a centrally managed flow that directs service execution. In Data 360 architectures, middleware manages orchestration for ingestion and activation across systems, while Salesforce workflows or Flows handle lightweight choreographies within the platform. Complex orchestration, requiring transaction coordination or state management, is recommended at the middleware layer.
Transactionality ensures atomic, consistent, isolated, and durable (ACID) operations across systems. Salesforce and Data 360 are transactional within their boundaries but don’t support distributed transactions across external systems. Middleware handles global transaction control, including encryption, message signing, rollback, compensation, and reliable delivery. For mission-critical data flows (e.g., financial or consent updates), middleware ensures end-to-end integrity and recovery across Data 360 and external systems.
Routing
Routing specifies the controlled flow of messages or data between components. It may be based on headers, content type, priority, or rules. Middleware handles routing logic for events and activations involving Data 360, such as directing enriched audience segments to different downstream systems (ad platforms, warehouses, CRM apps). Although routing can be implemented within Salesforce (Apex, Flows), middleware routing is preferred for scalability, flexibility, and governance.
Extract, Transform, and Load (ETL)
ETL involves extracting data from source systems, transforming it into a consistent schema, and loading it into a target (like Data 360). Middleware or ETL tools handle these operations before data ingestion. Data 360 can receive ETL outputs via APIs, connectors, or bulk ingestion pipelines, and also supports Change Data Capture (CDC) for near-real-time synchronization. Middleware ETL processes are essential for integrating legacy systems and ensuring data quality before unification in Data 360.
Long Polling
Long polling (Comet programming) is a method for maintaining open communication between systems for real-time updates. The client sends a request and the server holds it until an event occurs, then responds and reopens a new connection. Salesforce uses this in the Streaming API and CometD/Bayeux protocols for event-driven data synchronization. Middleware can subscribe to these events and forward them to Data 360 for real-time ingestion or activation triggers, ensuring minimal latency across enterprise systems.
## Data Ingestion Patterns--Data Inbound
Data ingestion is the first and most critical step in Salesforce Data 360’s data lifecycle. It’s how raw information from multiple external systems—CRM, ERP, web, mobile, or third-party APIs—enters the platform and becomes part of a unified customer view.
The right ingestion pattern depends on what the business needs:
* **Data volume** — how much data is moving at once
* **Latency** — how fresh the data must be
* **Source system capabilities** — how the system can connect and deliver data
Data 360 supports multiple ingestion modes to meet these needs: batch for high-volume loads, streaming for near real-time updates, event-based for transactional immediacy, and Zero Copy ingestion for instant access to external data without physically moving it.
Together, these patterns ensure that every customer signal—whether it’s a purchase event, a clickstream log, or a loyalty update—flows into Data 360 efficiently, securely, and in the right time frame to power trusted analytics and AI-driven experiences.
### Batch Ingestion Patterns
Batch ingestion patterns are the backbone of large-scale data onboarding in Data 360. They are optimized for scenarios where data is processed in bulk—typically on a scheduled or periodic basis—rather than continuously.
These patterns are best suited for:
* **Historical data loads** to initialize the platform with existing enterprise records
* **Regular synchronization** with systems of record such as ERPs, data warehouses, or proprietary databases
* **Use cases where real-time freshness is not critical**, but consistency, completeness, and auditability are
Batch ingestion offers predictable performance and operational simplicity, making it a trusted choice for enterprises managing terabytes of structured or semi-structured data.
Data 360 provides a set of production-ready, generally available **[connectors](https://help.salesforce.com/s/articleView?id=data.c360_a_sources_targets.htm&type=5)** that support batch ingestion natively. These connectors streamline integration setup, reduce custom ETL development, and ensure data quality and security across every import. The table below highlights the most common connectors used for enterprise-scale batch ingestion.
#### Bulk Data Ingestion from Cloud Storage
##### Context
This pattern is designed for enterprise scenarios that involve ingesting large volumes of structured data—such as CSV or Parquet files—and unstructured assets from centralized data lakes or scheduled file drops. Data sources commonly include cloud storage platforms like Amazon S3, Google Cloud Storage (GCS), and Microsoft Azure Blob Storage, where files are periodically delivered as part of upstream data pipelines or batch exports.
##### Problem
How can an organization establish a reliable, secure, and high-throughput process to ingest massive, file-based datasets from its primary cloud storage platform into Data 360 on a predictable, recurring schedule—without sacrificing governance, scalability, or performance?
##### Forces
Ingesting massive, file-based datasets into Data 360 is not a simple data transfer exercise — it’s an architectural challenge shaped by scale, governance, and platform constraints.
**Data Volume and Scale :** Data 360 ingestion connectors are optimized for reliability and governance, not arbitrary bulk throughput. For example, the Amazon S3 connector supports up to 100 million rows or 50 GB per object, whichever limit is reached first. For enterprises with historical datasets running into billions of records, this boundary becomes a key design constraint. A single-file, lift-and-shift approach quickly becomes infeasible, requiring intelligent data partitioning, chunking, and orchestration strategies to achieve scale without hitting connector limits.
**Schema Definition and Maintenance :** Data 360 requires explicit schema definitions for every ingestion pipeline to ensure semantic and structural integrity. In the case of S3 ingestion, a csv file must define column headers and a single representative data row. This file acts as the canonical contract between the source system i.e. cloud storage and Data 360\. Any misalignment — in field names, data types, or encoding — can cause ingestion failures or silent data corruption. Maintaining this schema file in version control and enforcing validation through CI/CD or data governance workflows becomes a best practice for production environments.
**Strict Naming Conventions :** Data 360 enforces **strict object and field naming rules** to maintain consistency across the metadata graph.
* Object names must start with a letter and can only include letters, digits, or underscores.
* Field names must follow the same patterns.
Files that violate these conventions — for example, fields containing spaces, special characters, or unsupported symbols — will fail schema validation during ingestion. Enterprises must implement **pre-ingestion data hygiene processes** to sanitize and normalize incoming file structures.
**Authentication and Security Posture :** Each connection to external storage must comply with enterprise-grade security and compliance standards.
* Authentication is typically handled through AWS Access/Secret Keys or federated Identity Provider (IdP) authentication.
* IAM roles must be scoped to enforce least privilege, allowing only read access to the specified storage paths.
* For secure access, outbound IP addresses must be directly added to the source system’s allowlist.
These layered controls ensure that every file transfer operates within a zero-trust, auditable perimeter, balancing enterprise compliance with the flexibility required for large-scale ingestion.
##### Solution
This table contains solutions to this integration problem.
Solution
Fit
Comments
Use Native Cloud Storage Connectors (Amazon S3, Google Cloud Storage, Azure Blob Storage)
Best
This is the recommended and most reliable pattern for large-scale, recurring file-based ingestion into Data 360\. Native connectors provide managed authentication, schema mapping, and secure data movement directly into Data 360’s Data Lake Objects (DLOs). Ideal for scheduled batch loads where latency is not critical (for example, scheduling hourly or daily).
Handling Large Datasets (Beyond Connector Limits)
Best with Preprocessing
Each connector enforces ingestion limits (for example, S3: 100M rows or 50 GB per object). For larger datasets, implement an ETL preprocessing step to partition data into smaller files/folders that fall under these thresholds. Then, configure multiple data streams to ingest each partition in parallel, and use the append node in a batch data transforms) within Data 360 to recombine the partitions into a unified dataset.
Security and Governance
Best
All connectors support secure authentication via cloud-native methods (IAM roles, service accounts, or access keys). For added control, restrict access to Data 360 IP ranges via the cloud provider’s allowlist. Data transfer occurs over encrypted channels, with files stored in a temporary, secure staging layer during ingestion.
When Not to Use
Suboptimal
This pattern is not optimal for:
Real-time or near real-time event ingestion.
Transactional, low-latency integrations.
Sources without schema definition capabilities In such cases, use streaming connectors (Kafka, Kinesis, Pub/Sub) or Zero Copy Data Federation instead.
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from cloud storage into Data 360
In this scenario:
* Admin configures a connection to cloud storage via the Data 360 Setup interface (specifying authentication, bucket details, IAM roles, and whitelisting).
* Data Cloud Setup interface authenticates with the Cloud Storage Platform, verifying credentials and access.
* Admin creates a data stream in Data 360, linking the data stream to the object/folder in Cloud Storage and defining the ingestion schedule.
* On schedule trigger, data stream requests source files (e.g., CSV, Parquet) from the Cloud Storage Platform.
* Cloud Storage Platform delivers files, including the required valid schema\_sample.csv and other data files compliant with naming conventions.
* Data Stream transfers files to the Internal Staging Environment within Data 360\.
* Data 360 Pipeline processes the files: Uses the schema definition from schema\_sample.csv Validates structure, field names, and divides the load if above ingestion thresholds (100 million rows/50 GB per file). If large files are detected, a preprocessing partitioning step (notified to admin for next run) is carried out externally.
* Records are imported from staging into a data lake object (DLO).
* If required and data is partitioned, use the append node in a batch data transform to combine multiple DLOs.
* Data 360 logs success/failure, updates status for monitoring, and signals that data is ready for mapping, harmonization, and unification.
##### Results
The application of this pattern enables secure, scheduled, and large-scale ingestion of structured or unstructured files from enterprise cloud storage platforms into Data 360\. The process is automated, scalable, and resilient — delivering raw data into data lake objects (DLOs) that serve as the foundation for harmonization and mapping to the Customer 360 Data Model.
###### Ingestion Mechanisms
The ingestion mechanism depends on the connector and scheduling strategy defined within Data 360\.
Recommended for direct ingestion of files in CSV or Parquet format from the enterprise’s cloud data lake. These connectors support incremental and full refresh schedules. For example, a bank can configure a daily sync of customer transaction files from an S3 bucket to a DLO.
Partitioned File Strategy
For very large datasets (beyond 100 million rows or 50 GB per object), the data is partitioned into smaller logical sets (e.g., by month or region). Each partition is managed as a separate Data Stream and later recombined using a Batch Data Transform with an Append node.
Automated Scheduled Sync
Data 360 provides a declarative scheduler (hourly, daily, or custom cadence) that triggers ingestion jobs automatically, ensuring data freshness without manual intervention.
###### Error Handling and Recovery
Error handling and recovery are critical to ensure reliability in high-volume ingestion operations.
* **Error Detection:** Each Data Stream run logs ingestion errors (e.g., schema mismatch, file corruption, or naming violations) in Data 360 Monitoring. Administrators can review and reprocess failed batches.
* **Recovery Mechanism**: Data 360 maintains checkpointing to ensure failed batches do not corrupt prior ingestions. Retries can be configured after correcting source issues (e.g., malformed CSVs).
* **Schema Validation**: The schema\_sample.csv file defines data types and structure. Any change triggers validation to avoid silent schema drift across runs.
###### Idempotent Design Considerations
Ingestion is idempotent by design — reprocessing the same file does not result in duplicate records.
Key strategies include:
* **File Fingerprinting:** Data 360 computes checksums to identify and skip previously processed files.
* **Transactional Ingestion:** Data is staged and only committed to the DLO upon successful processing of all records.
* **Append vs. Replace:** Depending on business logic, streams can append to or fully replace the target DLO; this ensures deterministic outcomes and prevents partial data overlap.
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Authentication & Authorization:** Connectors use Salesforce’s Secure Integration Framework, leveraging Named Credentials and External Credentials for authentication without exposing secrets.
* **Encryption:** Data is encrypted in transit (TLS 1.2+) and at rest (AES-256).
* **Network Controls:** Source storage systems (e.g., S3 buckets) must allowlist Data 360 IPs.
* **Compliance Alignment:** Supports enterprise data protection frameworks such as GDPR, HIPAA, and FFIEC guidelines when paired with Customer-Managed Keys (CMK).
* **Auditability:** Every ingestion job and credential access is logged for traceability and compliance reporting.
##### Sidebars
###### Timeliness
Timeliness depends on the ingestion schedule and data volume.
* Large enterprise datasets (100M+ rows) may require partitioning for parallel ingestion.
* Typical ingestion latency ranges from **minutes to a few hours**, depending on file size and transformation complexity.
* For near-real-time ingestion, Data 360 Streaming or API-based connectors may complement the file-based model.
###### Data Volumes
* Best suited for high-volume, periodic batch ingestion.
* Each object processed through the S3 connector supports up to 100 million rows or 50 GB per file.
* For petabyte-scale systems, use data partitioning and multi-stream orchestration.
###### Endpoint Capability and Standards Support
The capability and standard support for the endpoint depends on the solution that you choose.
Connector Type
Endpoint Requirements
Amazon S3 Connector
S3 bucket with appropriate IAM policy and schema\_sample.csv file defining the schema.
Google Cloud Storage Connector
Service account credentials and bucket access with uniform naming conventions.
Azure Storage Connector
Access key or SAS token–based authentication; blob or folder structure must follow Data 360 conventions.
###### State Management
State is tracked through Data Streams and their last successful run timestamp.
* Data 360 automatically maintains sync states and offsets, ensuring only new or modified files are processed on subsequent runs.
* When integrating with external ETL tools, unique file identifiers (e.g., UUIDs or timestamps) are recommended to avoid duplication.
###### Complex Integration Scenarios
In advanced enterprise architectures, this pattern can integrate with:
* **Middleware ETL Pipelines (e.g., Informatica, MuleSoft):** to orchestrate pre-processing, validation, and file partitioning before handoff to Data 360\.
* **AI/ML Workflows:** processed DLO data can be published via DMO to model training environments or RAG indexes through Data 360 Activation Targets.
* **Transactional Systems:** harmonized DMOs can trigger downstream updates in Salesforce CRM or external systems via Data Actions or Platform Events.
##### Example
A global financial institution stores customer and transaction data in an AWS S3 data lake, where partitioned Parquet files are generated nightly by region (such as US, EU, and APAC). The data architecture team configures multiple Data Streams in Data 360, each connected to a regional folder, with a shared schema\_sample.csv ensuring consistent headers and data types across all partitions. Nightly ingestion schedules automatically load the data into DLOs, after which Batch Data Transforms append all regional partitions into a unified Customer\_Transactions\_DLO. This harmonized dataset is then mapped to the Customer 360 Data Model, enabling downstream analytics and AI activation. The approach delivers automated and reliable ingestion from the existing data lake, enforces strong authentication and encryption aligned with enterprise IT policies, and provides a scalable, modular foundation that supports future expansion and schema evolution.
#### Bulk Data Ingestion from Salesforce Clouds
##### Context
A primary and critical use case for Data 360 is unifying customer data across the Salesforce ecosystem. This pattern covers natively ingesting data from core Salesforce platforms — Sales Cloud and Service Cloud (collectively Salesforce CRM) and Marketing Cloud Engagement. Sources include standard and custom CRM objects (e.g., Account, Contact, Case, Opportunity) and Marketing Cloud Engagement data extensions that hold engagement events, email sends, and tracking data.
##### Problem
How can an organization efficiently and reliably ingest standard and custom CRM objects and Marketing Cloud Engagement data extensions into Data 360 so the data can be used to build unified customer profiles (identity resolution, Customer 360), while maintaining performance, governance, and minimal disruption to source systems?
##### Forces
Native connectors simplify the job, but several operational and architectural forces must be managed:
* **Comprehensive Source Permissions:** A dedicated connecting user (integration account) must have appropriate object- and field-level read permissions. Failure to assign required permission sets (for example, a pre-built Data 360 connector permission set) is a common cause of ingestion failure.
* **Data Refresh Modes & Cost:** Connectors support full and delta/incremental refresh modes. Full refreshes are heavier on performance and credits; delta extracts reduce load but depend on reliable change-tracking in the source system.
* **Custom Schema & Field Mapping:** CRM instances often include custom objects/fields. Accurate schema mapping and handling of custom fields (names, types) is required to avoid mapping errors or semantic drift.
* **Starter Data Bundles vs. Custom Mapping:** Starter Data Bundles accelerate onboarding by pre-selecting typical objects/fields, but heavily customized orgs will need bespoke stream definitions.
* **Throughput & API Limits:** Source org API limits and Marketing Cloud extract rates constrain how aggressively you can schedule refreshes.
* **Data Hygiene & Naming Conventions:** Source field names, null behavior, and data types must be normalized before ingestion to prevent downstream mapping issues.
* **Security & Least Privilege:** The connector relies on secure authentication and must respect least-privilege IAM patterns, auditability, and network controls.
##### Solution
This table contains solutions to this integration problem.
Solution Area
Fit
Comments / Implementation Details
Solution Fit
Best
Use the native Salesforce CRM Connector and Marketing Cloud Engagement Connector in Data 360\. Start with Starter Data Bundles for standard use cases and accelerate onboarding. Use manual stream customization for bespoke or domain-specific data models.
Handling Highly Customized CRM Instances
Best with Mapping Workshop
Treat Starter Bundles as a baseline and conduct a mapping workshop to identify: Custom objects and relationships. Formula or computed fields. Managed package extensions. For heavy formula fields, compute values in a pre-stage ETL or inside Data 360 Transforms to minimize API load on source orgs.
When Not to Use
Suboptimal Scenarios
Avoid this pattern if: You need high-frequency or real-time event ingestion (instead, use Streaming Connectors, Platform Events, or Zero-Copy Federation). The source org has limited API capacity and cannot sustain scheduled extracts without throttling or queue delays.
Security & Governance
Mandatory Controls
Principle of Least Privilege - Use a dedicated integration user with minimal read access. Never use org-wide admins. Authentication — Use OAuth 2.0 and connected apps; rotate client secrets regularly and monitor refresh token usage. Audit & Traceability — Log all ingestion runs, schema changes, and connector events. Forward logs to SIEM or compliance systems for audit readiness. Data Classification — Apply PII/PHI tagging and Attribute-Based Access Control (ABAC) using CEDAR policies immediately post-ingestion to enforce masking, consent, and downstream compliance.
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from cloud storage into Data 360
In this scenario:
* **Admin provisions integration users** and assigns connector permission sets in source org(s).
* **Admin configures connectors** in Data 360 Setup (connects to Salesforce CRM and Marketing Cloud via OAuth/connected app).
* **Admin creates Data Streams** selecting objects and Data Extensions, chooses full or delta refresh, and sets schedules.
* **On scheduled run**, Data 360 requests schema and delta tokens from the source(s).
* **Source systems return records** (delta or full payload). Marketing Cloud may deliver extracts; CRM may return JSON/Query results.
* **Data 360 stages files** in its internal secure staging area and validates against mapped schema.
* **If validation fails**, ingestion logs error, alerts admin, and halts commit. If validation succeeds, Data 360 commits records atomically to the target DLO.
* **Monitoring & audit logs** are updated with lineage, run duration, row counts, and credential usage. Alerts issued to admins if thresholds or errors triggered.
##### Results
Core customer relationship and marketing engagement data are ingested into Data 360 as Data Lake Objects (DLOs). This yields:
* **Unified dataset** containing profiles, cases, opportunities, and email/engagement metrics.
* **Foundation for identity resolution** and construction of Unified Individual Profiles.
* **Operational readiness** for downstream harmonization, enrichment, AI modeling, and activation while preserving governance and auditability.
###### Ingestion Mechanisms
The ingestion mechanism depends on the connector and scheduling strategy defined within Data 360\.
Mechanism
When to use
Salesforce CRM Connector (native)
Best for standard/custom CRM objects; supports full and delta refresh.
Marketing Cloud Engagement Connector (native)
Best for Data Extensions, sends, and tracking extracts; supports full/delta modes.
Starter Data Bundles
Accelerate onboarding for common Sales/Service/Marketing objects.
Custom Streams + Preprocessing
Use when complex transforms or heavy schema normalization is required.
###### Error Handling and Recovery
Error handling and recovery are critical to ensure reliability in high-volume ingestion operations.
* **Per-run Logs:** Each Data Stream run provides success/failure details and row-level errors.
* **Retries & Checkpointing:** Failed runs can be retried after fixing source or schema issues; Data 360 uses staging and atomic commit semantics.
* **Alerts:** Configure alerts for schema drift, repeated failures, or delta-sequence gaps.
###### Idempotent Design Considerations
Ingestion is idempotent by design — reprocessing the same does not result in duplicate records.
Key strategies include:
* **Change Detection:** Delta extracts rely on source system change indicators (LastModifiedDate / system change data capture). Verify the source provides reliable timestamps/flags.
* **Deduplication:** Use unique business keys (e.g., Contact.ExternalId) to dedupe or upsert into DLOs.
* **Transactional Commit:** Records are staged and only committed when batch processing completes successfully.
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Authentication & Authorization:** Connectors use Salesforce’s Secure Integration Framework, leveraging Named Credentials and External Credentials for authentication without exposing secrets.
* **Encryption:** Data is encrypted in transit (TLS 1.2+) and at rest (AES-256).
* **Network Controls:** Source storage systems (e.g., S3 buckets) must allowlist Data 360 IPs.
* **Compliance Alignment:** Supports enterprise data protection frameworks such as GDPR, HIPAA, and FFIEC guidelines when paired with Customer-Managed Keys (CMK).
* **Auditability:** Every ingestion job and credential access is logged for traceability and compliance reporting
##### Sidebars
###### Timeliness
Timeliness depends on the ingestion schedule and data volume.
* **Ideal cadence** depends on business need — hourly for near-real-time marketing triggers, nightly for large reconciliations.
* **Delta modes** reduce load and cost; full refreshes are heavier and used for initial loads or major schema changes.
###### Data Volumes
* CRM connectors are optimized for transactional and mid-volume datasets (millions of records).
* For extremely large historical volumes, consider staged ETL to partition and load in stages.
###### Endpoint Capability and Standards Support
The capability and standard support for the endpoint depends on the solution that you choose.
Connector
Endpoint Requirements
Salesforce CRM Connector
Source org must permit a Connected App, OAuth tokens, and a dedicated integration user with read permissions.
Marketing Cloud Connector
Marketing Cloud API credentials or installed package; Data Extensions must expose data via Extracts/API.
###### State Management
* **Connector State:** Data Streams maintain last successful sync timestamps and delta offsets.
* **Master Key Strategy:** Prefer consistent business identifiers (external IDs) so downstream reconciliation and upserts are deterministic.
###### Complex Integration Scenarios
In advanced enterprise architectures, this pattern can integrate with:
* **Hybrid Topologies:** Combine CRM ingestion with streaming (Platform Events) for near-real-time updates.
* **Middleware Orchestration:** Use MuleSoft or ETL tools when complex orchestration, enrichment, or transformation pre-ingestion is required.
* **Activation Feedback Loops:** Harmonized DMOs can trigger downstream updates to source systems via Data Actions or platform APIs (careful with SoD controls).
##### Example
A multinational retailer consolidates Accounts, Contacts, Cases, Opportunities, and Marketing Cloud engagement metrics into Data 360 to create a unified customer view. The Starter Data Bundle initializes core Sales and Service objects, while the team extends the model with custom fields such as Loyalty\_Membership\_\_c and Customer\_Tier\_\_c to capture loyalty context. CRM Data Streams run hourly in delta mode, and Marketing Cloud Engagement syncs daily using delta extracts for engagement events. These datasets are processed through DLOs and identity resolution, resulting in a unified customer profile that combines CRM and engagement signals to power personalization and downstream AI models.
#### Streaming and Real Time Ingestion Patterns
These patterns are built for scenarios where milliseconds matter — when customer interactions, transactions, or signals must trigger immediate insight or action. They go beyond traditional, scheduled batch ingestion to enable event-driven data flow, where information is processed the moment it’s generated.
In the Salesforce Data 360 ecosystem, “real-time” isn’t a single mode — it’s a continuum of latency models. On one end lies near-real-time synchronization, where updates from systems of record (like CRM or ERP) are reflected in the Data 360 within seconds or minutes. On the other end is true real-time event capture, where client-side behavioral signals — such as clicks, purchases, or mobile interactions — are ingested and activated in milliseconds.
For architects, the distinction is more than semantic. It defines how pipelines are designed, how APIs are invoked, and how downstream decisions are made. Selecting the right pattern — whether near-real-time sync or event-streaming ingestion — ensures the system meets the business’s operational latency targets while maintaining data integrity, scalability, and governance.
#### Event Driven Ingestion via Ingestion API--Streaming
##### Context
This pattern enables any external system — such as a custom application, an Internet-of-Things (IoT) platform, a point-of-sale (POS) system, or a third-party service — to programmatically push event data into Data 360 in near-real-time as discrete events occur.
##### Problem
How can a developer reliably send single records or small asynchronous batches of events from an external application to Data 360 with low latency so the data is available quickly for processing, segmentation, and activation?
##### Forces
This pattern delivers low latency and better developer control but introduces several technical constraints and operational dependencies:
* **Developer Dependency:** Requires developer effort to implement authenticated REST API clients and error/retry logic — it is not a point-and-click connector.
* **Strict Schema-on-Write:** The Ingestion API enforces schema-on-write. A precise schema must be defined and uploaded to the connector configuration; all payloads must conform exactly or be rejected.
* **Dual Interaction Modes:** Same connector supports both streaming (JSON) for low-latency, record-by-record updates and bulk (CSV) for larger periodic syncs — architects must choose per use case.
* **Authentication & Security:** Calls must be authenticated via a Salesforce Connected App using OAuth 2.0 (e.g., JWT Bearer Flow for server-to-server). Token management, rotation, and least-privilege scopes are mandatory.
* **Operational Visibility:** Developers and platform teams must implement monitoring for response codes, retries, dead-letter queues, and schema drift alerts.
* **Real-time Graph Requirement:** For true instant activation (instant segmentation, real-time DMO mapping), the target Data Model Object (DMO) must be part of the real-time data graph; otherwise events traverse a slightly higher-latency pipeline.
##### Solution
This table contains solutions to this integration problem.
Solution Area
Fit
Comments / Implementation Details
Solution Fit
Best for low-latency event capture
Use the Data 360 Ingestion API (streaming JSON) for pushing single events or micro-batches. Configure the Ingestion API connector with a strict OAS 3.0 schema (.yaml). Use bulk CSV ingest for larger, less frequent syncs.
Handling Schema Changes
Strict / Managed
Schema changes are breaking: update OAS .yaml, version the connector, and perform contract testing. Implement rolling schema migration if producers cannot change simultaneously.
When Not to Use
Suboptimal
Not ideal if preprocessing is needed ( ex:deduplication, guaranteed order etc.) , or for extremely large bulk loads (use native bulk connectors or batch ETL). If the source cannot produce schema-valid payloads or cannot authenticate securely, use alternative ingestion methods.
Security & Governance
Mandatory
Use OAuth 2.0 with least-privilege scopes, rotate keys, log token usage. Enforce TLS 1.2+, validate client IPs if required, and ensure payload PII tagging. All events must carry provenance metadata (source, timestamp, schema version, idempotency key).
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from Ingestion API into Data 360
**In this scenario:**
* External System requests authentication via OAuth/JWT from Auth Server.
* Auth Server returns access token to External System.
* External System sends data ingestion POST request to Data 360 Ingestion API with authorization and JSON payload.
* Ingestion API validates request schema and authentication via Staging & Validation module.
* On schema/authentication failure:
* Error returned to External System.
* Rejection logged for monitoring and alerting.
* On successful validation:
* Records staged and committed into Data Lake Object (DLO).
* Success logged for monitoring.
* If enabled, data propagated to Real-Time Data Graph (DMO) triggering downstream workflows.
* Otherwise, data processed via standard batch or higher-latency pipeline.
* Ingestion API confirms success to External System.
* Monitoring components alert Admin on dead-letter queues, rejection rates, or latency issues.
##### Results
External event data is ingested into Data 360 DLOs with low latency. When the target DMO is part of the real-time graph, the data is available for instant segmentation, agent workflows, AI models, and operational activation. This enables rapid business responses to events originating from any connected system.
###### Ingestion Mechanisms
The ingestion mechanism depends on the connector and scheduling strategy defined within Data 360\.
Mechanism
When to use
Streaming JSON (Ingestion API)
Single events, micro-batches, behavioral events, clickstreams, IoT telemetry — when low latency is required.
Bulk CSV (Ingestion API bulk mode)
Larger, periodic uploads where latency requirements are relaxed.
Edge / Middleware
Use when you need validation, transformation, enrichment, or rate-limiting before pushing to the Ingestion API.
###### Error Handling and Recovery
* **Immediate (sync) errors:** 4xx responses for schema/auth errors — client must fix payload or token and retry.
* **Transient (async) failures:** 5xx responses — client retries with exponential backoff and jitter.
* **Dead-Letter Queue (DLQ):** Persistent failures land in DLQ for manual inspection and replay.
* **Monitoring:** Track schema rejection rate, authentication failures, latency percentiles, and DLQ backlog. Alert on thresholds.
###### Idempotent Design Considerations
* **Idempotency Key:** Every event should include a unique idempotency key/message ID.
* **Upsert Strategy:** Use business keys (ExternalId) to avoid duplicates on replays.
* **Dedup Window:** Architect should define deduplication windows and retention for idempotency tracking.
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Authentication:** OAuth 2.0 (JWT Bearer) recommended for server-to-server. Limit scopes to only ingestion.
* **Encryption:** TLS 1.2+ for transport; Data 360 enforces encryption at rest.
* **Least Privilege:** Connected App credentials have minimal rights; rotate secrets and instrument access logs.
* **Payload Governance:** Include consent/consumption flags in event metadata; apply ABAC/CEDAR policies immediately after ingestion.
* **IP Controls / Private Connect:** Where required, restrict access via allowlists or use Private Connect for private networking.
##### Sidebars
###### Timeliness
Timeliness depends on the ingestion schedule and data volume. Streaming JSON yields sub-second to second latency depending on processing and graph configuration. Bulk CSV is minutes to hours. Choose based on business SLAs.
###### Data Volumes
Individual event sizes should be small (< few KB). For high-throughput producers, consider batching at the producer or using a streaming buffer (Kafka/Kinesis) before calling the API.
###### State Management
* **Schema Versioning:** Maintain schema version in event metadata and use connector versioning when updating OAS contract.
* **Connector Offsets:** Data 360 handles commit semantics; producers should track idempotency keys and last successful sequence for safe replay.
###### Complex Integration Scenarios
In advanced enterprise architectures, this pattern can integrate with:
* **Edge Validation Layer:** Use middleware to translate heterogeneous producer formats to the required OAS contract, perform rate limiting, and pre-enrichment.
* **Hybrid Architectures:** Combine ingestion API for events and Connectors for bulk reconciliation.
* **Agent Activation:** Events mapped into real-time DMOs can trigger Agentforce workflows and Einstein models for automated decisioning.
##### Example
A retail chain streams point-of-sale (POS) purchase events into Data 360 inReal-Time to power immediate customer engagement. Each store runs a lightweight server component that collects transactions, enriches them with location and device metadata, and securely posts JSON events using JWT Bearer OAuth with idempotency keys to prevent duplicates. An admin defines the event structure by uploading an OAS schema for **point ofsale** and configuring the Ingestion API connector. Incoming events are ingested into the **pos\_sale DLO**, mapped to the **Sale DMO**, and added to the real-time graph. As a result, high-value purchases are detected instantly, triggering VIP workflows in Agentforce and updating customer segmentation to drive real-time personalization.
#### Real Time Web and Mobile Behavior Ingestion
##### Context
This pattern enables the capture of high-volume, granular user interaction data—such as page views, button clicks, product impressions, and video plays—from websites and mobile applications in trueReal-Time. It is foundational for delivering in-the-moment personalization, where every digital interaction can dynamically influence the user experience and drive engagement.
##### Problem
How can an enterprise capture and process a continuous stream of behavioral events from digital properties—spanning millions of user interactions per minute—and make that data immediately available in Data 360 to power real-time segmentation, personalization, and activation?
##### Forces
This use case introduces several design challenges that require a purpose-built, low-latency ingestion architecture:
* **Extreme Throughput :** High-traffic websites or mobile apps can emit millions of events per minute. The ingestion layer must scale horizontally to handle this volume without event loss or backpressure, ensuring consistent latency under peak loads.
* **Client-Side Instrumentation :** Unlike server-driven integrations, this pattern depends on client-side SDKs. A JavaScript beacon (Salesforce Interactions SDK) must be embedded in each page, or a native SDK integrated into mobile apps. This requires robust client deployment, versioning, and event schema governance.
* **Low-Latency Event Processing :** User actions—such as “add-to-cart” or “video play”—must reach Data 360 within seconds, enabling real-time activation and contextual responses (e.g., targeted offers, personalized recommendations).
* **Data Harmonization & Identity Resolution :** Captured events often include anonymous identifiers (cookies, device IDs, session tokens). To power Customer 360 use cases, these must be mapped to known profiles via Data 360’s identity resolution and harmonized to the Customer 360 Data Model.
##### Solution
The recommended approach is to use the **Salesforce Marketing Cloud Personalization Connector** — a **native, fully managed streaming pipeline** designed for high-throughput behavioral ingestion.
Solution Area
Fit
Comments / Implementation Details
SDK-based Event Capture
Best
Deploy the Salesforce Interactions SDK (web) or native SDK (mobile). These lightweight libraries capture and serialize user interactions inReal-Time, attaching metadata (session ID, timestamp, context).
Event Streaming Pipeline
Best
Events are sent to Marketing Cloud Personalization’s event streaming service over secure HTTPS. This layer is horizontally scalable and optimized for low-latency transmission (<2s).
Data 360 Integration
Best
Data 360’s Personalization Connector subscribes to the streaming feed, ingesting each event into a Data Lake Object (DLO) in nearReal-Time.
Data Model Mapping
Best Practice
The ingested DLO is mapped to Customer 360 Data Model Objects (DMOs). This enables linking anonymous and known users through Identity Resolution.
Real-Time Graph Enablement
Optional / Recommended
Include mapped DMOs in the real-time graph for instant segmentation, triggering personalized actions via Einstein or Agentforce workflows.
When Not to use
Suboptimal
This pattern is not ideal when: The source data is web client and events (use the Ingestion API instead). The organization lacks control over web/mobile clients. Real-time behavior tracking is not required (use batch ingestion).
Handling the schema Changes
Managed Evolution
Event schemas evolve as new interactions are added. SDKs should version event definitions. Backward-compatible changes (adding optional fields) are safe; breaking changes require connector reconfiguration and contract testing.
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from Mobile and web channels into Data 360
**In this scenario:**
* Deploy the SDK in web or mobile channels (user-interaction capture).
* Configure SDK with tenant ID, environment, and consent controls.
* Stream captured JSON events (metadata \+ attributes) to Marketing Cloud streaming endpoint.
* In Data 360 Setup, create & configure the Personalization Connector for the tenant.
* Ingest events into a DLO and map the DLO → DMO inside Data 360\.
* Enable the DMO in the real-time graph for immediate activation.
* Monitor latency, schema conformance, consent flags, throughput, error rates.
* Deploy to production and continually monitor.
##### Results
A continuous, low-latency stream of behavioral events flows from digital channels into Data 360\. Within seconds, each user action becomes available for real-time segmentation, predictive modeling, or triggered personalization, enabling truly adaptive customer experiences.
###### Ingestion Mechanisms
The ingestion mechanism depends on the connector and scheduling strategy defined within Data 360\.
Mechanism
When to Use
Interactions SDK (Web)
Real-time capture from web browsers and SPAs.
Mobile SDK
Real-time capture from native mobile applications.
Personalization Connector
Managed subscription between Marketing Cloud and Data 360\.
Real-Time Graph Mapping
Enables immediate activation in Segmentation, Einstein, and Journeys.
###### Error Handling and Recovery
* **Layered Fault Tolerance:** Implement multi-tier validation and retry mechanisms — client SDKs handle transient failures with exponential backoff, while the ingestion layer uses durable queues and replayable pipelines to prevent data loss.
* **Schema & Data Governance:** Version and validate event schemas continuously; invalid or evolving events are routed to a Schema Rejection or Dead-Letter Queue for safe triage and replay.
* **Idempotency & Deduplication:** Use stable event identifiers and upsert semantics to guarantee exact-once processing even during retries or replays.
* **Monitoring & Recovery Automation:** Continuous monitoring of throughput, latency, and error rates triggers automated recovery workflows — ensuring low latency, reliable delivery, and consistent real-time personalization outcomes.
###### Idempotent Design Considerations
* Every event must carry a unique idempotency key or message ID so duplicate submissions can be deduplicated downstream.
* Use business keys (e.g., sessionID \+ eventTimestamp \+ userID) where appropriate to identify duplicates.
* Define a deduplication window (e.g., 24 hours) during which duplicate events are ignored or filtered.
* Use upsert strategies where appropriate (e.g., update counters or flags rather than insert duplicates).
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Transport encryption:** TLS 1.2+ for all SDK → streaming service connections.
* Data encryption at rest in Data 360 and marketing stream.
* SDK respects **user consent flags (GDPR/CCPA)** and suppresses tracking if consent is denied.
* **Authentication of SDK traffic:** ensure only approved tenants/clients can stream events.
* **Metadata:** each event must include source ID, timestamp, schema version, session ID, idempotency key.
* **Least-privilege access:** SDK endpoints and connectors limited to event ingestion scope; rotate credentials regularly.
* **Data classification:** Annotate PII in event payloads, enforce policies immediately post-ingestion
##### Sidebars
###### Timeliness
* Timeliness depends on end-user activity and the event streaming configuration.
* Events captured via the Salesforce Interactions SDK and delivered through the Marketing Cloud Personalization Stream typically achieve sub-second to \~2-second latency before becoming available in the Data 360 Real-Time Graph.
* This enables near-instant segmentation, personalization, and activation within active user sessions.
###### Data Volumes
Individual behavioral events (e.g., click, view, add-to-cart) are lightweight — generally 1–5 KB per payload.
For large-scale digital properties, expect thousands to millions of events per minute.
To ensure throughput and resilience:
* Use the SDK’s built-in batching and retry mechanisms for high-traffic pages.
* Offload burst handling to the Marketing Cloud streaming buffer layer.
* Monitor ingestion throughput and error ratios using the connector metrics dashboard.
###### State Management
Each event includes metadata for state and version control:
* **Schema Versioning:** Embed schema version in every event; version the Personalization Connector when updating the schema.
* **Replay Handling:** Events that fail due to transient network issues are retried automatically by the SDK with exponential backoff.
* **Idempotency Keys:** Unique identifiers (sessionId \+ eventType \+ timestamp) ensure replayed events do not create duplicates in Data 360\.
* **Offset Management:** Data 360 tracks successful commits; any unprocessed events are re-queued by the connector until successfully ingested.
###### Complex Integration Scenarios
This pattern integrates seamlessly into advanced enterprise architectures:
* **Edge Enrichment Layer:** Add middleware (e.g., reverse proxy or serverless function) to inject additional context — such as geo, device type, or campaign metadata — before events reach Marketing Cloud.
* **Hybrid(Streaming + Batch):** Use the Marketing Cloud connector for real-time streams and combine it with batch ETL jobs (e.g., order data) for downstream reconciliation.
* **Agent Activation:** Events mapped to real-time DMOs can trigger Einstein Personalization, Agentforce workflows, or AI-driven decisioning to adapt the digital experience in the moment.
* **Multi-Tenant Governance:** Use consent flags and tenant-aware metadata to enforce privacy and compliance in multi-brand or multi-region environments.
##### Example
A global e-commerce company delivers personalized product recommendations and dynamic content to shoppers while they are actively browsing **www.retailx.com**, a React-based single-page application. Using the Salesforce Interactions SDK on the client side, the site captures page views, product clicks, cart actions, and video interactions inReal-Time. These events flow through the Marketing Cloud Personalization event stream and the Personalization connector into Data 360 DLOs, where they are modeled into DMOs and incorporated into the real-time graph. This architecture makes behavioral signals instantly available for segmentation, Einstein-driven personalization, and Agentforce activation, enabling responsive, in-session customer experiences
#### Near Real Time CRM Synchronization via Streaming
##### Context
For many business-critical processes, keeping Data 360 perfectly aligned with the latest updates in core CRM systems is essential. Customer service, sales, and marketing teams depend on up-to-date information to drive decisions, trigger journeys, and activate automation. This pattern provides a mechanism to synchronize changes to key Salesforce CRM objects—such as Contact, Account, and Case—into Data 360 with minimal delay, without the inefficiency or latency of frequent batch polling.
##### Problem
How can Data 360 maintain a near-perfectly synchronized state with key Salesforce CRM objects, ensuring that downstream analytics, segmentation, and AI-driven activation always operate on the most current data available?
##### Forces
This pattern introduces several technical constraints and architectural considerations:
* **Event-Driven Architecture :** Synchronization must be reactive—driven by change events in the CRM source org rather than periodic batch jobs.
* **Selective Object Support :** Not all Salesforce standard and custom objects support real-time streaming. Architects must reference the supported object list during design to avoid gaps.
* **Access and Permissions :** Enabling streaming requires that the integration user in the source org be assigned the “Enable Permissions for CRM Streaming” system permission.
* **Data Freshness vs. Processing Cost :** While near-real-time sync improves responsiveness, excessive event throughput may require horizontal scaling and robust error recovery mechanisms.
* **Security and Trust Layer Integration :** All event data must comply with Salesforce’s Trust and Security frameworks—encrypted in transit, validated for schema compliance, and processed within the organization’s trust boundary.
##### Solution
The recommended approach is to use the Salesforce CRM Connector with Streaming (Change Data Capture) enabled. When creating a data stream for a supported CRM object (e.g., Contact), administrators can toggle the “Enable Streaming” option. Under the hood, Salesforce’s Change Data Capture (CDC) platform publishes a ChangeEvent message every time a record is created, updated, deleted, or undeleted in the source CRM org.
The Data 360 CRM Connector subscribes to these CDC events and applies the corresponding changes to the mapped Data Lake Object (DLO) within Data 360 in near-real time. This ensures continuous synchronization between CRM and Data 360 with minimal manual intervention.
Solution Area
Fit
Comments / Implementation Details
CDC-based Streaming Connector
Best
Native Salesforce mechanism; fully managed and integrated with platform event infrastructure.
Event Subscription & Delivery
Best
Connector subscribes to ChangeEvent channels (e.g., /data/ContactChangeEvent) via durable replay IDs.
Data Mapping & Schema Evolution
Best Practice
Map streamed payloads to the corresponding DLO; handle schema versioning in metadata to prevent ingestion breaks.
Replay & Fault Recovery
Recommended
Utilize replay IDs and idempotency keys to avoid duplication and recover from transient errors.
Hybrid Mode (Streaming + Batch)
Optional
For unsupported objects or initial bulk load, use batch ingestion in combination with CDC streaming.
When Not to Use
Suboptimal
This pattern may be suboptimal when: The source object is not CDC-enabled. The use case does not require real-time updates (batch is sufficient). Network egress from the source org is restricted or event limits are exceeded.
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from CRM into Data 360 in nearReal-Time
**In this scenario:**
* Change occurs in Salesforce CRM (create/update/delete/undelete).
* CDC publishes a ChangeEvent to the internal Salesforce Event Bus.
* Data 360 CRM Connector subscribes to the Event Bus using a durable replay cursor.
* Event payload is validated for schema, permissions, and data integrity.
* Data 360 writes the validated event into the mapped **Data Lake Object (DLO)**.
* If enabled, mapped **Data Model Objects (DMOs)** are updated in nearReal-Time, powering segmentation and activation.
##### Results
Data 360 maintains a continuously synchronized mirror of key CRM data.
This enables:
* Real-time triggers (e.g., Journey launches when a Case is created).
* Up-to-date segmentation (e.g., move customers to the “Gold” segment upon Account status change).
* More accurate analytics and personalization based on live CRM context.
###### Ingestion Mechanisms
The ingestion mechanism for this pattern is natively managed through the Salesforce CRM Connector with Change Data Capture (CDC) enabled. Data 360 acts as a subscriber to the CDC event stream, ensuring reliable, low-latency synchronization between the source CRM org and Data 360\.
Mechanism
When to Use
Streaming via CDC (Preferred)
For all supported Salesforce standard and custom objects where near-real-time synchronization is required.
Hybrid Mode (CDC + Batch)
For objects not yet CDC-enabled, or where initial historical load is required.
Replay Subscription Mode
For resynchronization after downtime or deployment.
Error Isolation Mode
For testing and validation environments.
###### Error Handling and Recovery
* **Automatic Fault Recovery:** The CRM Connector automatically retries transient network or platform errors using exponential backoff and routes persistent failures to the Dead-Letter Queue (DLQ) for replay.
* **Schema & Auth Resilience:** Schema mismatches are quarantined in the Schema Rejection Queue for admin review, while authentication or permission errors trigger controlled retries and alerting through Data 360 Monitoring.
* **Guaranteed Event Continuity:** Durable ReplayIDs ensure no event loss during connector downtime; missed events are rehydrated through replay windows or batch re-sync jobs.
* **Data Integrity & Ordering:** Built-in idempotency (RecordID \+ SequenceNumber) prevents duplicates, and ChangeEventHeader.sequenceNumber preserves correct event ordering for every CRM record.
###### Idempotent Design Considerations
* **Event Uniqueness:** Each CDC event carries a ReplayID and ChangeEventHeader.entityName for deterministic deduplication.
* **Upsert Strategy:** Implement UPSERT logic based on record ID to ensure repeated events don’t create duplicates.
* **Replay Handling:** Use the connector’s replay cursor to resume from the last committed offset in case of transient failures.
* **Schema Evolution: M**aintain a schema version in event metadata and update DLO mappings when CRM schema changes.
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Encryption and Trust :** All events are transmitted using **TLS 1.2+** and stored encrypted at rest in Data 360\.
* **Access Control:** Only authenticated connectors with appropriate integration permissions can subscribe to CDC channels.
* **Schema Validation:** Every event payload is validated against the DLO schema before ingestion.
* **Consent Propagation:** Consent and data classification metadata flow downstream with each event to preserve privacy and compliance (GDPR, CCPA).
* **Operational Governance:** Events are logged, audited, and monitored for replay, schema rejection, and throughput anomalies via the Data 360 Trust Layer.
##### Sidebars
###### Timeliness
* CDC events are processed in near-real time—typically within seconds of the change in CRM.
* Latency may vary based on event volume and connector throughput, but Data 360 guarantees sub-minute availability for supported objects.
###### Data Volumes
* Each event payload is lightweight (~1–5 KB).
* For high-change-rate objects like Case or Contact, ensure throughput limits align with Salesforce CDC event allocations.
###### State Management
Each event includes metadata for state and version control:
* **Replay IDs:** Used for sequential event recovery.
* **Schema Versioning:** Maintain version metadata to manage contract changes.
* **Idempotency Keys:** Deduplicate replays across retries.
* **Offset Commit:** Data 360 persists commit state after each successful batch of events.
###### Complex Integration Scenarios
This pattern integrates seamlessly into advanced enterprise architectures:
* **Hybrid(Streaming + Batch):** Use CDC for delta updates and bulk jobs for full refreshes.
* **Cross-Org Streaming:** Multiple source orgs can stream into the same Data 360 tenant, unified via DMO mappings.
* **Agent Activation:** Real-time object updates trigger Einstein or Agentforce automations.
* **Event Routing:** Middleware (e.g., MuleSoft or Event Relay) can enrich or route CDC messages before ingestion.
##### Example
A global bank wants to ensure that customer data changes in Salesforce Sales Cloud instantly reflect in Data 360.When a Contact’s address is updated in Sales Cloud, the Change Data Capture mechanism publishes a ContactChangeEvent.The Data 360 CRM Connector consumes this event, applies the update to the Customer DLO, and automatically updates all associated Customer 360 profiles. This triggers an Einstein Next Best Action to verify the new address—completing the feedback loop within seconds of the original CRM change.
#### Event Stream Ingestion from Cloud Messaging Platforms--Kinesis and MSK
##### Context
Modern digital enterprises rely on real-time event streaming platforms like Amazon Kinesis Data Streams and Amazon MSK (Managed Streaming for Apache Kafka) to capture continuous data flows from distributed applications, IoT devices, and transactional systems. Data 360 enables direct ingestion from these platforms through native, first-party connectors — eliminating the need for custom ETL or middleware-based solutions. This pattern is designed for high-throughput, low-latency data ingestion, powering near-real-time insights, personalization, and AI-driven activation.
##### Problem
How can an enterprise securely and efficiently connect Data 360 to AWS Kinesis or AWS MSK Kafka topics to continuously ingest structured event and profile data, ensuring schema compliance, scalability, and governance?
##### Forces
This pattern introduces multiple architectural and operational considerations:
* **Native Connector Availability:** Salesforce provides generally available native connectors for both Amazon Kinesis and Amazon MSK. These connectors offer first-party support and eliminate the need for custom API-based pipelines.
* **Authentication & Security:** Each connector requires **AWS-level authentication**.
* For Kinesis, this uses AWS Access Key and Secret Key, governed by IAM policies.
* For MSK, authentication can be configured via Access Key/Secret or OpenID Connect (OIDC).
* **Schema Definition:** Data 360 requires a schema to interpret the streaming payload.
For Kinesis, the schema file is uploaded during connection setup, defining event structure and field mappings.
* **Configuration Source:**
* Kinesis connector subscribes to a specific Kinesis Stream name.
* MSK connector subscribes to a Kafka Topic within the MSK cluster.
* **Network Access:** For secure environments, connectors can be configured with PrivateLink or VPC routing, ensuring no data traverses the public internet.
* **Operational Governance:** Streaming throughput, schema validation, and authentication events are monitored within the Data 360 Trust Layer, ensuring compliance and traceability.
##### Solution
The solution leverages the **native Amazon Kinesis** or **Amazon MSK** connectors within **Data 360**.
Solution Area
Fit
Comments / Implementation Details
Kinesis Native Connector
Best
First-party integration with AWS Kinesis; supports continuous high-throughput ingestion.
MSK Native Connector
Best
Managed Kafka ingestion with OIDC and key-based authentication support.
Schema Mapping & Validation
Best Practice
Upload schema (.json/.avro) defining event structure; enforces consistency during ingestion.
IAM Configuration
Recommended
Assign least-privilege IAM role with read-only access to target Kinesis stream or MSK topic.
Private Network Routing
Optional
Configure PrivateLink/VPC endpoints for secure, internal routing.
Hybrid Pattern(Streaming + Batch)
Optional
Use streaming for deltas and batch ingestion for backfills or historical loads.
Error Isolation Mode
Recommended
Route schema rejects and transient errors to DLQ for replay
##### Sketch
This diagram illustrates sequence of Steps to ingest the data from Event platforms like Kafka and Kinesis into Data 360 in nearReal-Time
**In this scenario:**
* Applications or devices publish events to Kinesis Stream or MSK Topic.
* Data 360 Connector authenticates using AWS credentials or OIDC token.
* Connector continuously polls or subscribes to the stream.
* Events are staged, validated for schema and policy, then committed to Data Lake Object (DLO).
* If mapped, Data Model Objects (DMOs) are updated in near real-time for activation.
* Monitoring Layer tracks metrics, schema rejects, and latency.
##### Results
Continuous, low-latency ingestion of structured data directly from AWS Kinesis or MSK into Data 360\. Data is immediately available for:
* Identity Resolution
* Real-time Segmentation
* Einstein AI Activation
* Agentforce-driven Triggers
Eliminates dependency on batch ETL, enabling stream-based architectures aligned with enterprise event-driven designs.
###### Ingestion Mechanisms
Mechanism
When to Use
Kinesis Connector (Preferred)
For AWS-native streaming sources requiring continuous ingestion of high-volume, structured data.
MSK Connector
For organizations running event pipelines on Kafka-compatible platforms.
Hybrid(Streaming + Batch)
For incremental event ingestion combined with periodic bulk loads.
###### Error Handling and Recovery
* **Automatic Retries:** Connectors retry transient network or platform errors with exponential backoff.
* **Schema Rejections:** Invalid payloads route to the schema rejection queue for administrator review.
* **DLQ Replay:** Persistent failures are captured in dead-letter queues for reprocessing.
* **Idempotency Control:** Event keys or sequence numbers ensure deduplication and ordered ingestion.
* **Monitoring Integration:** All failures, retries, and throughput metrics surface in Data 360 Monitoring dashboards.
###### Idempotent Design Considerations
* **Event Uniqueness & Tracking:** Each event is assigned a deterministic unique key (e.g., PartitionKey \+ SequenceNumber for Kinesis, or Topic \+ Partition \+ Offset for MSK) to ensure exact-once ingestion.
* **Connector Checkpointing:** Data 360 connectors persist the last processed offset or sequence number to resume ingestion safely after failures or restarts.
* **Deduplication & UPSERT Logic:** During DLO commits, duplicate events are detected and skipped; valid records are upserted using the unique key to maintain consistency.
* **Replay & Recovery Control:** Failed or delayed events are replayed from stored offsets through Dead-Letter and Replay Queues, ensuring reliable recovery without duplication.
###### Security Considerations
Security is integral throughout the ingestion pipeline, from authentication to encryption and access control.
* **Authentication:** Secure credential exchange using AWS IAM policies or OIDC.
* **Encryption:** Data encrypted **in transit (TLS 1.2+)** and **at rest (AES-256)** within Data 360\.
* **Access Control:** Least-privilege roles enforced; connectors scoped to specific streams/topics.
* **Governance:** Lineage and classification metadata applied to every record for full traceability.
* **Network Security:** Optionally deploy within **private subnets** using AWS PrivateLink.
##### Sidebars
###### Timeliness
* **Near-Real-Time Processing:** CDC and streaming connectors process events within seconds of source changes, typically ensuring sub-minute data freshness.
* **Deterministic Latency:** End-to-end lag depends on source throughput, event batching, and network conditions, but Data 360 guarantees predictable SLA-driven latency for supported objects.
* **Elastic Scaling:** The ingestion pipeline auto-scales under high event volume, preserving timeliness even during peak data bursts.
* **Operational Visibility:** Monitoring dashboards expose event lag, commit timestamps, and replay status for latency assurance and troubleshooting.
###### Data Volumes
* **Lightweight Payloads:** Individual CDC or streaming events are compact (1–5 KB typical size), optimized for high-frequency updates.
* **High-Change Objects:** For volatile entities (e.g., Case, Contact, Order), architects must ensure CDC allocations and event throughput align with expected update rates.
* **Parallel Streams:** Data 360 supports multi-stream ingestion for horizontal scaling across large object volumes or multiple source orgs.
* **Backpressure Handling:** Built-in throttling mechanisms maintain ingestion stability under load without dropping events.
###### State Management
Each event includes metadata for state and version control:
* **Replay & Offset Tracking:** Every event carries Replay ID and sequence metadata, enabling ordered delivery and checkpoint-based recovery.
* **Schema Versioning:** Version tags within event headers ensure backward-compatible processing when source schemas evolve.
* **Idempotency Keys:** Each event includes a unique transaction or commit key, allowing Data 360 to deduplicate replays and retries safely.
* **Atomic Commit:** The ingestion pipeline only marks offsets as complete once downstream commits to DLOs succeed, ensuring consistency.
###### Complex Integration Scenarios
This pattern integrates seamlessly into advanced enterprise architectures:
* **Hybrid Ingestion:** Combine CDC for incremental deltas with bulk Data Streams for full refreshes, maintaining both freshness and completeness.
* **Cross-Org Streaming:** Multiple CRM or ERP orgs can publish to the same Data 360 tenant, unified through DMO mapping and ontology alignment.
* **Event Enrichment:** Middleware (e.g., MuleSoft, Event Relay) can enrich, filter, or route streaming data before it reaches Data 360\.
* **AI and Agent Activation:** Real-time updates trigger downstream automation, such as Einstein predictions or Agentforce responses, within seconds of the originating event.
##### Example
A global retail enterprise uses AWS Kinesis to stream point-of-sale and web interaction data.Data 360’s Kinesis connector authenticates via IAM credentials and continuously ingests events into a Transaction DLO.Each record is schema-validated, enriched with metadata, and immediately propagated to the Customer DMO.Within seconds, Einstein AI models update customer segments and Agentforce triggers real-time next-best-offer recommendations — achieving a fully event-driven personalization loop.
## Zero Copy Patterns--Inbound and Outbound
Zero Copy is more than an integration method — it’s a foundational shift in how enterprise data moves, or rather, doesn’t move. Traditionally, data integration required copying large volumes of records through ETL pipelines, creating redundant data stores, synchronization delays, and governance challenges. Zero copy eliminates all of that.
In this model, Data 360 connects directly to external data platforms like Snowflake and Databricks, securely reading and activating data in place — without ever moving or duplicating it. The result is a seamless bridge between your enterprise data lakehouse and the Salesforce ecosystem, delivering instant access, lower operational overhead, and stronger data governance.
#### Inbound Zero Copy--External Platforms to Data 360
Inbound zero copy capabilities allows Data 360 to query and harmonize external data at the source — such as customer profiles, transactions, or product data — stored in Snowflake or Databricks. Instead of ingesting files, Data 360 establishes a secure, metadata-aware connection that leverages existing schema definitions and security policies in the external warehouse.
* **Direct Federation:** Data 360 reads data in place through secure, optimized queries without replication.
* **Unified Governance:** Data remains under the source system’s security, access control, and compliance framework.
* **Operational Efficiency:** Eliminates ETL overhead and storage duplication, reducing cost and complexity.
* **Real-Time Readiness:** Enables on-demand harmonization — the moment data updates in Snowflake, it’s immediately available for activation in Data 360\.
##### Context
Modern data-driven enterprises manage petabytes of customer, transaction, and telemetry data within cloud-scale data lakehouse platforms such as Snowflake and Databricks. These environments serve as the single source of truth for analytics, AI, and compliance.
Data 360 introduces Zero CopyData Federation, allowing Data 360 to directly query and use external datasets *in place* — without copying, transforming, or storing redundant data.
This pattern empowers organizations to extend the Customer 360 fabric into their existing data warehouse or lakehouse infrastructure — achieving real-time unification and activation with zero duplication, zero latency, and zero compromise on governance.
##### Problem
How can enterprises leverage rich datasets already curated in Snowflake, Databricks, or open lake formats like Apache Iceberg — for segmentation, identity resolution, and activation in Data 360 — without the cost, latency, and governance overhead of ETL pipelines or physical data movement?
##### Forces
This pattern introduces multiple architectural, security, and performance considerations:
**Network & Security**
* Data 360 must establish a secure, private connection to the external warehouse or lakehouse.
* Typically configured using Salesforce Private Connect or PrivateLink/VPC Peering, ensuring traffic never leaves the customer’s controlled network.
* External systems must allowlist Data 360 IPs and enforce TLS 1.2+ encryption.
**Authentication & Access Control**
* Supports Key Pair authentication, OAuth 2.0, or Identity Provider (IdP)-based trust delegation (Data 360 acting as a trusted client)
* Role-based access control (RBAC) in the external system enforces least privilege access for query execution.
**Performance and Compute Dependency**
* Query federation pushes down SQL execution into Snowflake or Databricks, leveraging their compute clusters.
* Performance and cost scale with external query load — segmentation latency and cost are tied to external compute configuration.
**Evolving Standards: File Federation**
* A next-generation model, File Federation, leverages open table formats such as Apache Iceberg or Delta Lake, enabling Data 360 to read directly from object storage (e.g., Amazon S3, Azure ADLS, Google Cloud Storage).
* By bypassing the source compute layer, File Federation drastically reduces latency and cost for read-heavy analytical workloads while maintaining schema integrity.
**Governance and Compliance**
* Data never leaves the source platform — compliance, encryption, and retention policies remain enforced at origin.
* All metadata, lineage, and consent attributes propagate into Data 360’s Trust Layer to ensure end-to-end traceability.
##### Solution
The recommended approach is to use native Zero Copy connectors for Snowflake, Databricks, or File Federation within Data 360.
Solution Area
Fit
Comments / Implementation Details
Snowflake Zero Copy Connector
Best
First-party native integration; establishes live query federation via Snowflake’s Data Sharing or External Table APIs.
Databricks Zero Copy Connector
Best
Supports direct live access to tables/views in Delta Lake; pushdown queries execute in Databricks runtime.
Data 360 directly reads open table formats from object storage without external compute dependency. Ideal for massive datasets.
Private Network Configuration
Recommended
Use Salesforce Private Connect or VPC peering for secure network-level federation.
Authentication & Key Management
Best Practice
Implement secure key-based or OAuth-based authentication with periodic rotation and vault management.
Schema Registration
Required
Data 360 retrieves external schema and maps it to an External Data Lake Object (External DLO).
Governed Metadata
Recommended
All External DLOs inherit classification, consent, and lineage metadata for compliance visibility.
##### Sketch
The following diagram illustrates how to set up a zero copy connection and create external DLOs in Data 360\.
In this scenario:
* Administrator configures a Zero Copy connection in Data 360 Setup (Snowflake, Databricks, or File Federation).
* Secure authentication and network routing are established (Private Connect / OAuth / Key Pair).
* Admin creates a Data Stream selecting the external source — browsing live databases, schemas, and tables.
* Instead of copying data, Data 360 creates an External DLO (Data Lake Object) — a metadata pointer referencing the live table or Iceberg file.
* External DLOs are mapped to Customer 360 entities (e.g., Customer, Transaction, Product).
* Data 360 queries the source in place during segmentation, activation, or insight computation.
* All access, query lineage, and metadata are audited within the Data 360 Trust Layer.
##### Results
* External data remains in Snowflake, Databricks, or S3 — no ETL, no duplication, no additional storage.
* Data 360 gains real-time, read-time access to enterprise-scale data for identity resolution, calculated insights, and activation.
* Organizations maintain complete control under their existing governance, encryption, and compliance frameworks.
* This pattern enables a true Zero Copy architecture — combining the performance of local access with the governance of federated storage.
###### Calling Mechanisms
The calling mechanism depends on the solution chosen to implement this pattern.
Mechanism
When to Use
Snowflake Federation (Preferred)
For live, high-performance query federation with governed enterprise data warehouses.
Databricks Federation
For unified analytics and lakehouse environments with Delta or Parquet-backed datasets.
File Federation (Apache Iceberg / Delta Lake)
For large-scale datasets in object storage where compute detachment and cost optimization are key.
Hybrid Mode (Zero Copy + Ingestion)
When historical data needs one-time ingestion but live data is accessed via Zero Copy.
###### Error Handling and Recovery
* **Automatic Retry & Query Backoff:** Transient connectivity or query timeouts automatically retried using exponential backoff.
* **Schema Mismatch Isolation:** Changes in source schema (e.g., new columns) are logged to the Schema Rejection Queue; administrators can remap or refresh schema metadata.
* **Authentication Failover:** If credentials expire, Data 360 retries connection using stored refresh tokens or key rotation policies.
* **Compute Availability Detection:** If Snowflake or Databricks cluster is paused, Data 360 suspends federation jobs and retries when compute resumes.
* **Monitoring Integration:** All connection health, query latency, and lineage metadata visible in Data 360 Monitoring dashboards.
###### Idempotent Design Considerations
* **Query Determinism:** Federated queries use consistent snapshot semantics to ensure stable, repeatable reads during segmentation or activation.
* **External DLO Versioning:** Each federated query includes schema and timestamp metadata for lineage tracking.
* **Offset-less Access:** Since Zero Copy is read-only, it doesn’t rely on event offsets — consistency is enforced via the external system’s ACID guarantees (Snowflake/Delta Lake).
* **Schema Drift Management:** Maintain versioned schema mappings in Data 360; refresh External DLO metadata on source evolution.
###### Security Considerations
Security is integral throughout the federation model — ensuring no compromise in trust or compliance.
* **Encryption:** All data exchanges use TLS 1.2+; external warehouses encrypt at rest using AES-256.
* **Access Control:** External tables are accessed through least-privilege roles with read-only permissions.
* **Network Isolation:** Private Connect or VPC routes prevent any exposure to public endpoints.
* **Governed Data Flow:** Lineage, consent, and classification metadata flow into the Data 360 Trust Layer for policy enforcement.
* **Auditability:** Every federated query and schema access event is logged for compliance traceability (GDPR, CCPA, HIPAA).
##### Sidebars
###### Timeliness
* Queries execute live against the external warehouse or storage, ensuring real-time visibility of the latest data state.
* Segmentation or activation runs reflect up-to-the-second changes in Snowflake, Databricks, or S3-backed Iceberg tables.
* Query latency depends on the performance tier of the source system — typically seconds to tens of seconds per query.
* Ideal for analytical and AI workloads demanding “fresh, not copied” data access.
###### Data Volumes
* Supports petabyte-scale datasets natively stored in Snowflake or Databricks without replication.
* Data 360 only retrieves results — not raw datasets — minimizing network and compute costs.
* File Federation optimizes large analytical scans through partition pruning and columnar pushdown.
* Scales linearly with warehouse compute capacity and Data 360’s federated query orchestration layer.
###### State Management
* External DLOs persist connection, schema, and version metadata in Data 360\.
* Schema evolution is managed automatically through metadata refresh cycles.
* Query lineage includes timestamps, user identity, and execution metrics for traceability.
* No stateful ingestion or offsets are maintained — consistency is inherited from the external source’s ACID guarantees.
###### Complex Integration Scenarios
* **Hybrid Mode:** Combine Zero Copy (for live federation) with ingestion (for historical datasets).
* **Cross-Warehouse Access:** Data 360 can federate from multiple Snowflake or Databricks tenants within one organization.
* **AI/BI Interoperability:** External systems (e.g., SageMaker, Tableau, Power BI) can query Data 360’s enriched profiles back via reverse Zero Copy.
* **File Federation Extension:** Enterprises adopting open lake formats (Iceberg/Delta) can unify structured and unstructured data under one federated model.
##### Example
A global financial enterprise stores all transactional and interaction data in Snowflake, while maintaining customer attributes and marketing events in Data 360. Using Zero Copy Data Federation, Data 360 connects securely to Snowflake via Private Connect.When a segmentation job runs, for example, e.g., “Customers with >$10K spend in the last 30 days, Data 360 pushes down the query into Snowflake, retrieves aggregated results, and activates those profiles instantly in Journey Builder. No replication or ETL needed. This example uses real-time, federated intelligence that is unified across the enterprise data ecosystem.
#### Outbound Zero Copy--Data 360 to External Platforms
Outbound zero copy extends the same principle in reverse. Instead of exporting or copying datasets from Data 360, external systems like Snowflake can query Data 360 directly, treating it as a federated source of enriched customer intelligence.
* **Reverse Federation:** External analytics or AI platforms can access Data 360’s unified profile data without extracting it.
* **Data Activation at Source:** Business teams can leverage insights where the data already resides — whether for AI modeling, reporting, or customer personalization.
* **Latency-Free Interoperability:** No batch exports or sync jobs; insights flow instantly between platforms.
* **Consistent Semantics:** Because both systems share the same ontology and schema mappings, context and meaning are preserved across ecosystems.
Zero copy redefines the role of Data 360 from a *data repository* to a *semantic activation layer*. It enables organizations to keep data exactly where it belongs — in governed, high-performance warehouses — while still unlocking its full value inside Salesforce’s trust boundary.
This pattern aligns with modern data mesh and AI-native architectures: data stays decentralized, but intelligence becomes unified. Architects can now build activation pipelines that are faster, leaner, and more compliant — no copying required.
##### Context
Modern enterprises increasingly operate in multi-platform data ecosystems, where Salesforce Data 360 powers unified customer profiles and activation, while enterprise data warehouses like Snowflake or Databricks serve as analytical backbones for data science, machine learning, and BI workloads.
Salesforce Data 360’s Zero Copy Outbound Sharing capability bridges these environments seamlessly — allowing governed, secure, and real-time access to harmonized Data 360 data directly within Snowflake or Databricks, without replication or ETL.
This enables analysts and data scientists to query, visualize, and model on the same live, trusted data powering marketing, sales, and service activation.
##### Problem
How can an enterprise securely and efficiently expose Data 360’s unified customer profiles and calculated metrics (e.g., Lifetime Value, Churn Risk) to external analytical systems — without copying data, breaking governance, or introducing latency through traditional reverse ETL pipelines?
##### Forces
This pattern introduces multiple architectural, governance, and operational considerations:
* **Governed Security:** Access to Data 360 data must be controlled, granular, and auditable. Zero Copy sharing uses explicit object-level access, ensuring only approved Data Model Objects (DMOs) and Calculated Insight Objects (CIOs) are available to designated consumers.
* **Explicit Object Selection:** Administrators curate shareable data through a Data Share, explicitly selecting which objects to expose. This maintains governance and minimizes risk exposure.
* **Bi-Lateral Configuration:** Both Data 360 and the external warehouse require setup. Data 360 defines the Data Share Target (Snowflake/Databricks), while the receiving system must accept and instantiate the share.
* **Query Federation Model:** Once accepted, the external platform queries live, governed Data 360 data via federated views, eliminating extract jobs or manual refresh cycles.
* **Open Standards Evolution:** Emerging approaches like File Federation leverage open table formats (e.g., Apache Iceberg) to enable read-only access at the storage layer — improving scalability, performance, and interoperability across multi-cloud architectures.
##### Solution
The solution leverages Salesforce Data 360’s native Zero Copy Sharing with data platforms like Snowflake or Databricks.
Solution Area
Fit
Comments / Implementation Details
Data Share Creation
Best
Administrator creates a Data Share within Data 360, adding selected DMOs and CIOs (e.g., Unified Individual, Customer Health Score).
Target Configuration
Best
Create a Data Share Target specifying Snowflake or Databricks account identifiers and authentication parameters.
Share Publishing
Best Practice
Link the Data Share to the Data Share Target to publish securely.
Warehouse Acceptance
Required
The external administrator accepts the share, materializing shared objects as read-only views/tables in the warehouse.
Granular Access Control
Recommended
Apply object- and role-based permissions within Data 360; align with warehouse-level role-based access control.
Federated Query Access
Best
Analysts query live shared data via standard SQL; joins with native warehouse data for downstream analytics and ML.
File Federation Option
Optional
For large datasets, leverage Apache Iceberg–based federation for direct S3 or Delta Lake reads without compute dependency.
##### Sketch
The following diagram illustrates a call from the Salesforce Data 360 to an external Data Platform.
**In this scenario:**
* Data 360 Administrator defines a Data Share including Unified Customer and Calculated Insight objects.
* A Data Share Target (Snowflake or Databricks account) is registered with secure credentials and governance policies.
* Data 360 publishes the share; Snowflake/Databricks administrators accept it.
* Shared data appears as secure, read-only tables within the warehouse.
* Analysts, BI tools, or ML pipelines query the live, unified customer data without copying or syncing.
* All access is audited within the Data 360 Trust Layer and warehouse governance logs.
##### Results
* External warehouses gain real-time, queryable access to harmonized Data 360 data.
* Eliminates Reverse ETL pipelines, reducing operational burden and latency.
* Enables AI/ML training, predictive modeling, and advanced BI directly on unified data.
* Maintains zero duplication, strong governance, and secure-by-design access control.
* Completes the bi-directional Zero Copy loop, where inbound federation and outbound sharing coexist under a single governance model.
###### Calling Mechanisms
The calling mechanism depends on the solution chosen to implement this pattern.
Mechanism
When to Use
Snowflake Secure Data Share (Preferred)
Use when your enterprise warehouse is Snowflake and you need live, governed access to harmonized Data 360 datasets without data movement or duplication. Ideal for analytics, AI, and compliance-driven workloads requiring zero-latency sharing and native lineage enforcement.
Databricks Delta Share
Use when downstream consumers operate in Databricks or Delta Lake environments and require real-time, read-only access to unified or activated datasets via the open Delta Sharing protocol.
External Table Share (Apache Iceberg / Parquet)
Use when maintaining open-format architectures in object storage (S3, ADLS, or GCS) and needing interoperable, low-cost sharing across analytical engines such as Athena, BigQuery, or Snowflake-on-Iceberg.
Data Share API (Programmatic Access)
Use when custom apps or middleware (e.g., MuleSoft) must discover, subscribe, or consume shared datasets securely via APIs, with event-based refresh notifications and fine-grained access control.
Hybrid Share (Zero Copy + Outbound Share)
Use when implementing bidirectional exchange patterns — leveraging Zero Copy for inbound data and Outbound Data Share for publishing insights, ensuring semantic and governance consistency across enterprise data planes.
###### Error Handling and Recovery
* **Connection Retries:** Automated retries for transient connection or authentication failures between Data 360 and warehouse.
* **Share Validation:** Invalid or unauthorized share configurations are quarantined in an **Admin Review Queue**.
* **Sync Health Monitoring:** Data 360 surfaces live share status, query latency, and access logs via Monitoring dashboards.
* **Access Revocation:** Administrators can revoke shares instantly, disabling access at both ends without residual data copies.
* **Governed Audit Trail:** All configuration and access changes are logged for compliance verification.
###### Idempotent Design Considerations
* **Consistent Share Identification:** Each Data Share and Data Share Target pair has a unique identifier, ensuring exact governance and access traceability.
* **Immutable Views:** Shared data objects are read-only; consumers cannot mutate state, ensuring deterministic results and compliance.
* **Atomic Share Lifecycle:** Share publishing, revocation, and updates are atomic operations — either fully completed or rolled back.
* **Replay Consistency:** When Data 360 data refreshes, warehouse-side queries always return the latest consistent snapshot, eliminating stale reads.
###### Security Considerations
Security underpins every aspect of Zero Copy Sharing:
* **Authentication**: Mutual trust established using OAuth 2.0, private key exchange, or identity federation (OIDC).
* **Encryption**: Data encrypted in transit (TLS 1.2+) and at rest (AES-256).
* **Access Control**: Object-level permissions enforce least-privilege access; governed by the Data 360 Trust Layer.
* **Network Security**: Data exchanges occur through private network links such as Salesforce Private Connect or Secure Data Exchange APIs.
* **Governance Metadata**: Every shared object carries lineage, classification, and consent attributes for full traceability and regulatory compliance.
##### Sidebars
###### Timeliness
* **Real-Time Availability:** Shared data reflects the most current state of Data 360 without replication delays.
* **Query Freshness:** Changes in DMOs or CIOs propagate instantly to shared warehouse views.
* **Performance Elasticity:** Query pushdown adapts dynamically to warehouse compute resources.
* **Monitoring:** Live dashboards expose shared latency and query performance metrics for operational assurance.
###### Data Volumes
* **Scalable Sharing:** Supports granular object-level or full-domain data sharing depending on analytical needs.
* **Optimized Query Performance:** Snowflake/Databricks cache shared data intelligently to minimize latency.
* **Storage Efficiency:** Zero duplication eliminates redundant storage costs.
* **File Federation Option:** For petabyte-scale datasets, direct Iceberg-based sharing bypasses computation and accelerates access.
###### State Management
* **Schema Evolution:** Version-controlled schemas ensure compatibility when the Data 360 model evolves.
* **Access State Tracking:** Active/inactive share states maintained within Data 360 for lifecycle governance.
* **Metadata Synchronization:** Updates to shared object definitions automatically reflect in downstream warehouse catalogs.
* **Immutable State Guarantee:** Warehouse views always represent a consistent, point-in-time state of Data 360 data.
###### Complex Integration Scenarios
* **Hybrid Mode:** Combine Zero Copy (for live federation) with ingestion (for historical datasets).
* **Cross-Warehouse Access:** Data 360 can federate from multiple Snowflake or Databricks tenants within one organization.
* **AI/BI Interoperability:** External systems (e.g., SageMaker, Tableau, Power BI) can query Data 360’s enriched profiles back via reverse Zero Copy.
* **File Federation Extension:** Enterprises adopting open lake formats (Iceberg/Delta) can unify structured and unstructured data under one federated model.
##### Example
Cross-cloud analytics enables organizations to combine governed Salesforce Data 360 data with native datasets in platforms like Snowflake and Databricks to deliver a complete, 360-degree analytical view. Through multi-tenant access, different business units can securely consume curated and policy-controlled data slices via separate shares without duplicating data. Data scientists can then perform federated AI and machine learning by training models directly on unified customer profiles within Snowflake ML or Databricks MLflow environments. Throughout this process, built-in lineage, governance, and auditing capabilities ensure that all data access and usage remain compliant with enterprise policies and regulatory requirements such as GDPR and HIPAA.
## Unified Multi Org Data Platform with Data Cloud One
Data Cloud One enables organizations with multiple Salesforce orgs (for example, due to business units, regions, product lines or acquisitions) to share a single, central Data 360 instance. This org acts as the “home org,” while other orgs, called “companion orgs,” can access and act on that unified data — with minimal effort, no custom code, and full governance controls.
##### Context
Enterprises often run more than one Salesforce org (for example, one for sales, one for service, one for marketing, or distinct regions). Each org may have its own data, configuration, and processes. Prior to Data Cloud One, each org either required its own Data 360 setup or complex custom code to share data across orgs. Data Cloud One simplifies this by allowing a single “home” org with Data 360 and multiple “companion” orgs that connect via low-code configuration and metadata sharing.
##### Problem
How can a business enable consistent use of the unified Customer 360 data—ingested, harmonised and managed by the home org’s Data 360—across all its Salesforce orgs (so that sales, marketing, service, etc., all use the same underlying data), while avoiding duplication of effort, custom coding, separate Data 360 instances per org, and governance gaps?
##### Forces
This pattern introduces multiple architectural, security, and performance considerations:
* **Multi-Org Complexity**: Each business unit’s org may have different data, custom objects, security, and processes—maintaining consistent unified views is hard.
* **Duplication & Cost**: Running a separate Data 360 instance per org means extra setup, extra governance, extra licensing, and risk of data silos.
* **Governance & Data Sharing Controls**: You need to decide *which data* each companion org can see and act on — you cannot simply share “everything” without governance risk.
* **Speed of Setup**: Marketing, sales or service teams cannot wait weeks for custom code to make cross-org data available—they need click-config solutions.
* **Data Residency, Regional Considerations**: If home and companion orgs are in different regions, there may be legal or regulatory constraints about where data is stored or how it’s shared.
##### Solution
The following table contains various solutions to this integration problem.
Solution Area
Fit
Comments / Implementation Details
Home Org Provisioning
Best
Designate one Salesforce org as the Home Org where Data 360 is provisioned; this becomes the central data repository and governance hub.
Companion Org Connection
Best
Configure Companion Connections from the Home Org to one or more Companion Orgs via the Data Cloud One app — no custom code required.
Data Space Definition
Best Practice
Define Data Spaces within the Home Org to logically segment data (e.g., Retail, Service, Marketing) and isolate access boundaries.
Data Space Sharing
Best
Explicitly share selected Data Spaces from the Home Org to Companion Orgs, ensuring governed, role-based visibility of unified data.
Access Configuration
Required
In Companion Orgs, enable the Data Cloud One app and assign user permissions for profile, insight, and segment access.
Governance & Policy Control
Recommended
Centralize all ingestion, identity resolution, and trust configurations in the Home Org, maintaining end-to-end governance.
Multi-Org Synchronization
Best
Data changes and calculated insights in the Home Org are reflected inReal-Time across Companion Orgs through managed sync pipelines.
Hybrid Deployment Option
Optional
For large enterprises, multiple Companion Orgs can connect to a single Home Org while maintaining local context and compliance boundaries.
##### Sketch
The following diagram illustrates the sequence of events in this pattern, where Salesforce is the data master.
**In this scenario:**
* **Home Admin**: create Data Space and define Data Share (select DMOs/CIOs, segments).
* **Home Admin**: create Data Share Target for Companion Org(s) and configure trust (OAuth client, allowed org IDs).
* **Home Admin**: publish Data Share to target; attach ABAC policies (CEDAR) and encryption/key controls (CMK if needed).
* **Companion Org Admin**: receives invite, validates identity mapping, and accepts share.
* **Companion Org**: Data Cloud One Bridge provisions a Data Cloud One user and applies Permission Sets & Data Space visibility.
* **Companion Org Apps (Flows / Einstein / Apex)**: Query a data graph or call Data Cloud One APIs to read shared DMOs or segments.
* **Activation**: Companion org triggers activation or writes back via data actions (if permitted).
##### Results
* A **single source of truth** for customer data (Customer 360\) across all connected orgs — no redundant Data 360 instances.
* **A faster time to value.** companion orgs can access unified data and Data 360-powered features in minutes, not weeks of custom coding.
* **Controlled data sharing.** Only authorised data spaces are shared, preserving security and governance while enabling business agility.
* Business functions (sales, service, marketing) operate on the same unified data foundation, enabling consistent metrics, activation, and insights across the enterprise.
###### Calling Mechanisms
The calling mechanism depends on the solution chosen to implement this pattern.
Mechanism
When to Use
Data Cloud One Native Share (Preferred)
Use when multiple Salesforce Orgs (Sales, Service, or Industry Clouds) need real-time access to unified customer data directly from Data 360\. This eliminates replication and enables zero-latency access to Golden Records, segments, and calculated insights.
Org-to-Org Share via Data Cloud One Bridge
Use when multiple business units or subsidiaries operate in separate Salesforce Orgs but need shared access to common customer data and segments from a central Data 360 instance. Ideal for multi-org enterprises maintaining independent operational systems.
Einstein 1 Platform Query APIs
Use when Salesforce apps, Flow, or Einstein Copilot must query or activate Data 360 data programmatically. Enables real-time retrieval of unified profiles, metrics, or activation results into other Salesforce applications without batch exports.
Activation to Salesforce Channels
Use when Data 360 data (segments, insights, or attributes) must be activated to Marketing Cloud, Service Cloud, or Commerce Cloud for personalization, campaign execution, or agent assist experiences.
Data Graph Access (Semantic Query Layer)
Use when you need semantic-level access to the unified data model via the Salesforce Data Graph — supporting Copilot, AI workflows, and cross-cloud analytics inReal-Time, without manual joins or transformations.
###### Error Handling and Recovery
* **Cross-Org Sync Resilience:** Data Cloud One automatically retries failed synchronization jobs between Home and Companion Orgs using exponential backoff for transient network or platform errors.
* **Partial Batch Isolation:** Failed record batches are quarantined in a Retry Queue within the Home Org until reconciliation succeeds, preventing data divergence.
* **Schema Rejection Governance:** Schema or mapping mismatches are routed to the Schema Rejection Queue for administrator review and correction.
* **Replay & Resume Continuity:** Each synchronization job maintains offset checkpoints so replication can resume from the last successful commit without duplication.
* **Integrated Monitoring:** All failures, retries, and recovery metrics are captured in the Trust Layer Monitoring Dashboard for visibility and SLA assurance.
###### Idempotent Design Considerations
* **Deterministic Idempotency Keys:** Every synchronization event carries a unique key (Org ID \+ Record ID \+ Version Number) to guarantee exact-once processing.
* **Replay Safety:** Duplicate or replayed events are filtered at commit time, ensuring consistent downstream DMO and CIO updates.
* **Atomic Commit Semantics:** Companion Orgs mark data as committed only after successful downstream writes, preserving cross-org transactional integrity.
* **Conflict Resolution:** Multi-source updates follow last-write-wins or policy-driven merge logic, maintaining lineage and consistency.
* **Checkpoint Persistence:** Synchronization jobs persist last-processed offsets and state within the Trust Layer for safe recovery and replay.
###### Security Considerations
* **Strong Authentication:** Connections between Home and Companion Orgs use mutual OAuth 2.0 with auto-rotated tokens managed via Connected Apps.
* **Granular Authorization:** Companion Orgs can only access specific Data Spaces, DMOs, or CIOs explicitly shared through governed Data Share Policies.
* **Encryption Everywhere:** Data is encrypted in transit (TLS 1.2+) and at rest (AES-256) across both Home and Companion Orgs.
* **Least-Privilege Principle:** Integration users are scoped to only the required objects; no administrative or system-level permissions are propagated.
* **Audit & Compliance Visibility:** All sync events, schema changes, credential updates, and access grants are logged in the Data 360 Trust Layer for full traceability.
* **Private Network Isolation:** Optional Salesforce Private Connect or Private Link ensures data replication occurs over secure, internal channels only.
##### Sidebars
###### Timeliness
* Synchronization between Home and Companion Orgs occurs in near-real time, typically within seconds of a data change in the source org.
* Zero Copy architecture ensures shared data is instantly queryable across all participating orgs — no replication or batch delays.
* Activation and segmentation jobs automatically reflect the latest updates from any connected org, maintaining operational freshness.
* End-to-end latency is deterministic and governed by Data Cloud One’s orchestration pipeline, ensuring consistent cross-org timeliness even under load.
###### Data Volumes
* Designed for multi-tenant, hyperscale data synchronization across regions and business units — capable of managing billions of records per org.
* Data is referenced, not duplicated, reducing storage footprint while maintaining global queryability.
* Streaming deltas and metadata compaction optimize bandwidth and commit overhead for high-change-rate objects (e.g., Contact, Order).
* Scales horizontally across multiple Companion Orgs with adaptive load balancing and orchestration through the Trust Layer.
###### State Management
* Every synchronized dataset maintains metadata lineage, version, and org ownership context to ensure end-to-end traceability.
* Checkpoint persistence captures last-synced offsets between orgs, allowing recovery without duplication.
* Schema versioning and semantic alignment across orgs are automatically governed by the Trust Layers.
* No manual state resets are required — synchronization state is maintained through the Data Cloud One Orchestration Service.
###### Complex Integration Scenarios
* **Cross-Org Federation:** Enables seamless query and activation across multiple Data 360 tenants or regions under a unified governance model.
* **Hybrid Synchronization:** Combines near-real-time replication for transactional updates with scheduled sync for bulk or archival data.
* **Multi-Region Governance:** Supports geographically distributed data sharing while respecting residency, consent, and compliance boundaries.
* **AI and Automation Activation:** Synchronized data instantly powers Einstein AI, Agentforce, or custom ML models across orgs — enabling real-time, cross-org intelligence.
###### Example
A global retail organization has three Salesforce orgs: one for Consumer Retail, one for Premium Brands, and one for International Markets. They provision Data 360 in the Consumer Retail org (making it the home org). With Data Cloud One, they set up companion connections to the Premium Brands and International Markets orgs. They share only appropriate data spaces (e.g., “Customer 360 – Retail Profiles” and “Customer 360 – Premium Profiles”) with each companion org. In the Premium Brands org, marketing teams can view unified customer profiles, build segments based on calculated insights (e.g., premium customer lifetime value), and trigger marketing automations — all powered by the home org’s Data 360 instance, with no custom coding or data duplication.
## Data Activation Patterns--Data Outbound
Data activation is where the value of Salesforce Data 360 truly comes to life. It’s the process of taking the unified, enriched, and governed data that lives inside the platform and making it work across the business. In practice, this means securely delivering curated segments, calculated insights, and contextual attributes from Data 360 into the systems that engage customers — whether that’s marketing automation, service consoles, sales enablement, analytics, or AI models.
From a technical perspective, activation patterns define how this data moves: which channels are triggered, what transformations or mappings occur, and how policies are enforced along the way. These patterns aren’t just about exporting data — they’re about orchestrating real-time, policy-aware data flows that drive measurable business outcomes. Each activation route turns the Customer 360 into a live operational asset — powering personalization, predictive decisioning, and continuous learning across every touchpoint.
### Batch Activation Patterns
Batch activation remains the most widely used and operationally proven method for exporting data from Data 360\. It operates on a scheduled cadence — publishing predefined audience segments or attribute sets to downstream platforms at regular intervals. This pattern is ideally suited for marketing and engagement workflows that rely on consistent, high-volume audience delivery rather than instantaneous updates.
Typical use cases include powering email journeys, direct mail campaigns, or audience uploads to digital advertising networks. Each activation run extracts the qualified segment from Data 360’s unified profile graph, applies governance and consent policies, and securely transmits the output to the target system.
Architecturally, batch activation provides a predictable, auditable, and cost-efficient approach to data distribution — balancing operational simplicity with enterprise-grade reliability. It’s the backbone of large-scale campaign execution, where the right data, delivered on time and under control, drives measurable business impact.
#### Segment Activation to Marketing and Advertising Platforms
##### Context
Modern marketers operate across multiple engagement channels—email, advertising, mobile, and web—each demanding precise, timely, and personalized customer audiences. Data 360 serves as the unified foundation for these audiences, combining customer data from every system into rich, actionable segments.
Batch activation is the most common activation pattern used to export those segments from Data 360 to downstream marketing or advertising platforms. Typical destinations include Marketing Cloud Engagement, Google Ads, Meta Custom Audiences, or LinkedIn Ads, where campaigns can be executed directly against these curated audiences.
##### Problem
How can a marketing team take a precisely defined audience—built using unified and enriched data in Data 360—and make it available in external marketing or advertising systems for activation?
For example, consider the segment: “High-value customers who haven’t purchased in the last 90 days but have recently engaged on the website.”
Marketers need to ensure that this audience is transferred accurately, enriched with relevant attributes (e.g., loyalty tier, region, or predicted CLV), and refreshed at regular intervals to maintain campaign relevance and effectiveness.
##### Forces
Several technical and operational factors shape the Batch Activation pattern:
* **Identity Mapping:** Accurate audience delivery requires mapping Data 360’s Unified Individual ID to the corresponding identifier in the destination system—such as a Subscriber Key in Marketing Cloud or a hashed email for digital ad platforms. This ensures precise matching and eliminates targeting errors.
* **Attribute Selection & Enrichment:** Marketers must go beyond IDs and include additional profile data—such as first name, loyalty status, CLV, or other personalized attributes—to enable downstream personalization and analytics.
* **Target Platform Configuration:** Each destination must be registered in Data 360 as an Activation Target, including connection details, authentication, and data field mappings. This one-time setup defines secure connectivity and governs which systems can receive activated data.
* **Governance and Compliance:** Data activation must adhere to consent metadata, privacy policies (e.g., GDPR or CCPA), and marketing permissions stored in the unified profile. Consent-aware activation ensures data is used only for authorized purposes.
* **Scheduling and Performance:** Activations are often scheduled daily or hourly to keep downstream audiences current. The system must efficiently handle large volumes and incremental refreshes without duplication or data loss.
##### Solution
The **batch activation** process in Data 360 follows a guided workflow that minimizes technical friction for marketers while preserving governance and scalability:
Solution Area
Fit
Comments / Implementation Details
Segment Creation
Best
A marketer or analyst builds a segment in the visual segmentation canvas by applying filters across any data model object (DMO) or Calculated Insight Object (CIO). This defines the target audience for activation.
Activation Setup
Best
The user creates an activation and selects the segment they’ve just built as the source. This defines which audience Data 360 will export to downstream systems.
Activation Target Selection
Best Practice
The marketer selects a pre-configured activation target (e.g., Marketing Cloud, Google Ads, LinkedIn Ads). Each target is registered in Data 360 with authentication credentials and field mappings.
Payload Definition
Required
The marketer defines the payload by choosing contact identifiers (e.g., email, mobile, hashed ID) and selecting additional profile attributes (e.g., first name, loyalty tier, or CLV) for enrichment in the destination system.
Scheduling and Frequency
Recommended
Activations can be scheduled to run once or on a recurring basis (e.g., daily or weekly). Scheduling ensures downstream audiences remain synchronized and current.
Execution and Export
Best
When the activation job runs, Data 360 queries the segment, collects the selected attributes, applies consent filters, and exports the data to the target platform. For Marketing Cloud, this typically results in the creation or update of a Shared Data Extension.
Governance & Compliance
Required
The Trust Layer enforces schema validation, consent metadata, and policy controls to ensure compliance with data protection and marketing regulations (e.g., GDPR, CCPA).
Monitoring & Auditability
Best Practice
Every activation run is tracked with success/failure metrics, execution logs, and lineage visibility in the Trust Layer Monitoring Dashboard, enabling operational transparency and SLA assurance.
##### Sketch
Here is the summary of the steps:
* **Build Segment:** A marketer or analyst creates a segment using a visual segmentation tool, combining filters across any unified data objects.
* **Create Activation:** They select the segment as a source and choose a pre-configured destination (such as Marketing Cloud or Google Ads).
* **Define Payload:** The contact identifier and other profile attributes are chosen for audience export and reporting.
* **Schedule Delivery:** The activation is scheduled to run once or on a recurring basis, keeping the audience in the destination up to date.
* **Execution:** On trigger, Data 360 queries the segment, builds the payload, applies filters for consent, and pushes the result to the destination system.
##### Results
* Targeted, enriched audience segments from Data 360 are made available directly in downstream marketing and advertising platforms.
* Audiences are automatically refreshed and synchronized with the latest unified customer data, maintaining real-time campaign relevance.
* Marketers can use these activated audiences as entry sources for Marketing Cloud Journeys, email campaigns, or custom audiences in digital ad platforms such as Google Ads, Meta, or LinkedIn Ads.
* Every activation run maintains end-to-end lineage, ensuring compliance, traceability, and consistency between Data 360 and external systems.
* Business users can deliver highly personalized, data-driven experiences powered by a complete and trusted Customer 360 view.
###### Calling Mechanisms
The calling mechanism depends on the destination platform and activation target configuration.
Mechanism
When to Use
Marketing Cloud Engagement Activation (Preferred)
Use when executing email or cross-channel journeys that require dynamic segments, personalized attributes, and real-time updates in Marketing Cloud. Data 360 exports directly into Shared Data Extensions for campaign activation.
Ad Platform Activation (Google Ads, LinkedIn Ads, Meta Ads)
Use when activating Data 360 segments as custom audiences in advertising platforms for retargeting or lookalike modeling. Supports hashed identifiers and consent-aware delivery.
CRM Activation (Sales or Service Cloud)
Use when sharing enriched customer data, insights, or propensity scores to CRM users for personalized sales engagement or service interactions. Data is made available as enriched records or insights via Data Actions or Unified Profile Components.
External Activation via MuleSoft or API
Use when activation needs to reach non-Salesforce systems such as loyalty, eCommerce, or third-party data warehouses. MuleSoft or the Data 360 Activation API ensures secure, policy-governed delivery with event-based refresh options.
Hybrid Activation (Batch + Event-Triggered)
Use when combining scheduled batch activations with event-based triggers — enabling “always-on” personalization for time-sensitive campaigns such as abandoned cart or churn risk alerts.
###### Error Handling and Recovery
* **Job-Level Fault Isolation:** Each activation run executes as a distinct, traceable job in the Data 360 Orchestration Layer. Failed runs are automatically quarantined without impacting other activations or segment definitions.
* **Partial Batch Recovery:** If certain records fail to export (e.g., due to identifier mismatches or API rate limits), the system retries them using incremental delta queues with exponential backoff and parallel recovery.
* **Schema Validation Errors:** When outbound payload attributes no longer match the target schema (e.g., a deleted attribute or renamed field), the job routes affected records to the Schema Rejection Queue for administrator review.
* **Replay and Resume Support:** Each activation job maintains a checkpoint token—capturing the last successful batch. Upon recovery, processing resumes from the checkpoint, ensuring no duplication or data loss.
* **Comprehensive Monitoring:** All activation events, retries, and delivery metrics are logged in Trust Layer Monitoring, enabling SLA tracking, root-cause analysis, and automated alerting via Event Monitoring APIs.
###### Idempotent Design Considerations
* **Deterministic Activation Keys:** Every activation run uses a composite idempotency key—combining Segment ID, Activation ID, and Target System ID—to guarantee exact-once delivery.
* **Replay Detection:** Data 360 Activation Service inspects incoming payloads against prior job hashes to detect and suppress replays.
* **Atomic Export Commits:** Payloads are committed to the target system only after successful write confirmation, preventing partial updates or double counting.
* **Consistent Identity Resolution:** Since activations depend on unified IDs (e.g., Unified Individual), replays or retries always target the same golden record, maintaining semantic consistency.
* **Activation State Persistence:** The orchestration layer persists activation state metadata—timestamps, status codes, and sequence tokens—for deterministic reprocessing if needed.
###### Security Considerations
* **Strong Authentication:** Each activation target (e.g., Marketing Cloud, Ads, or CRM) uses OAuth 2.0 with token rotation and tenant-specific scoping to prevent unauthorized data export.
* **Attribute-Level Governance:** Only approved attributes from the Unified Profile are eligible for activation, enforced by Data Share Policies and Activation Templates.
* **Encryption in Transit and at Rest:** All payloads are encrypted using TLS 1.2+ during transfer and AES-256 at rest within both Data 360 and the target platform.
* **Consent and Policy Enforcement:** Activation jobs respect Consent Objects and Data Policies stored in Data 360’s Trust Layer. Records without valid consent metadata are automatically excluded from export.
* **Audit and Compliance Logging:** Each activation run captures who initiated it, what data was sent, and to which destination—enabling full regulatory audit trails (GDPR, CCPA) within the Trust Layer Dashboard.
* **Least Privilege Access:** Integration users for each target are restricted to activation-specific scopes—no administrative privileges or write access to unrelated systems.
##### Sidebars
###### Timeliness
* Designed for scheduled or near-real-time batch exports (minutes-to-hours latency).
* Supports time-windowed refreshes aligned with campaign calendars.
* Activation jobs can be sequenced with data readiness markers to ensure data freshness.
* Best suited for non-interactive activation scenarios where data accuracy outweighs immediacy.
###### Data Volumes
* Handles large-scale datasets (millions of records per run).
* Scales horizontally through segment partitioning and parallel export channels.
* Employs chunk-based batching to avoid timeouts and optimize throughput.
* Ideal for enterprise-grade data pipelines where data completeness is critical.
###### State Management
* Maintains activation state objects recording job IDs, timestamps, and sequence tokens.
* Uses checkpointing for restartability and fault recovery.
* Versioned segment definitions ensure reproducibility across activation cycles.
* Enables lineage traceability between source segment, DMO attributes, and target payloads.
###### Complex Integration Scenarios
* Integrates seamlessly with Salesforce CRM, Marketing Cloud, and external systems through prebuilt connectors.
* Supports multi-target activations, distributing data simultaneously to different destinations (e.g., CRM \+ Ads).
* Can trigger composite workflows — e.g., batch export followed by downstream API call or AI scoring.
* Handles schema evolution gracefully through the Data Model Governance Layer.
##### Example
A global retail brand wants to re-engage inactive customers from the past 90 days. Using Data 360, the data architect defines a “Dormant Shoppers” segment enriched with purchase history, loyalty tier, and consent metadata. The Batch Activation Job runs nightly, pushing this segment to Marketing Cloud Engagement to trigger a personalized “We Miss You” email campaign and to Ad Studio for retargeting. The job leverages idempotent delivery, ensuring no duplication across retries, and all events are logged in the Trust Layer for audit compliance.
#### Data Export to Cloud Storage
##### Context
Enterprises often require a governed mechanism to export unified or segmented data from Salesforce Data 360 into a standard file format (e.g., CSV or Parquet) for archival, compliance, or downstream integration. This pattern enables Data 360-to-cloud storage export—allowing trusted customer data to flow securely into enterprise data lakes or analytics pipelines hosted on Amazon S3, Azure Blob, or Google Cloud Storage (GCS).
Typical use cases include:
* Periodic archival of consented customer datasets for regulatory retention.
* Exporting curated segments for non-Salesforce analytical workloads (e.g., Tableau, Databricks, or Power BI).
* Enabling external machine learning models that require structured CSV or Parquet files as input.
##### Problem
How can an organization export a curated segment or dataset from Data 360 into a cloud storage bucket (e.g., Amazon S3)—in a governed, secure, and automated manner—while maintaining schema integrity and compliance controls? For example, a compliance team may need to: “Extract all active customers in the EU region with valid consent and export the data weekly to an S3 location for external audit and reporting.” This requires a repeatable and policy-aware export pipeline that ensures the correct file format, access permissions, and delivery schedule—without manual intervention or ungoverned data movement.
##### Forces
Multiple operational and architectural factors govern this export pattern:
* **Authentication & Authorization**: Exports must respect the cloud provider’s IAM model (e.g., AWS IAM Roles or Azure Service Principals) to ensure only authorized systems can write to the target bucket.
* **Schema Alignment**: The outbound schema must match the target system’s expected structure and format (CSV, Parquet, or JSON).
* **Data Privacy & Consent**: Exported datasets must filter out any records lacking valid consent metadata.
* **Scheduling & Freshness**: Many exports are periodic (daily, weekly, or monthly) and must align with enterprise data refresh cycles.
* **Governance & Monitoring**: Every export must be auditable with full lineage visibility, ensuring compliance with data retention and regulatory mandates (e.g., GDPR, CCPA).
##### Solution
The File Export Activation pattern reuses the same secure cloud storage connectors employed for ingestion but configured for data egress. Administrators first register the cloud storage platform (e.g., Amazon S3, Azure Blob Storage, or GCS) as an Activation Target in Data 360\. Then, users configure and execute an Activation Workflow to export the desired segment into the designated file storage path.
Solution Area
Fit
Comments / Implementation Details
Segment Selection
Best
Analysts select an existing Segment or Query definition within Data 360\. The segment determines which records and attributes are exported.
Activation Setup
Best
Users create a new Activation, choosing the Segment as the source and the Cloud Storage Target (e.g., S3) as the destination.
Activation Target Configuration
Required
Administrators preconfigure the target with credentials, IAM roles, and output path. Supported formats include CSV, Parquet, and JSON.
Payload Definition
Best Practice
Define the export schema by selecting the required attributes (e.g., ID, Name, Email, Region, Consent Flag). The system enforces attribute-level governance.
Scheduling & Frequency
Recommended
Exports can be scheduled to run on a defined cadence (daily, weekly, monthly) or triggered manually as needed.
Execution & Delivery
Best
On execution, Data 360 queries the segment, compiles the export file, encrypts it, and writes it to the configured bucket/folder using the cloud provider’s API.
Governance & Compliance
Required
Data 360’s Trust Layer ensures all exports adhere to consent policies, schema validation, and compliance filters.
Monitoring & Auditability
Best Practice
Each export is tracked in the Trust Layer Monitoring Dashboard with status, execution logs, and lineage metadata.
##### Sketch
Here is the summary of the steps.
* **Select Segment:** An analyst or data steward chooses the unified segment to export.
* **Create Activation:** They create a new Activation job and select the registered Cloud Storage target.
* **Define Payload:** Specify export schema, attribute list, and file format (e.g., CSV).
* **Schedule Export:** Choose a one-time or recurring schedule.
* **Execute Job:** Data 360 generates and securely delivers the file to the designated bucket path.
* **Monitor & Verify:** Results and logs are reviewed in the Trust Layer for validation and compliance.
##### Results
* Targeted, enriched audience segments from Data 360 are made available directly in downstream marketing and advertising platforms.
* Audiences are automatically refreshed and synchronized with the latest unified customer data, maintaining real-time campaign relevance.
* Marketers can use these activated audiences as entry sources for Marketing Cloud Journeys, email campaigns, or custom audiences in digital ad platforms such as Google Ads, Meta, or LinkedIn Ads.
* Every activation run maintains end-to-end lineage, ensuring compliance, traceability, and consistency between Data 360 and external systems.
* Business users can deliver highly personalized, data-driven experiences powered by a complete and trusted Customer 360 view.
###### Calling Mechanisms
The calling mechanism depends on the target cloud storage platform and activation configuration.
Mechanism
When to Use
Amazon S3 Activation
Use when your enterprise data lake is hosted on AWS. Data 360 writes directly to an S3 bucket using IAM roles or temporary credentials, ensuring secure and scalable export.
Azure Blob Storage Activation
Use when your organization operates on Microsoft Azure. Data 360 uses SAS tokens or service principals to write encrypted files to Blob containers.
Google Cloud Storage (GCS) Activation
Use when your data science or analytics workloads run on GCP. Data 360 uses OAuth credentials to export files to GCS buckets in CSV or Parquet format.
SFTP or External File Gateway
Use when regulatory or legacy systems require secure file delivery via SFTP endpoints or enterprise-managed file transfer platforms.
Hybrid Export (File + API)
Use when a downstream application needs both file-based export for analytics and an API trigger for workflow orchestration (e.g., MuleSoft flow).
###### Error Handling and Recovery
* **Job-Level Isolation:** Each export executes as a discrete job. Failed jobs are quarantined and retried independently.
* **Partial File Retry:** If certain batches fail to upload (e.g., due to network interruptions), the system retries those chunks using exponential backoff.
* **Schema Mismatch Handling:** Any schema drift or field mismatch routes records to the Schema Rejection Queue for review.
* **Checkpoint & Resume:** Export jobs maintain checkpoint metadata, enabling resumption from the last successful write without duplication.
* **Integrated Monitoring:** Failures and retries are logged in the Trust Layer Dashboard for visibility and SLA compliance.
###### Idempotent Design Considerations
* **Deterministic Export Keys:** Each export job includes a unique ID composed of Segment ID \+ Target ID \+ Timestamp.
* **Replay Safety:** Duplicate job executions are detected using job hashes and skipped to prevent redundant exports.
* **Atomic Write Guarantee:** Data 360 commits files to the target bucket only after full completion and checksum validation.
* **Consistent Schema Versioning:** Export definitions are version-controlled to ensure schema consistency across runs.
* **Checkpoint Persistence:** Export jobs persist state for deterministic recovery and reprocessing if needed
###### Security Considerations
* **Strong Authentication:** Cloud connectors use OAuth 2.0, IAM roles, or service principals for authenticated writes.
* **Encryption Everywhere:** Data is encrypted both in transit (TLS 1.2+) and at rest (AES-256).
* **Consent-Aware Export:** Only records with valid consent are exported, enforced by Trust Layer policies.
* **Least Privilege Principle:** Export users and service accounts are restricted to their designated storage paths.
* **Comprehensive Audit Logging:** Every export records metadata including initiator, schema, destination, and timestamps for compliance reporting.
##### Sidebars
###### Timeliness
* Designed for immediate, event-driven activation with sub-second latency.
* Ideal for scenarios requiring instant personalization, recommendation, or decisioning.
* Operates in streaming mode — triggers are fired as soon as qualifying data changes occur in Data 360\.
* Ensures continuous responsiveness without waiting for batch schedules or segment recomputation.
###### Data Volumes
* Handles large-scale datasets (millions of records per run).
* Scales horizontally through segment partitioning and parallel export channels.
* Employs chunk-based batching to avoid timeouts and optimize throughput.
* Ideal for enterprise-grade data pipelines where data completeness is critical.
###### State Management
* Each event action maintains its own event token and replay ID for idempotent processing.
* Supports checkpoint persistence to resume from the last committed event in case of transient failure.
* Includes built-in deduplication logic and replay windows to ensure exact-once activation semantics.
* Action results (success/failure) are logged inReal-Time and surfaced through the Trust Layer observability dashboard.
###### **Complex Integration Scenarios**
* Integrates directly with Salesforce Flows, Einstein 1 Platform Events, or external webhooks for instantaneous response chains.
* Can trigger downstream automations — e.g., instant CRM record updates, AI scoring, or Marketing Cloud message sends.
* Supports composable orchestration: event triggers can call Data 360 Actions, Apex invocations, or external APIs.
* Designed for agentic and adaptive enterprise patterns where context-aware responses must occur instantly.
###### Example
A global retail enterprise needs to deliver a weekly export of its “Active Loyalty Members” segment for analysis in Databricks. The Data 360 administrator configures Amazon S3 as an activation target and schedules a weekly CSV export to the s3://enterprise-analytics/loyalty/weekly\_exports/ path. The export job runs every Sunday, generating a consent-filtered file with 2M+ records.
All events, schema definitions, and lineage are recorded in the Trust Layer Dashboard, ensuring transparency, auditability, and compliance.
### On Demand API Based Activation
On-Demand API-Based Activation is a real-time, event-driven approach to making Data 360 insights actionable the moment they are needed — without waiting for batch jobs or scheduled exports. Instead of publishing prebuilt segments on a fixed cadence, this pattern enables external systems, Salesforce apps, or AI agents to call Data 360 APIs directly to fetch or activate specific audience slices, customer attributes, or insights on demand.
This pattern is designed for interactive, trigger-based experiences — such as when a user logs into a portal, an agent opens a customer record, or an AI Copilot initiates a next-best-action query. Rather than relying on precomputed exports, the system dynamically queries or activates the most current, governed data from Data 360 inReal-Time.
The key advantage is immediacy and precision:
* Every API call accesses the most up-to-date customer intelligence within Data 360’s unified, consent-aware profile graph.
* Activations are idempotent and auditable, aligning with enterprise trust and compliance requirements.
* Integrations can be triggered directly from Salesforce Flows, Apex, or external systems via Einstein 1 Platform APIs, Connect APIs, or Activation APIs.
This approach supports use cases where latency and personalization matter most — for example:
* Triggering a personalized product offer during a service call.
* Generating dynamic campaign audiences based on live behavioral events.
* Feeding real-time decisions into AI or ML models that operate at the moment of engagement.
#### Custom Application Integration via Connect API
##### Context
Enterprises often need to surface harmonized, real-time Data 360 insights within custom-built applications — such as internal web portals, mobile apps, or partner-facing web experiences. This pattern enables developers to build secure, UI-centric solutions that consume and display unified customer data alongside Salesforce CRM and other contextual systems, all through governed and API-based access.
Typical use cases include:
* Embedding Data 360 insights into internal employee dashboards or mobile apps.
* Creating partner or dealer portals with customer and transaction visibility.
* Integrating Data 360 data into third-party web applications or experience layers.
* Displaying real-time, personalized recommendations powered by Data 360 and Einstein 1.
##### Problem
How can a developer build a custom, UI-focused application that securely accesses and displays harmonized Data 360 data, often alongside other Salesforce data sources — without duplicating or exporting sensitive information?
For example, an enterprise may need to build a customer portal that shows unified customer profiles, interactions, and calculated insights from Data 360.
This requires a single, secure, and performant API layer that can power the front-end experience, handle authentication, and ensure governance — while abstracting away the complexity of Data 360’s internal data model.
##### Forces
Multiple architectural and operational considerations influence this pattern:
* **UI-Centric Access :** The primary goal is to surface data within custom front-end experiences (web or mobile), not to perform batch extraction or backend syncs.
* **Secure Gateway :** The chosen API must serve as a secure and scalable entry point for authenticated applications and users, enforcing enterprise-grade access controls.
* **Unified Data Context :** Applications should be able to combine Data 360 data (e.g., unified profiles, calculated insights) with CRM, ERP, or custom object data seamlessly.
* **Developer Simplicity :** APIs should return presentation-ready payloads that minimize backend processing or schema mapping in the client layer.
* **Governance and Observability :** All access should flow through trusted, auditable channels with clear lineage, authentication, and policy enforcement.
##### Solution
The solution is to use the Salesforce Connect REST API as the primary integration gateway for building custom, data-driven applications on top of Data 360.
The Connect API provides RESTful access to Salesforce data — including Data 360’s harmonized profiles, segments, and calculated insights — in response formats optimized for UI consumption (JSON-based, lightweight, and mobile-friendly).
Developers authenticate through a Connected App, obtain OAuth 2.0 tokens, and call Connect API resources such as /query, /chatter, or /data to surface unified data directly in their application interfaces.
Behind the scenes, Connect API serves as the transport foundation for other APIs — such as the Query API, Data Graph API, and Einstein 1 Platform APIs — allowing developers to combine multiple data sources under one unified access pattern.
Solution Area
Fit
Comments / Implementation Details
Authentication & App Registration
Required
Create a Connected App in Salesforce for OAuth 2.0-based authentication. Configure scopes for Data 360 API access.
Data Access (Profiles, Segments, Insights)
Best
Use Connect API endpoints (/services/data/vXX.X/connect) to query harmonized Data 360 data, unified profiles, and calculated insights.
UI Integration
Best
Front-end apps (React, Angular, iOS, Android) call the Connect API to render Data 360 data in dashboards, portals, or mobile interfaces.
Data Graph Querying
Recommended
Combine Connect API with the Data Graph API for semantic-level queries that simplify complex joins and relationships.
Real-Time Refresh
Optional
Use Connect API with WebSocket or streaming extensions for live data updates.
Security & Governance
Required
Enforce data visibility using OAuth scopes, Data 360 policies, and the Trust Layer audit framework.
##### Sketch
Here is the summary of the steps.
* **Register Connected App** — Define OAuth scopes and API permissions for external app authentication.
* **Obtain Access Token** — The external app performs OAuth 2.0 authentication to receive a token for Data 360 access.
* **Invoke Connect API** — The app makes REST API calls to retrieve unified profile, segment, or insight data.
* **Render Data in UI** — Responses are parsed and presented to users in a branded portal or mobile interface.
* **Handle Errors & Refresh Tokens** — Apps implement retry logic and automatic token refresh for session continuity.
* **Monitor & Audit Access** — All API calls are logged in the Trust Layer for visibility and compliance.
##### Results
Developers can create secure, custom-branded applications that are tightly integrated with Data 360\. These apps can:
* Surface harmonized customer profiles and insights inReal-Time.
* Display Data 360 data alongside CRM or custom objects through unified APIs.
* Leverage consistent authentication, authorization, and audit controls via the Trust Layer.
* Provide business users or partners with seamless, governed access to trusted customer intelligence across experiences.
##### Calling Mechanisms
The calling mechanism depends on the target cloud storage platform and activation configuration.
Mechanism
When to Use
Connect REST API (Preferred)
Use when building web, mobile, or third-party apps that require real-time access to Data 360 data in a UI-friendly JSON format.
Data Graph API
Use when the app needs to perform semantic-level queries across multiple objects (e.g., Customer → Transactions → Campaigns).
Query API
Use when executing SOQL-like queries to retrieve harmonized datasets with high precision.
Einstein 1 Platform APIs
Use when integrating AI-driven insights or Copilot-generated recommendations within custom UIs.
MuleSoft or Apex Gateway Wrappers
Use when additional orchestration, caching, or policy enforcement is required between the app and the Connect API.
###### Error Handling and Recovery
* **Request Throttling:** Automatically backs off and retries API calls under rate limits.
* **Schema Drift Protection**:Uses GraphQL schema versioning or REST metadata discovery to adapt to schema changes.
* **Token Expiration Management** – Applications refresh OAuth tokens automatically to avoid session interruptions.
* **API Fault Isolation** – Failed API calls are logged and retried without impacting concurrent sessions.
* **Trust Layer Observability** – API success/failure rates and access logs are visible in the Trust Layer dashboard.
###### Idempotent Design Considerations
* **Deterministic Request IDs**: Each API request includes a correlation ID for replay-safe processing.
* **Cache Validation Headers:** ETag and Last-Modified headers prevent redundant data fetches.
* **Atomic Read Operations:** Connect API ensures each response reflects a consistent snapshot of unified data.
* **Replay Protection** – Duplicate API calls are filtered using request signatures and timestamps.
###### **Security Considerations**
* **OAuth 2.0 Authentication:** All API calls use secure, short-lived OAuth access tokens via Connected Apps.
* **Least Privilege Access:** API scopes are restricted to necessary objects and fields only.
* **Encryption Everywhere:** TLS 1.2+ in transit; AES-256 encryption at rest for cached or stored responses.
* **Consent-Aware Data Access**: Data 360 ensures all retrieved records adhere to consent and governance policies.
* **Comprehensive Audit Logging:** Every API interaction is recorded with user, app, and timestamp metadata in the Trust Layer.
##### Sidebars
###### Timeliness
* Designed for low-latency, real-time API access.
* Ideal for interactive applications that require immediate data rendering.
* Supports near-instant query response times via cached and indexed Data 360 sources.
* No dependency on batch schedules or asynchronous activation cycles.
###### Data Volumes
* Optimized for interactive use cases fetching small-to-medium datasets (e.g., profiles, insights, or recent transactions).
* Handles paginated results gracefully through cursor-based pagination.
* Not intended for high-volume bulk exports — use Batch or File Export patterns for large datasets.
###### State Management
* Applications maintain a lightweight session state with OAuth tokens and local cache.
* Connect API supports conditional requests and partial refresh for efficiency.
* API responses include version markers for schema consistency across releases.
###### Complex Integration Scenarios
* Combine Connect API with Data Graph API for semantic queries across multiple domains.
* Integrate with Einstein 1 Copilot or AI APIs for predictive, conversational experiences.
* Use alongside Experience Cloud or Lightning Web Components for hybrid UI development.
* Extend via MuleSoft to orchestrate data enrichment or external system lookups inReal-Time.
##### Example
A multinational insurance company builds a customer self-service portal allowing policyholders to view their unified profiles, recent claims, and personalized offers. The front-end, eact-based app, authenticates via OAuth 2.0 and retrieves data using the Connect REST API and Data Graph API. All data is displayed inReal-Time, consent-aware, and governed through the Data 360 trust layer. Developers monitor API calls and audit trails directly within Salesforce, ensuring full compliance and observability.
#### Complete Customer Profile Retrieval via Data Graph API
##### Context
Enterprises increasingly require instantaneous access to a complete customer profile for real-time decisioning systems — such as service consoles, recommendation engines, or personalization platforms.This pattern enables applications to retrieve pre-calculated, unified views of a customer’s data in nearReal-Time using Data 360’s Data Graph API, providing sub-second response times for interactive experiences.
Typical use cases include:
* Displaying a 360-degree customer view within a Customer Service or Sales Console.
* Powering AI-based “Next Best Action” or “Next Best Offer” recommendations.
* Delivering hyper-personalized web or mobile experiences at page-load time.
* Supporting in-session decisioning in agent or self-service environments.
##### Problem
How can an application retrieve a complete, pre-calculated, unified customer view instantly, rather than executing slow, multi-object queries at runtime? For instance, a web personalization engine must load the full customer context (demographics, preferences, transactions, and calculated insights) within milliseconds to select a personalized offer. Traditional relational queries may require multiple joins and result in unacceptable latency. This demands an API that delivers denormalized, ready-to-use profile data, retrievable via a single key lookup — combining speed, completeness, and governance.
##### Forces
Multiple operational and performance factors influence this pattern:
* **Speed:** Response time must be nearReal-Time. The API must return a complete profile within milliseconds to support synchronous interactions.
* **Completeness:** The response must include all relevant attributes, relationships, and calculated insights — ideally in a single payload.
* **Lookup Efficiency:** Profiles should be retrievable via identifiers such as customerId, contactKey, or email, eliminating multi-step queries.
* **Data Freshness vs. Latency:** Some use cases prefer pre-calculated (cached) data for speed; others need live data, accepting higher latency.
* **Governance and Security:** Access must remain governed through Salesforce Trust Layer policies, ensuring compliance with data visibility and consent rules.
##### Solution
The solution is to use the Salesforce Data Graph API to retrieve pre-calculated, denormalized customer views stored as Data Graph records. A Data Graph is a materialized semantic view that combines multiple Data Model Objects (DMOs) — such as Individual, Transaction, and ProductInterest — into a single read-only record, often represented as a JSON blob.
Developers can use REST endpoints such as:
GET /api/v1/dataGraph/{dataGraphEntityName}/{id}
to retrieve a complete record by its unique identifier. For dynamic scenarios, the API supports a live=true parameter that bypasses the materialized cache, executing a real-time query across Data 360, trading minimal latency for the freshest data.
This allows developers to select between instantaneous (cached) and up-to-the-moment (live) profile retrievals depending on business need.
Solution Area
Fit
Comments / Implementation Details
Data Graph Definition
Required
Architects define a Data Graph that combines multiple DMOs into a single semantic entity (e.g., UnifiedCustomerProfile).
Profile Lookup Retrieval
Best
Applications call GET /api/v1/dataGraph/{entity}/{id} to retrieve full, denormalized profiles by unique ID or key.
Live Parameter Usage
Optional
Append ?live=true to force fresh computation rather than cached retrieval; suitable for high-value decisions.
Authentication
Required
Use OAuth 2.0 via Connected Apps to authenticate API calls securely.
Response Parsing
Best Practice
Applications parse the JSON response directly into their UI or decisioning engine; no further joins required.
Caching Strategy
Recommended
Implement short-term local caching (e.g., in-memory or CDN) for repeated profile lookups.
Monitoring & Observability
Required
Use Trust Layer dashboards to monitor query performance, response times, and policy adherence.
##### Sketch
Here is the summary of the implementation flow:
* **Define Data Graph** — Data architects create a Data Graph that models a unified customer view across multiple DMOs.
* **Register Connected App** — Developers configure OAuth credentials for secure API access.
* **Invoke Data Graph API** — The application issues a GET request with the Data Graph name and record ID.
* **Process Response** — The API returns a complete JSON representation of the customer profile.
* **Render or Act** — The consuming app (UI or engine) uses the unified data for personalization, recommendations, or service actions.
* **Monitor and Tune** — Performance metrics and access logs are reviewed through the Trust Layer observability console.
##### Results
Applications can now retrieve a complete, pre-joined customer profile instantly, powering real-time interactions such as personalization, service, and decision automation.
This pattern ensures:
* Sub-second response times for in-the-moment decisioning.
* Consistent, governed data retrieval aligned with the Data 360 semantic model.
* Simplified application logic — no joins, no schema reconciliation.
* Traceable and compliant access via the Trust Layer for audit and observability.
###### Calling Mechanisms
The calling mechanism depends on the target cloud storage platform and activation configuration.
Mechanism
When to Use
Data Graph API (Preferred)
Use for retrieving complete, pre-materialized profiles instantly by ID or key.
Data Graph API with live=true
Use for high-value use cases (e.g., fraud detection, live offers) where the most current data is needed, accepting slightly higher latency.
Connect API (Fallback)
Use for composite app scenarios combining Data Graph retrievals with other Salesforce data.
Query API
Use when constructing ad hoc queries or analytical reads rather than instant profile retrieval.
MuleSoft API Proxy
Use when routing Data Graph calls through enterprise gateways or when additional orchestration/policy enforcement is required.
###### Error Handling and Recovery
* **Graceful Fallbacks** – If live queries fail or exceed timeout thresholds, automatically revert to cached Data Graph retrievals.
* **Timeout Management** – Implement retry and circuit-breaker logic for API calls under high load.
* **Invalid ID Handling** – Return standard 404 Not Found responses for nonexistent profile keys; handle gracefully in UI.
* **Schema Version Validation** – Validate Data Graph version metadata to prevent mismatches when schema evolves.
* **Observability Integration** – Log all errors, retries, and latencies within Trust Layer dashboards for SLA monitoring.
###### Idempotent Design Considerations
* **Deterministic Keys** – Each profile retrieval uses a stable ID (e.g., IndividualId) ensuring predictable, replay-safe queries.
* **Cache Consistency** – Use ETag or Last-Modified headers for conditional retrievals and cache validation.
* **Atomic Retrieval** – Each API response represents a consistent snapshot of the materialized Data Graph record.
* **Replay Protection** – Ensure client applications detect duplicate retrievals via correlation IDs and timestamps.
###### Security Considerations
* **Strong Authentication** – OAuth 2.0 via Connected Apps enforces secure, token-based access.
* **Consent-Aware Retrieval** – Only consented attributes are returned; consent filters are applied by the Trust Layer automatically.
* **Field-Level Governance** – Access to attributes is controlled via Data 360’s metadata and policy definitions.
* **Encryption in Transit and at Rest** – All responses are encrypted with TLS 1.2+ and AES-256.
* **Audit and Traceability** – Every profile retrieval event is logged with identifiers, timestamps, and policy context.
##### Sidebars
###### Timeliness
* Designed for instantaneous retrieval.
* Supports live queries for up-to-date data with slightly higher latency (sub-second).
* Optimized for synchronous decisioning and interactive applications.
* Eliminates the need for pre-batch activation or segment recomputation.
###### Data Volumes
* Ideal for **single-record lookups** or small sets (tens to hundreds) per request.
* Not optimized for large-scale bulk retrieval; use Batch or Query APIs for high-volume reads.
* Employs horizontally scalable caching and pre-materialization for speed.
###### State Management
* Maintains lightweight, stateless access; each request is independent.
* Supports caching headers for replay-safe retrieval.
* Applications can maintain local cache or short-term session storage to reduce repeat lookups.
###### Complex Integration Scenarios
* Integrates seamlessly with **Einstein 1**, **Connect API**, and **MuleSoft** for composite data experiences.
* Can power **agentic systems** (e.g., Copilot or AI reasoning engines) that require instant, contextual awareness.
* Combined with **Data Actions** for real-time triggers upon retrieval or state change.
* Enables **personalization at scale** without compromising performance or governance.
##### Example
A global e-commerce platform uses **Data 360’s Data Graph API** to retrieve unified customer profiles in real time for its recommendation engine. When a user logs in, the application invokes the Data Graph endpoint to fetch the **UnifiedCustomerProfile** for that customer, returning demographic attributes, behavioral signals, and calculated insights as a single JSON payload. The personalization engine consumes this response within milliseconds to determine and display the “Next Best Offer” during the active session. All requests are governed and logged through the **Trust Layer**, ensuring full visibility, policy enforcement, and compliance across the interaction.
### Real Time Data Actions
Real-time data actions enable instant activation of customer data the moment it changes in Data 360\. Instead of waiting for scheduled batch exports, these actions push updates, insights, or triggers directly to Salesforce or external systems in milliseconds. When a customer’s status, consent, or engagement metric is updated in Data 360, that signal can immediately power personalized offers, trigger Service Cloud automations, or update loyalty tiers — ensuring that every customer experience reflects the most current, unified truth.
This pattern is ideal for **high-impact, latency-sensitive use cases** such as personalized web experiences, fraud detection alerts, next-best-action recommendations, or real-time CRM updates. It closes the gap between data insight and business action, turning unified data into in-the-moment intelligence.
#### Real Time Data Action Turning Customer Signals into Instant Action
##### Context
Modern digital experiences and operational workflows require immediate, contextual actions the moment an event occurs — for example, updating a customer record during a checkout, adjusting inventory when a return is scanned, or delivering a personalized promotion the instant a user abandons a cart. **[Real-time data actions](https://help.salesforce.com/s/articleView?id=data.c360_a_data_actions_cdp.htm&type=5)** let systems invoke, enrich, and act on unified Data 360 profiles and calculated insights with sub-second to second latency, enabling interactive personalization, operational automation, and instant decisioning.
##### Problem
How can applications, UI interaction flows, or middleware call into Data 360 at runtime to read, compute, or update a single unified profile or to trigger an action (e.g., send an offer, update CRM, start a workflow) with low latency, strong consistency, and governance controls — without waiting for scheduled batch jobs or heavyweight pipelines?
##### Forces
Several technical, operational and governance forces shape this pattern:
* **Low Latency Requirement:** Calls must complete in sub-second to a few-seconds range to preserve a good UX or to meet operational SLAs.
* **Deterministic Identity Resolution:** Requests must resolve to the correct Unified Individual profile (golden record) reliably and quickly.
* **Fine-Grained Authorization:** Real-time calls must enforce attribute-level policies and consent checks at request time.
* **Payload Minimalism:** Real-time payloads should be small and focused (single profile or small attribute set) to reduce latency and cost.
* **Developer Experience:** APIs must be developer friendly (REST/gRPC/GraphQL), with clear schemas and stable contracts for production use.
* **Auditability & Traceability:** Every real-time action must be logged with lineage, user identity, and policy decisions for compliance.
##### Solution
The recommended solution is to use **Data 360’s Real-time Data Actions** interface (APIs \+ SDKs) combined with edge caching and minimal compute transforms where necessary. Integrations invoke a data actions endpoint to read or write profile attributes, compute insights, or initiate orchestrations. Real-time policy checks (CEDAR) and dynamic masking are applied at the Policy Enforcement Point before any payload is returned or action executed.
Solution Area
Fit
Comments / Implementation Details
Realtime Data Action
Best
Expose endpoint for single-record read/write and action triggers. Authenticate via OAuth/JWT.
Identity Resolution
Required
Resolve incoming identifiers (email, externalId, cookie) to Unified Individual ID in-line. Use a deterministic resolver with cache.
Policy Enforcement (CEDAR)
Best Practice
Evaluate consent, ABAC, and masking policies at request time; deny or mask fields per policy decisions.
Edge/Cache Layer
Recommended
Use short-TTL caches for profile fragments and computed insights to reduce latency; invalidate on change events.
Lightweight Transforms
Recommended
Apply simple enrichments or calculated fields in the action path; heavy transforms should be precomputed.
Action Orchestration
Best
Support synchronous single-step actions (e.g., return offer token) and asynchronous orchestrations (queue \+ webhook) for complex flows.
Observability & Tracing
Required
Log request/response, policy decisions, and lineage to the Trust Layer/ SIEM for audit and debugging.
Rate Limiting & Throttling
Required
Enforce client quotas and graceful degradation strategies for high-traffic moments.
##### Sketch
Here is the summary of the steps.
* Client (UI / middleware / POS) sends authenticated Data Action requests with identifiers and action type.
* API Gateway validates token, rate limits, and forwards to Data 360 Action Service.
* Action Service resolves identifier → Unified Individual ID (fast path cache; fallback to Graph lookup).
* Policy Enforcement (PDP) evaluates CEDAR policies using attributes from PIP and request context.
* If allowed, Action Service reads any required profile attributes/insights and performs light transforms.
* Action Service returns response synchronously (e.g., offer token, updated attribute) or queues async orchestration and returns acknowledgement.
* All events, decisions, and payloads are logged to Trust Layer and optionally forwarded to SIEM.
##### Results
* Applications receive immediate, policy-governed access to unified profile reads/writes and action triggers with sub-second to second latency.
* Real-time personalization, decisioning, and operational workflows (e.g., offers, agent assist, inventory updates) are enabled without batch delays.
* All actions are auditable, consent-aware, and enforce attribute-level masking to maintain privacy and compliance.
###### Calling Mechanisms
The calling mechanism depends on the destination platform and activation target configuration.
Mechanism
When to Use
RESTful Data Actions API
Preferred for web/mobile apps and middleware needing synchronous profile reads or action responses.
gRPC / Binary RPC
Use for ultra-low latency enterprise services or internal microservices with persistent connections.
GraphQL Single-Record Queries
Use when clients need flexible field selection and want to minimize payloads.
Event-Triggered Webhooks
Use for async workflows where action triggers downstream processes (e.g., start a journey).
Platform Events / PubSub
Use for fan-out scenarios where multiple systems must react to a single action event.
Edge SDK (client libs)
Use for low-latency clients that cache profile fragments and call the Data Actions API only when needed.
###### Error Handling and Recovery
* **Synchronous Errors:** Return structured error codes with human-readable messages and idempotency tokens.
* **Transient Retry:** Clients should retry idempotent requests with exponential backoff on 429/5xx responses.
* **Policy Deny Handling:** Denials return clear reason codes; sensitive data is never returned on policy failure.
* **Async Orchestration Failures:** Orchestration jobs move to DLQ and are replayable; a job status API allows clients to poll or receive callbacks.
* **Fallback Strategies:** If identity resolution fails, return a deterministic error and optionally a suggested remediation (e.g., require externalId).
###### Idempotent Design Considerations
* **Idempotency Key:** Clients supply an idempotency key (UUID \+ client namespace) for mutating actions.
* **Deterministic Keys:** Use composite keys (UnifiedIndividualId \+ ActionType \+ TimestampWindow) to detect duplicates.
* **Safe Retries:** Design actions to be side-effect tolerant or to perform upserts instead of blind inserts.
* **Replay Protection:** Persist processed idempotency keys and TTL them after business window to avoid replays.
* **Statelessness:** Keep synchronous actions stateless where possible; persist minimal state for async workflows.
###### Security Considerations
* **Authentication:** OAuth 2.0 (JWT Bearer or mTLS for service accounts); short-lived tokens and refresh rotation.
* **Authorization:** Policy Decision Point enforces Attribute-Based Access Control (CEDAR) and consent checks per request.
* **Transport & Storage Encryption:** TLS 1.2+ in transit; AES-256 at rest for any cached fragments or audit logs.
* **Least Privilege:** API clients scoped to minimal permissions; roles separated for read vs write vs orchestration.
* **Data Minimization:** Return only requested and consented attributes; apply dynamic masking for PII/PHI.
* **Network Controls:** Optionally require calls from private networks (Private Connect, IP allowlists) for high-risk actions.
* **Audit & Monitoring:** Log request metadata, policy decisions, requester identity, and response hashes to Trust Layer and SIEM.
##### Sidebars
###### Timeliness
* Designed for mean latencies in the sub-second to low-single-second range for synchronous actions.
* Edge caches (short TTL) and precomputed insights reduce round trips.
* Async pathways provide near-instant acknowledgement with background processing for heavy tasks.
###### Data Volumes
* Optimized for single-record or small-batch interactions (1–100 records).
* Not intended for bulk exports—use batch activation for large volumes.
* High throughput uses pooling/connection reuse and parallel orchestration queues.
###### State Management
* Stateless request model for synchronous calls; minimal action state persisted for grants/transactions.
* Cache invalidation driven by change events—ensure TTLs and invalidation signals keep caches fresh.
* Orchestration jobs maintain durable state (jobId, status, retries) stored in the Trust Layer.
###### Complex Integration Scenarios
* **Agent Assist:** Real-time profile lookup \+ calculated propensity returned to service console in sub-second for agents.
* **POS / Edge Devices:** Local SDK \+ occasional Data Action for validating promotions or loyalty status.
* **Hybrid Flows:** Sync Data Action for decision \+ async orchestration to update downstream systems and trigger campaigns.
* **Third-party Middleware:** MuleSoft or API gateways can mediate authentication, enrich context, and enforce extra policy checks.
##### Example
A retail mobile app determines whether to display a personalized instant coupon when a shopper taps **Checkout** by invoking the **offer-eligibility** data action with the shopper’s email and cart context. The request is validated by the API Gateway and forwarded to the Data Action Service, which resolves the email to a unified individual ID using a cache hit, verifies marketing consent through the PDP, and evaluates eligibility based on customer lifetime value and recent purchase recency. If the shopper qualifies, the service returns a signed coupon token and logs the decision. When coupon issuance requires inventory reservation, an asynchronous orchestration is triggered to reserve inventory and notify CRM systems. The app displays the coupon immediately, while downstream updates are completed in the background and the Trust Layer captures a complete audit trail for governance and compliance.
## References
* [Connectors & Integration](https://help.salesforce.com/s/articleView?id=data.c360_a_sources_targets.htm&language=en_US&type=5)
* [Web & Mobile SDK](https://help.salesforce.com/s/articleView?id=data.c360_a_web_mobile_app_connector.htm&language=en_US&type=5)
* [Sub-Second Real-Time Ingestion](https://help.salesforce.com/s/articleView?id=data.c360_a_real_time_capabilities.htm&type=5)
* [Bring Your Own Lake (Zero Copy Query)](https://help.salesforce.com/s/articleView?id=data.c360_a_byol_data_federation.htm&language=en_US&type=5)
* [Bring Your Own Lake (Zero Copy File)](https://help.salesforce.com/s/articleView?id=data.c360_a_file_federation.htm&type=5)
* [Data Graphs](https://help.salesforce.com/s/articleView?id=data.c360_a_data_graphs.htm&type=5)
* [Activation: MC Engagement](https://help.salesforce.com/s/articleView?id=data.c360_a_create_marketing_cloud_activation.htm&language=en_US&type=5)
* [Activation: MC Personalization](https://help.salesforce.com/s/articleView?id=data.c360_a_create_mc_personalization_activation_target.htm&language=en_us&type=5)
* [Activation: B2C Commerce](https://help.salesforce.com/s/articleView?id=data.c360_a_b2c_commerce_activation.htm&language=en_US&type=5)
* [Data Share (Zero Copy)](https://help.salesforce.com/s/articleView?id=data.c360_a_data_shares.htm&language=en_US&type=5)
* [Activation: File Storage](https://help.salesforce.com/s/articleView?id=data.c360_a_add_activation_target.htm&language=en_US&type=5)
* [Data Actions](https://help.salesforce.com/s/articleView?id=data.c360_a_data_actions_CDP.htm&language=en_US&type=5)
* [Real-Time Sub-Second Data Actions](https://help.salesforce.com/s/articleView?id=data.c360_a_create_a_real_time_data_action.htm&language=en_US&type=5)
* [External Activation Platform](https://help.salesforce.com/s/articleView?id=data.c360_a_build_external_activation_platforms.htm&language=en_US&type=5)
# Overview
Salesforce Data 360 transforms how enterprises connect, harmonize, and activate customer data at scale. Its true strength, however, lies in how securely that data is governed across its lifecycle. This security reference architecture provides a practical, end-to-end blueprint for protecting Data 360 environments. We achieve this through the core principles of least privilege, zero-trust design, and governance by default.
At its foundation, security in Data 360 is a shared responsibility model. Salesforce secures the infrastructure, network, encryption services,the platform, compliance and application itself with global standards such as ISO 27001, SOC 2, and General Data Protection Regulation (GDPR). Salesforce administrators secure their org’s data within the platform by defining access, enforcing privacy, and managing integrations. This includes implementing strong identity and access management (IAM) that grants only necessary access, enforcing two-factor authentication (2FA), and adhering to the principle of least privilege and enterprise and regulatory mandates.
Data 360 Governance connects these layers of responsibility, ensuring that security and compliance stay aligned. It ensures that roles, policies, permissions, and data handling rules are defined, and continuously enforced across the entire process, from ingestion to activation. Data lineage, metadata classification, and consent awareness are built into every object and process. This transforms governance from a manual oversight function into an operational control plane.
Salesforce delivers a resilient, compliant foundation where enterprises retain complete authority over their data posture, privacy settings, and integration boundaries. Together, they create a security and governance fabric where every dataset, policy, and user action is traceable, consistent, and anchored in trust.
Security in Data 360 extends beyond static controls. It’s embedded into every phase of the data lifecycle. From the moment data is ingested, it is encrypted, validated, and classified under enterprise policies. As it’s unified and enriched, metadata lineage and consent attributes are maintained to ensure accountability. When insights are activated for business or AI use, outbound flows are protected through encrypted channels, strong authentication and authorization, policy-aware governance, and consent enforcement, ensuring that data remains trusted, compliant, and secure from ingestion to activation.
## The Security Foundation of Data 360
Data 360 provides a secure-by-design foundation built on Hyperforce architecture with cloud-native capabilities.
### Built on Hyperforce
Salesforce Data 360 is a cloud-native data platform built entirely on Salesforce’s Hyperforce architecture, which provides a secure, compliant, and scalable foundation for global operations.
### Secure-by-Design Foundation
* Hyperforce delivers security and compliance as built-in capabilities, not add-ons. It provides a common set of foundational controls that are deeply integrated across Salesforce’s platforms and applications, ensuring that every layer, from infrastructure to app experience, is designed with security, privacy, and compliance at its core.
* Data 360 inherits robust access controls, encryption, and regulatory compliance frameworks directly from the foundational controls of Hyperforce.
* This secure-by-default model minimizes vulnerabilities and simplifies the delivery of trusted, compliant data services.
### Cloud-Native Architecture
* Data 360 runs within a dedicated functional domain hosted on top of Hyperforce, which is a unified cloud platform that ensures isolation, performance, and multi-tenant security.
* Data 360 uses a microservices architecture, with all services containerized and orchestrated via Kubernetes.
* Applying the principles of zero trust, the Istio service mesh manages secure inter-service communication and provides traffic management, observability, and policy enforcement.
### Scalable and Modular Deployment
* Data 360 services are provisioned and operate with Salesforce managed virtual private cloud (VPC), enabling segregation, efficient control and optimized internal networking.
* The architecture supports horizontal scalability, ensuring Data 360 can handle petabyte-scale data processing workloads.
### Integration & Extensibility
* Data 360 exposes well-defined APIs for integration with Salesforce CRM applications and other data sources.
* It supports both first party (1P) and Hyperforce-based Salesforce CRM orgs, ensuring broad compatibility across environments.
* Data Cloud One enables customers to connect multiple Salesforce CRM orgs with a single Data 360 instance.
### The Shared Responsibility Model
Security within Salesforce Data 360 operates under [a shared responsibility model](https://compliance.salesforce.com/en/documents/a006e000010nW2FAAU), a framework also used by leading cloud providers such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud.
This model defines a clear boundary: Salesforce is responsible for security **of** the cloud, and customers are responsible for security **in** the cloud. Understanding and operationalizing this distinction is essential for maintaining a resilient, compliant, and secure data ecosystem.
#### Salesforce: Security of the Cloud
Salesforce is accountable for securing and maintaining the integrity of the Data 360 platform and its global infrastructure. This includes:
* **Physical and Environmental Security:** Hyperforce is hosted on AWS infrastructure and Amazon has the delegated responsibility for protection of their global data centers through access controls, surveillance, and environmental safeguards.
* **Network and Perimeter Defense:** Distributed Denial of Service (DDoS) mitigation, intrusion detection, and encryption for all traffic in transit (TLS 1.2 and higher) and at rest (AES-256).
* **Platform Hardening and Patch Management:** Continuous vulnerability management, patch deployment, and OS-level security baselining.
* **Compliance and Certification:** Continuous audits against standards such as SOC 1/2/3, ISO 27001, ISO 27017, ISO 27018, and readiness for frameworks such as GDPR .
These controls ensure that the Data 360 platform remains secure, reliable, and compliant, enabling customers to focus on business logic and data management rather than infrastructure defense.
#### Customer: Security in the Cloud
Customers are responsible for securing their data, configurations, and operational processes within their Salesforce Data 360 orgs. Key areas of accountability include:
* **Identity and Access Management (IAM):** Define roles, enforce multi-factor authentication (MFA) and single sign-on (SSO), and apply the principle of least privilege.
* **Data Governance:** Classify sensitive data, apply masking where needed, and enforce object-, field-, and record-level access controls.
* **Integration Security:** Manage API access via OAuth 2.0, JSON Web Token JWT, and other authentication standards using named credentials and external credentials.
* **Monitoring and Response:** Use event monitoring and audit trails, and forward logs to a Security Information and Event Management (SIEM) system for advanced threat detection.
Salesforce provides the secure foundation, but customers determine their actual security posture through their configurations, controls, and vigilance.
#### Human-Centric Responsibility
Security is not just a technical construct, it’s an organizational discipline. Data protection in Salesforce Data 360 is achieved through collaboration between architecture, operations, and governance teams.
**Enterprises should:**
* Continuously review and retire unused or over-privileged accounts.
* Automate enforcement using policies as code and CI/CD pipelines.
* Conduct tabletop exercises simulating incidents such as unauthorized data activation or exfiltration to strengthen response readiness.
Data 360’s effectiveness scales not by features alone, but by how responsibly customers operationalize them.
#### Secure-by-Default: A Proactive Security Posture
Salesforce Data 360 embraces a secure-by-default philosophy, which is a shift from reactive control to preventive design. Instead of starting open and tightening later, every new Data 360 organization now begins in a “Deny All” state, enforcing zero trust principles from the first deployment.
#### From Reactive Control to Preventive Design
In older environments, customers inherited a permissive “Allow All” model for faster onboarding. While convenient, this created risk from accidental overexposure and misconfiguration.
The new secure-by-default architecture inverts this approach:
* No user or system has implicit access.
* All permissions must be explicitly granted.
* Data access, integration, and governance controls are enforced from Day 0\.
This enforces least privilege by design, drastically reducing the risk of accidental exposure or privilege escalation.
#### Operational and Governance Impact
This model has both technical and behavioral implications:
* Teams must plan access models deliberately, aligning permissions with compliance and business boundaries.
* Governance becomes a built-in design requirement, not an afterthought.
* Ownership and accountability for data are defined from the start.
For legacy Data 360 organizations still operating under “Allow All,” admins must manually tighten configurations to align with the new baseline, a critical step in any security modernization or Data 360 maturity program.
#### Trust by Design
By defaulting to zero access and requiring explicit policy definitions, Salesforce Data 360 establishes trust-by-design, a foundational evolution in enterprise data security.
This approach ensures that:
* Unauthorized access and data leakage risks are minimized.
* Governance frameworks are enforced structurally, not optionally.
* Enterprises gain a more predictable, auditable, and resilient security posture across environments.
In essence, security is no longer a feature you add. It’s the foundation you start with.
## Identity and Access Management: The Gateway to Your Data
Identity and Access Management (IAM) in **Salesforce Data 360** is the first and most critical layer of defense. It governs **who** can access the platform and **what** actions they can perform once inside. A well-implemented IAM framework is the single strongest control an enterprise has to protect its customer data and ensure operational integrity.
### Authentication: Verifying "Who You Are"
Authentication establishes **digital trust,** confirming that every user, service, or external system accessing Salesforce Data 360 is legitimate.
### Federated Identity Management
Data 360 supports **federated authentication** with enterprise-grade identity providers (IdPs) such as [**Microsoft Entra ID (Azure AD)**](https://learn.microsoft.com/en-us/entra/identity/saas-apps/salesforce-tutorial), [**Okta**](https://help.okta.com/en-us/content/topics/provisioning/salesforce/sfdc-provision.htm), or [**Ping Identity**](https://docs.pingidentity.com/configuration_guides/salesforce/config_saml_salesforce_pf.html) using [**SAML 2.0**](https://help.salesforce.com/s/articleView?id=xcloud.sso_saml.htm&type=5), OpenID Connect([**OIDC**](https://help.salesforce.com/s/articleView?id=xcloud.sso_provider_openid_connect.htm&type=5)), or system for cross-domain identity management ([**SCIM**](https://help.salesforce.com/s/articleView?id=xcloud.identity_scim_overview.htm&type=5)) .
This federation extends your corporate identity lifecycle directly into Salesforce. When an employee joins, transfers, or leaves the company, their access automatically adjusts, reducing orphaned accounts and improving compliance readiness.
### Single Sign-On (SSO)
With [**single sign-on (SSO)**](https://help.salesforce.com/s/articleView?id=xcloud.sso_about.htm&type=5), users authenticate once using their corporate credentials and gain secure access to Salesforce applications without separate passwords. This reduces credential fatigue and minimizes risks from password reuse or phishing.
### Adaptive and Conditional Access
The Identity Provider (IdP) becomes the single authority for authentication decisions, enforcing multi-factor authentication (MFA), conditional access, and risk-based controls. Authentication evolves from a single event to a continuous evaluation of trust, responsive to user behavior and context.
Federated authentication provides:
* **Centralized Policy Enforcement:** Authentication standards are managed in one place across all Salesforce environments.
* **End-to-End Traceability:** Unified audit trails link every action back to a verified identity.
* **Human-Centric Experience:** A frictionless, secure login process allows teams to focus on insights — not credentials.
### Authorization: Defining "What You Can Do"
Once a user is verified, authorization defines what they can access, view, or modify. It sets the operational boundaries that protect sensitive data and enforce least privilege.
**Principle of Least Privilege (PoLP):** Every user and system is granted only the permissions necessary for their job function, nothing more. This principle dramatically limits the potential damage from compromised credentials or misconfigurations.
**Role-Based Access Control (RBAC):** Salesforce Data 360 uses permission sets and permission set groups to assign granular capabilities aligned with business roles. For example:
* A Data Engineer can manage ingestion pipelines and transformations with the help of Data 360 Architect permission set.
* A Marketing Analyst can query harmonized data but cannot alter models with the help of Data 360 Activation Manager permission set..
* An Activation Manager can execute outbound campaigns but cannot access source data with the help of Data 360 Activation Manager permission set
Access is centrally managed and auditable, ensuring accountability throughout the data lifecycle. When integrated with IdPs such as Entra ID, Okta, or Ping Identity, access policies extend seamlessly across the enterprise via SCIM provisioning and SAML/SSO federation.
### Understanding Standard Roles and Permissions in Data 360
Salesforce provides predefined permission sets that encapsulate best practices for segregation of duties and compliance with industry standards such as ISO 27001\.
Role
Primary Responsibility
Access Design Principle
System Administrator
Environment setup, provisioning, and configuration
No access to underlying datasets — ensures separation between system and data control
Data 360 Architect
Data ingestion, transformation, identity resolution, and modeling
Cannot perform data activation to maintain data exposure boundaries
Data 360 Activation Manager
Segment creation, channel management, and activation
View-only access to data models; no modification privileges
Data 360 User
Consumes analytics and insights
Read-only; zero modification privileges
Data 360 One User
Cross-org access via Companion Org
Governed by shared space permissions and scoped access policies
This structural privilege separation ensures no single role controls the entire data lifecycle — aligning with segregation of duties (SoD) requirements in frameworks like ISO 27001 and SOC 2.
[Data 360 standard permission sets](https://help.salesforce.com/s/articleView?id=data.c360_a_userpermissions.htm&type=5) are automatically updated with each release as new features become available. A custom permission set, by contrast, would not be updated automatically, leading to potential security vulnerabilities or a loss of functionality if not meticulously maintained.
### Operational and Security Benefits
* **Automatic Policy Evolution:** Salesforce maintains and updates standard permission sets as part of its platform releases. When new features are introduced, permission sets are automatically aligned, reducing administrative overhead and eliminating configuration drift.
* **Reduced Attack Surface:** Granular access boundaries prevent data misuse or inadvertent privilege escalation.
* **Audit and Compliance Readiness:** Standardized roles simplify attestation, making it easier for enterprises to demonstrate access controls during audits or regulatory reviews.
* **Scalable Governance:** Administrators can map these roles directly to enterprise IAM systems such as Okta and Microsoft Entra ID using SCIM provisioning and SAML/SSO federation, ensuring a unified security posture across both Data 360 and the broader enterprise ecosystem.
### Best Practices for Role-Based Authorization
* **Adopt Standard Roles:** Use Salesforce’s standard permission sets rather than cloning or customizing, to ensure automatic updates and consistent privilege models across releases
* **Integrate with Enterprise IAM:** Centralize access provisioning via SCIM or identity federation to maintain visibility and lifecycle control over all identities.
* **Conduct Regular Access Reviews:** Implement periodic attestation processes to detect privilege creep and ensure alignment with functional requirements.
* **Apply Just-in-Time Access:** For elevated functions, grant temporary permissions that expire automatically, aligning with zero-trust principles.
IAM is the control plane that connects human identity, system access, and data governance. Salesforce Data 360 gives enterprises the tools to enforce Zero Trust through federated authentication, granular authorization, and continuously evolving permission models. But its true effectiveness depends on how organizations operationalize these controls — aligning people, process, and technology around one goal: data trust without compromise.
## Data Governance in Data 360: The Foundation of Trust, Control, and Intelligence
In today’s enterprise data ecosystem, governance is no longer a constraint; it’s the key enabler of trusted intelligence. For architects, it defines the equilibrium between agility and control, between open access and assured compliance.
Salesforce Data 360 (Data 360\) is designed with this principle at its core. Governance and trust aren’t added layers; they are built into the very fabric of its architecture. Every stage of the data lifecycle, from ingestion and harmonization to activation and AI-driven insights, operates under a unified governance control plane that defines how data is classified, secured, accessed, and used responsibly across the enterprise.
### Governance as a Control Plane
Data 360 is architected around a governance-first model, ensuring that every data interaction, from ingestion to insight activation, is policy-aware, auditable, and compliant. Governance functions as the central control plane, managing how data is discovered, classified, and protected across its lifecycle.
This unified control plane ensures that:
* **Data access is contextually authorized**: only the right users, under the right policies, can act upon the right data.
* **Governance is embedded into both the semantic and operational layers**, ensuring consistency between how data is modeled and how it is protected.
* **Zero Trust and Least Privilege** principles are enforced: where identity, context, and policy are evaluated in real time before granting access.
Through this architecture, Salesforce Data 360 transforms governance from static permission management into a dynamic, policy-driven orchestration layer. One that continuously adapts to context, enforces compliance by design, and sustains trust at enterprise scale.
### Logical Data Segregation with Data Spaces
At the macro level, Data Spaces provide logical segregation and isolation of enterprise data domains, enabling organizations with multi-brand, multi-region, or multi-tenant operating models to manage data within a single unified platform. Data Spaces can be aligned to business domains (such as Sales, Marketing, or Customer Success) or to regulatory and geographic boundaries (such as EU, AMER, or APAC), allowing governance and access controls to mirror the organization’s operating and compliance structure without fragmenting the underlying data platform.
* Each data space acts as a virtual boundary, defining what data collections a user or team can see or interact with.
* Access within a data space is explicitly granted, ensuring no implicit permissions or cross-contamination of data visibility.
* This enables federated ownership: each business unit can govern its domain independently while maintaining centralized oversight and compliance.
By design, data spaces provide the first layer of governance, establishing structural clarity and accountability across the enterprise datasets.
### From RBAC to ABAC: Moving Toward Contextual Authorization
In Salesforce Data 360, RBAC and ABAC serve distinct but complementary purposes, and they are applied at different layers of the platform.
RBAC is used primarily for platform and capability access. It governs who can access Data 360 constructs and features such as Data Spaces, process creation, administrative capabilities, and tooling access. RBAC is implemented through permissions and permission sets, for example assigning users access to a Data Space with specific enabled features.
ABAC is used for data access enforcement. ABAC policies are fully responsible for determining who can access which data objects and attributes, including Object-Level Security (OLS), field-level access, and row-level constraints. These decisions are made dynamically by evaluating the action, user attributes, and resource attributes at runtime.
In ABAC, permissions remain part of the model, but the policy itself determines access, not the role alone. Policies evaluate context such as business unit, region, data sensitivity, purpose of use, or regulatory constraints to allow or deny access.
For example:
* RBAC allows a user to access a Data 360 Data Space and analytics features.
* ABAC determines whether that same user can read a specific customer dataset, which rows they can see, and which attributes are masked or restricted.
This clear separation enables Data 360 to scale securely:
* RBAC provides controlled access to platform capabilities and workflows.
* ABAC delivers fine-grained, policy-driven data access aligned with compliance, residency, and data protection requirements.
Together, they enable governed data democratization without conflating platform permissions with data authorization logic.
In essence, RBAC enforces access based on permission assignment, while ABAC evaluates permissions in context — combining action, user, and resource attributes to deliver adaptive, fine-grained access control across Salesforce Data 360
### ABAC: A Multi-Layered Security Hierarchy
At the heart of Salesforce Data 360’s fine-grained access control is attribute-Based access control (ABAC, powered by the CEDAR policy language.
Unlike static, role-based permissions, ABAC dynamically evaluates *who* is requesting access, *what* they’re trying to access, and *under what conditions* — ensuring every data interaction aligns with enterprise policies and trust boundaries.
#### Dynamic Policy Evaluation
Data 360’s ABAC engine evaluates access decisions based on a combination of three core attribute types:
* **User attributes:** department, location, clearance level
* **Data attributes:** classification, sensitivity (PII, PHI, Financial Data), data space
This flexible, policy-driven model allows enforcement to adapt automatically as user roles, data classifications, or operating conditions evolve, which is essential for large, distributed, and regulated enterprises.
#### ABAC Architecture Components in Salesforce Data 360
Salesforce Data 360 implements a standards-based Attribute-Based Access Control (ABAC) architecture aligned with industry best practices for policy-driven data governance. It is composed of three primary functional components:
* **Policy Information Point (PIP) - Policies, Enriched Metadata and Classification:**
* Houses policy definitions themselves, including data access, classification, masking, retention, and usage policies that govern enterprise data.
* Maintains enriched metadata such as tags, classifications, business context, and end-to-end lineage.
* Utilizes LLM- and ML-driven classification to automatically tag sensitive data (e.g., PII.Email, PII.Phone, PHI).
* Tag propagation ensures classifications flow automatically along data lineage (DLO → DLO → DMO).
* Preserving sensitivity and compliance across transformations.
* **Policy Decision Point (PDP)**: The PDP is the decision engine that interprets CEDAR policies.
* Ingests contextual inputs from the PEP (user identity, request metadata) and reference attributes from the PIP.
* Evaluates policies deterministically to deliver consistent, explainable, and scalable access decisions.
* Supports both real-time and batch evaluations, ensuring performance and precision even in high-volume environments.
* **Policy Enforcement Point (PEP)**: The PEP is where authorization decisions are enforced at runtime.
* Intercepts data access requests across all interaction channels such as APIs, UI queries, CRM enrichment, or GenAI Retrieval-Augmented Generation (RAG) pipelines.
* Applies PDP outcomes instantly, ensuring that every query and retrieval is compliant with enterprise access policies.
Together, the PIP–PDP–PEP triad forms a distributed governance fabric, enforcing consistent, policy-based control across all Data 360 services and access modes.
Importantly, [ABAC](https://help.salesforce.com/s/articleView?id=data.c360_a_policy_based_governance_dg.htm&type=5) in Data 360 is configured, not built. Architects do not assemble custom control planes or enforcement logic. Instead, they populate and connect three native architectural components that operate together as a unified governance fabric.
At a practical level, implementation follows a simple progression: classify the data, define the policies, and let the platform enforce them automatically. Once configured, access control becomes a system behavior rather than a manual or procedural process.
This distributed governance fabric ensures **consistent policy enforcement across all access channels**, creating a unified trust boundary throughout Data 360\.
#### Multi-Level Policy Enforcement
Data 360’s ABAC framework supports layered access boundaries, ensuring that data is protected not only at the object level, but also within specific fields and records.
* **Object-Level Security (OLS)**: The outermost boundary of access control.
Governs access to entire data structures such as data lake objects (DLOs) or data model objects (DMOs).
Example: Granting access to the *Customer* object, but not to *Transactions*.
* **Field-Level Security (FLS)**: Controls access to specific fields within an object.
Example: A marketing user can see customer names but is restricted from viewing credit card numbers or national identifiers.
* **Record-Level Security (RLS)** : The most granular control layer.
Determines which individual records within a dataset a user can view or modify.
Example: A regional manager can access only customer data tied to their assigned region.
* **Dynamic Data Masking (DDM) :** Enables real time data protection. Complementing ABAC, DDM enforces policy-driven obfuscation of sensitive information without altering the underlying dataset. At query time, DDM automatically masks fields like PII or financial data based on user role, context, or compliance rules.
* Sensitive data stays protected across UI views, APIs, and AI workflows.
* Reduces data leakage risks by ensuring consistent masking across all consumption layers.
* Maintains auditability. Every masked query is logged and traceable within Data 360’s governance framework.
This architecture transforms access control from a static permission model into a dynamic, context-aware policy fabric. By combining RBAC’s structured simplicity with ABAC’s contextual depth, Salesforce Data 360 achieves:
* Consistent policy enforcement across ingestion, harmonization, and activation.
* Adaptive governance that evolves with data, roles, and compliance needs.
* Unified trust boundaries across the entire data lifecycle — from ingestion to AI activation.
#### Deep Integration with the Salesforce Platform
Salesforce Data 360’s governance model is natively embedded within the Salesforce Platform, enabling unified security, compliance, and access control across both operational and analytical data. By inheriting Salesforce’s core identity and access management capabilities—such as identity federation, permission sets, Centralised policy authoring and platform encryption—Data 360 applies consistent trust policies across clouds without introducing parallel governance stacks. Rather than treating isolation, authorization, and lineage as separate concerns, the platform integrates them into a single execution-aware trust fabric that spans the entire data lifecycle.
At a structural level, this governance fabric is formed by three complementary layers working in concert:
* **Data Spaces**, which establish clear logical boundaries for data isolation and regulatory segmentation
* **Attribute-Based Access Control (ABAC)**, which enables fine-grained, context-aware authorization decisions based on identity, purpose, and data attributes
* **Semantic lineage**, which preserves business meaning, sensitivity, and traceability as data moves from ingestion to insight and activation
Together, they create a governance model where access decisions are explainable, enforcement is automatic, and compliance is continuous rather than retrospective. The result is a platform where governance is no longer a limiting factor or an afterthought. Instead, it becomes an enabling layer—allowing architects to design data products and AI-driven workflows with confidence that trust, privacy, and regulatory requirements are being enforced by the system itself.
This compositional approach ensures that enterprise data remains not only usable, but responsibly actionable—supporting insight, activation, and automation at scale without compromising transparency, security, or control.
## Securing the Data Lifecycle: From Ingestion to Activation
In the age of AI-driven enterprises, securing data is not a one-time event but a continuous process that safeguards information from the moment it enters the ecosystem until it is activated for business or AI use.
Salesforce Data 360 embeds security and governance controls at every phase of the data lifecycle, ensuring that data integrity, confidentiality, and trust are preserved from ingestion to insight activation.
### Foundation of Protection: Encryption at Rest and in Transit
At the core of Salesforce Data 360’s protection model lies Platform Encryption for Data 360 — a transparent, high-performance encryption framework that secures data both at rest and in transit, without compromising usability or scalability.
#### Encryption at Rest: Storage Layer Security
Data persisted in the Data 360 Data Lake is **automatically encrypted at the storage tier**, ensuring that data remains unreadable even if physical or unauthorized access occurs. Key capabilities include:
* **Transparent Data Lake Encryption:** All data persisted in the Data Lake is encrypted at the storage tier using customer-managed keys (CMK). This ensures that even if unauthorized access to the physical storage occurs, the data remains unreadable and indecipherable.
* **Customer-Managed Keys (CMK):** Customers maintain full control over encryption keys — a crucial capability for regulated industries like financial services, healthcare, and government. CMK enables granular auditing, control, and proof of data sovereignty, directly aligning with regulatory mandates such as GDPR, HIPAA, and ISO 27001\.
* **External Key Management (EKM) :** With External Key Management, a feature of Platform Encryption for Data 360, customers will be able to encrypt data in Data 360 by using keys stored in the customers’ AWS KMS accounts. This gives customers more flexibility while keeping their data in Data 360 secure and protected.
* **Bring your own Key (BYOK):** Building on CMK and EKM, Data 360 now allows customers to upload their own key material directly within Salesforce to encrypt data at rest and search indexes. This enhancement provides an additional layer of protection for PII, sensitive, confidential, and proprietary data—without requiring customers to create or manage keys in AWS KMS.
* **Key Rotation and Lifecycle Management:** Key rotation is handled gracefully. New data is encrypted with the new key while older data remains encrypted with its original key, avoiding downtime or performance degradation. This rotation mechanism strengthens compliance without operational disruption.
#### Encryption in Transit: Network level Security
Every piece of data transmitted between Data 360 services, APIs, and connectors is protected using Transport Layer Security (TLS) 1.2 or higher, providing end-to-end encryption in motion.
This ensures that:
* Data can’t be intercepted or altered during transfer.
* Communications between Salesforce services, trusted connectors, and customer endpoints remain private and verifiable.
* Security extends consistently across ingestion pipelines, harmonization processes, activation workflows, and external API integrations.
By combining customer-managed encryption at rest with continuous encryption in transit, Salesforce Data 360 creates a defense-in-depth architecture that protects customer data from both external attacks and internal infrastructure threats.
### Secure System-to-System Integration (Data Integration) in Data 360
While encryption and access controls safeguard data within Salesforce Data 360, securing data movement across systems is equally critical. Modern enterprises operate in multi-cloud and hybrid environments, where sensitive data flows between Salesforce, analytics platforms, external APIs, and data lakes.
To address this, Salesforce has engineered a secure integration framework centered around named credentials (NCs) and external credentials (ECs) — delivering a policy-driven, zero trust–aligned foundation for secure connectivity.
#### Salesforce’s Secure Integration Framework
Salesforce has architectured a robust **[secure integration framework](https://developer.salesforce.com/docs/platform/named-credentials/guide/get-started.html)**, centered around named credentials (NCs) and external credentials (ECs). Together, they abstract away credential complexity, enforce least-privilege access, and enable consistent authentication management across all integrations — without exposing secrets in code or configuration.
This framework abstracts security complexities, enforces best practices, and establishes a **policy-driven control plane** for all external connections — aligning with Salesforce’s **Zero Trust** and **security-by-design** principles.
##### Named Credentials
Named credentials (NCs) are the cornerstone of Salesforce’s secure integration architecture. They provide a declarative, centralized mechanism to define external endpoints and their authentication parameters — eliminating the need to hard-code sensitive credentials such as usernames, passwords, or tokens in Apex code or configuration files. Instead, developers and administrators simply reference a named credential alias (for example, SnowflakeConnector\_NC), and Salesforce automatically handles the underlying authentication and connection management.
**Architectural and Security Advantages:**
* **Simplified Maintenance:** NCs consolidate external endpoint URLs and authentication parameters into a single managed record. Any updates — such as changing an endpoint or rotating credentials — require changes only to the NC record, avoiding redeployment of code or flows across environments.
* **Enhanced Security:** Credentials are securely stored in Salesforce’s encrypted secret store, preventing exposure in code repositories, configuration files, or logs. The authentication process itself is managed automatically at runtime, reducing human error and risk of leakage.
**Compliance Adherence:** The separation of credentials from business logic simplifies compliance with data protection regulations like **GDPR, HIPAA, and PCI DSS**. Auditors can easily verify that external data access adheres to enterprise security and governance policies.
* **Bypasses Remote Site Settings:** NCs eliminate the legacy requirement for remote site settings, streamlining configuration and deployment, particularly for large-scale or multi-environment enterprise implementations.
#### External Credentials
External credentials (ECs) define the authentication protocol and flow that Salesforce uses when connecting to an external service — effectively answering “how to authenticate.” A single EC can be reused across multiple NCs that share the same authentication type, promoting configuration reuse and consistent security enforcement.
**Supported Authentication Protocols:**
* OAuth 2.0 (all variants supported)
* JWT (JSON Web Token)
* Basic Authentication
* AWS Signature v4
* Custom Authentication
* No Authentication (for open APIs or public endpoints)
External Credentials and Named Credentials are designed around clear separation of duties. An External Credential defines how to authenticate — specifying the authentication protocol, token type, and refresh behavior for connecting to external systems. A Named Credential, on the other hand, defines where to connect — the endpoint URL and which External Credential to use for that connection. This design ensures that authentication logic and endpoint configuration remain decoupled, enabling Salesforce to support diverse integration protocols securely while maintaining centralized and consistent credential management across the enterprise.
### How Data 360 Connectors Leverage This Framework
While Data 360’s user interface abstracts much of the underlying configuration, the Named Credential and External Credential framework is frequently utilized under the hood by its native connectors and data streams.This means that, even when administrators are simply “adding a data connection” through a guided UI, Data 360 is still applying this standardized security model behind the scenes.
Architectural Implications:
* **Unified Security Model:** Every connector — whether to an external Database , AWS S3, or an enterprise API — benefits from the same encryption, authentication, and key management standards enforced by Named and External Credentials.
* **Developer Abstraction:** Developers and admins don’t need to manually handle authentication flows or credential rotation. Salesforce manages token lifecycle, expiry, and refresh automatically.
* **Consistent Policy Enforcement:** This framework ensures all connectors adhere to consistent authentication, audit, and logging policies — critical for large-scale, multi-source ingestion in regulated industries.
* **Future-Proof Extensibility:** As Salesforce enhances its authentication stack (e.g., to support new OAuth flows or FIDO2 standards), these improvements propagate automatically across all connectors without requiring refactoring or redeployment.
### Data 360 Connector Security and Governance
Salesforce Data 360 offers a large suite of out-of-the-box connectors that streamline data integration from various sources. This enables enterprises to consolidate and utilize their data efficiently. Salesforce provides multiple connector types including native Salesforce connectors, cloud storage connectors, database connectors, and application and API connectors. In addition to the connectors offered, zero ETL tools are also supported. Salesforce connectors enable seamless integration between Salesforce products, such as Sales Cloud, Service Cloud, and Marketing Cloud, with Data 360\. Additionally, a range of connectors to cloud storage providers, including Amazon S3, Google Cloud Storage, and Azure Data Lake are offered. The prebuilt connectors for databases such as Snowflake, Redshift, and BigQuery allow enterprises to link their existing data warehouses with Data 360\. Furthermore, Data 360 provides connectors for various third-party applications and APIs, such as Google ads, Facebook ads, and other marketing platforms. To enhance flexibility, Data 360 integrates with ETL tools such as MuleSoft and Informatica.
#### Data Security and Salesforce Data 360 Connectors
The security of data stored within the Salesforce Data 360 has been at the forefront of many Data 360 related conversations. As part of Salesforce’s commitment to a defense-in-depth security approach, equal importance is placed on securing how data is ingested into the Data 360 environment.
Salesforce recognizes that businesses operate in diverse data ecosystems, often spanning multiple cloud platforms, storage solutions, and analytics tools. Our Data 360 Connectors serve as the bridge between these environments. The connector enables secure, scalable, and efficient data integration while maintaining Salesforce’s high security standards. These connectors facilitate seamless data flow without compromising integrity, or privacy.
The three essential components of Data 360 connector security are:
* **Authentication/Authorization Mapping**: Secure access management is foundational to data security. Different cloud connectors employ varying authentication and authorization mechanisms to validate and control user access. Authentication ensures that users or systems are legitimate entities, while authorization defines the level of access granted. Salesforce ensures that, wherever possible, its connectors are leverage industry standards.
* **Zero Copy (ZETL) Feature Interoperability**: Data duplication presents security and operational challenges. This also comes with unnecessary storage costs, data inconsistencies, and increased risk exposure. Salesforce’s Zero Extract, Transform, and Load (ZETL) approach ensures that real-time data sharing across platforms can occur without requiring physical data replication. This means that data can remain within its original environment while still being accessible for processing, reporting, and analytics. Furthermore, this also significantly reduces the attack surface and enhances potential compliance with data residency laws.
* **Data Federation Support**: In today's multi-cloud environments, organizations need comprehensive data access without unnecessary data movement. The Data 360 connector federated data model supports both file-based and query-based data federation, enabling enterprises to leverage external data sources in real time. Whether accessing structured databases, semi-structured logs, or unstructured files, Salesforce’s connectors ensure that data remains secure throughout its lifecycle.
Salesforce aims to provide its customers with the transparency needed to help navigate the complexities of data security and compliance, even with our integrations. Whether integrating with AWS S3, Google Cloud Storage, Snowflake, or other platforms, our Data 360 Connectors are designed to ensure trust, transparency, and control over critical business data.
##### Salesforce Data 360 Connector Security & Authentication Mapping
Connector Type
Connection Type Support
Primary Authentication Types
Key Security Aspects & Notes
Salesforce CRM
N/A (Internal)
Session-based (Internal)
Uses Salesforce's robust internal identity & access management (IAM) model. All data is encrypted in transit and at rest within the Salesforce infrastructure.
Marketing Cloud Engagement
Public Internet Only
OAuth 2.0, Username/Password
Standard OAuth 2.0 protocols are used for secure authentication. Data is encrypted in transit (TLS) over public internet.
B2C Commerce
Public Internet Only
OAuth 2.0
Standard OAuth 2.0. Relies on secure public internet protocols (TLS) for data transfer.
Web & Mobile App
Public Internet Only
API Keys, OAuth 2.0
Data ingested via APIs (Ingestion API, Streaming API). Security managed through API key management and standard web protocols.
Amazon S3
Private Connect & Public
IAM Roles, External Credentials
Supports AWS PrivateLink for secure, private connection. Public connection uses secure credentials. Data is encrypted in transit and at rest (customer-managed keys in S3 optional).
Snowflake
Private Connect & Public
OAuth 2.0, Private Key Auth, Username/Password
Supports VPC private connection (AWS PrivateLink). Public connection available with secure authentication methods. Data can be encrypted with customer keys within Snowflake.
Amazon Redshift
Private Connect & Public
Username/Password, IAM Authentication
Supports private connection (AWS PrivateLink). Public connection uses standard security best practices.
Microsoft Azure (Storage/SQL)
Public Internet Only
SAS Tokens, OAuth 2.0, Username/Password
Connections rely on secure SAS Tokens or OAuth for authentication. Data traverses the public internet via encrypted channels (TLS).
Google Cloud Storage (GCS)
Public Internet Only
OAuth 2.0, Service Accounts
Connections rely on secure OAuth 2.0. Data traverses the public internet via encrypted channels (TLS).
MuleSoft (API)
Public Internet Only
OAuth 2.0, API Key
Connects via APIs. Security is managed through standard API authentication and robust governance policies implemented via MuleSoft Anypoint Platform.
#### Secure Data Activation (Outbound Data )
The final stage of the data lifecycle — *data activation* — is where unified and enriched customer profiles within Salesforce Data 360 are securely distributed to external systems for downstream applications such as personalized marketing, analytics, or engagement orchestration.
This phase represents the transition from *insight* to *action* — and therefore carries the highest responsibility for maintaining data integrity, privacy compliance, and trust.
##### Securing Outbound Data Transfers
Data 360 enforces secure outbound connectivity through governed, encrypted pathways. All activation targets — whether SFTP, Amazon S3, Microsoft Azure Blob, Google Cloud Storage, or ad networks — must be configured using secure connection definitions that authenticate through Salesforce’s Named Credential and External Credential framework, ensuring that no credentials or endpoints are exposed in plaintext.
**Architectural Security Controls:**
* **Encrypted Channels:** All outbound data transfers occur over TLS-encrypted channels, ensuring confidentiality and integrity in transit.
* **Credential Abstraction:** Outbound endpoints use Named Credentials, leveraging Salesforce’s encrypted secret store and centralized management for all API keys and authentication tokens.
This prevents exposure of sensitive details in configuration files or flow definitions.
* **Access Governance:** Activation targets can be bound to specific Integration Users with scoped permissions, providing fine-grained access control and full auditability for outbound events.
* **Network Security:** For high-security environments, outbound connections can be restricted to Private Connect links, ensuring that data activation traffic remains within a private AWS or Azure network instead of traversing the public internet.
##### Data 360 Activation Flow
Stage
Mechanism
Security / Governance Controls
Activation Configuration
Defined in Data 360 activation setup
Secured through Named Credentials & External Credentials
Data Preparation
Filtered and joined from DMOs
Consent & privacy metadata applied
Outbound Transfer
Encrypted via TLS / Private Connect
Policy enforcement and credential abstraction
External Delivery
SFTP / Cloud Storage / API
Access controlled and auditable delivery
#### Consent and Privacy Enforcement at Activation
Security in Data 360 extends beyond technical controls to include policy-aware governance. At the moment of activation, Salesforce’s Data 360 Trust Layer automatically enforces customer consent and privacy policies, ensuring that only eligible data is shared with external destinations.
**Key Capabilities:**
* Consent-Aware Data Flows: Data 360 evaluates consent flags such as “Do Not Share,” “Do Not Sell,” or “Email Opt-Out” before data is activated. Records that violate these consent conditions are automatically excluded from outbound datasets.
* Regulatory Alignment: These policy enforcements align with global privacy frameworks including GDPR, CCPA, and HIPAA, embedding compliance directly into the data activation process rather than relying on downstream enforcement.
* Automated Lineage and Audit: Each outbound activation event is logged with full data lineage metadata, including source DMO, consent status, and destination details. This enables audit-ready reporting for regulators or internal governance teams.
Salesforce Data 360 embeds security, governance, and privacy controls across the entire data lifecycle — from ingestion and storage to integration and activation — ensuring that customer data remains encrypted, policy-compliant, and trusted at every stage. By uniting Platform Encryption, Named & External Credentials, and consent-aware activation, Data 360 delivers an end-to-end Zero Trust architecture that safeguards data integrity, confidentiality, and compliance from source to business activation.
## Securing Cross-Cloud Data Access: The Private Connectivity Framework
### Private Connectivity for Cross-Cloud Data Access
For many security-conscious enterprises, particularly in regulated industries and the public sector, internet-restricted data environments are a core component of their compliance and cybersecurity strategy. While such isolation minimizes external exposure, it also introduces integration challenges for Salesforce Data 360 and Agentforce, which require secure access to customer-managed data lakes.
Most enterprise data lakes reside on hyperscaler platforms such as AWS, Microsoft Azure, or Google Cloud. Because Salesforce Data 360 operates on AWS infrastructure, connecting securely to customer environments hosted on other clouds requires a private, cross-cloud network path that bypasses the public internet.
#### Private Links: Network-Level Security on AWS
Data 360 provides [private, intra-cloud connectivity](https://help.salesforce.com/s/articleView?id=data.c360_a_private_connect_considerations.htm&type=5) through AWS PrivateLink, enabling secure, direct access between Data 360 and customer-managed data sources, including services like Snowflake (hosted on AWS), Redshift, or S3, without exposing traffic to the public internet.
All communication stays within the AWS backbone, using private IP addressing and non-routable network paths, thereby eliminating the risk of data-in-transit interception and meeting stringent enterprise and regulatory security requirements.
This architecture ensures:
* **Zero Internet Exposure:** Data never leaves the AWS private network.
* **Private IP Communication:** Traffic remains isolated and unaddressable externally.
* **Compliance Alignment:** Satisfies security standards like ISO 27001, SOC 2, and FedRAMP.
#### Private Interconnect: Extending Security Across Clouds
To support customers operating in multi-cloud environments, Salesforce is extending the same security principles beyond AWS through Private Interconnect. This capability enables cross-cloud private connectivity between Data 360 and data lakes hosted in Azure or Google Cloud, maintaining the same guarantees of private routing, zero internet traversal, and encrypted backbone-only traffic.
Two architectural deployment models are available:
* **Customer-Managed Interconnect:** Customers integrate their existing private network circuits, such as Azure ExpressRoute, Google Cloud Interconnect, or Equinix Fabric, directly with Data 360 VPCs.
* **Salesforce-Managed Interconnect:** Salesforce provisions and manages the cross-cloud link, exposing private service endpoints in the customer’s target cloud environment for a turnkey setup.
### Securing the Gates: API Security Capabilities in Salesforce Data 360
Salesforce Data 360, a powerful platform for unifying enterprise data, is built with robust, multi-layered security controls. For customers, managing API security is a critical part of a comprehensive data protection strategy, enabling them to control access, manage integrations, and monitor usage effectively.
Here are the key capabilities and features available for customers to set up, control, and manage API security within Salesforce Data 360.
#### Key API Security Features and Capabilities
Customers can leverage several built-in Salesforce features to ensure secure API access to their Data 360 instances:
##### 1. Robust Authentication and Authorization (OAuth 2.0)
Salesforce mandates strict authentication for its Data 360 APIs, with OAuth 2.0 being the standard and recommended protocol.
* **Connected Apps**: Customers create and configure Connected Apps to manage external application access. This is the primary mechanism for authenticating and granting access to the Data 360 Ingestion and Query APIs.
* **OAuth Scopes**: Admins can define specific OAuth scopes (for example, cdp\_ingest\_api, api) to request the minimum required permissions, adhering to the principle of least privilege.
* **Multi-Factor Authentication (MFA)**: Salesforce Authenticator and other MFA solutions can be enforced, adding a vital layer of security and ensuring only verified users can access the system, including via API logins.
##### 2. Granular Access Control and Permissions
Customers have fine-grained control over which users and applications can access data and what actions they can perform.
* **API Access Control (Feature)**: Once enabled by Salesforce Support, this feature allows administrators to explicitly approve which Connected Apps can be used to access the APIs. All unapproved apps are automatically blocked, significantly reducing the risk of unauthorized data extraction.
* **Permission Sets and Profiles**: Admins manage API access by assigning the "API Enabled" permission via user profiles or dedicated permission sets. This ensures that users only have access relevant to their job functions.
* **Role-Based Access Control (RBAC)**: Within Data 360, customers can create and manage role-based access control policies to define data access levels (object, field, and record level security), ensuring consistency and control across the platform.
* **Dedicated Integration Users**: Best practices recommend creating specific "API Only" users for integrations, limiting their permissions to only what is necessary for the API call, rather than using a system administrator account.
##### 3. Network Security Controls
* **IP Whitelisting/Login IP Ranges**: Customers can restrict API access to a defined range of trusted IP addresses. Any login attempt from an unapproved IP range can be denied or challenged for verification.
* **Private Connect**: Built on AWS PrivateLink, this feature allows admins to manage sensitive data without exposing endpoints to the public internet, eliminating the risk of attacks on publicly visible endpoints.
* **Encryption in Transit and at Rest**: All data is encrypted in transit (using TLS) and at rest, protecting sensitive information from unauthorized access even if intercepted.
##### 4. Monitoring, Auditing, and Governance
Visibility is key to security. Salesforce provides extensive tools for monitoring and auditing API activity.
* **Event Monitoring**: Provides near real-time tracking of various events, including API calls and login attempts. Customers can use this data for auditing and to create transaction security policies.
* **Security Center**: This feature offers a single, consolidated view of the security health, compliance, and governance metrics across all Salesforce orgs, simplifying monitoring and management.
* **Field Audit Trail**: Helps customers track login and field history, monitor setup changes, and address auditing and data retention compliance obligations.
* **Data Governance Features**: Includes data tagging and classification, policy enforcement, and dynamic data masking to ensure consistent governance policies are applied across all data touchpoints, including those accessed via APIs.
#### Setting Up & Managing API Security: A Customer Journey
1. Enable Core Controls: Start by enabling organization-wide defaults like MFA and IP restrictions.
2. Request API Access Control: Log a case with Salesforce Support to enable the "API Access Control" feature in your org.
3. Configure Connected Apps: Create specific Connected Apps for each integration, defining the required OAuth scopes and assigning them to authorized profiles/permission sets.
4. Implement Least Privilege: Ensure all integration users have "API Only" permissions and minimal data access.
5. Monitor and Audit: Regularly use Event Monitoring and Security Center to review API usage, detect anomalies, and perform vulnerability assessments.
6. Enforce Best Practices: Always enforce TLS, securely store refresh tokens, rotate session IDs, and validate data inputs.
By leveraging these robust, customer-configurable features, businesses can maintain a secure and compliant environment for all API interactions within Salesforce Data 360.
### Compliance, Auditing, and Continuous Monitoring
#### Service Availability and Data Residency
Salesforce Data 360 is designed to meet global data residency and sovereignty requirements through its geographically distributed deployment model. The service is currently available across multiple regulated regions, including the United States, Canada, Brazil, Germany, India, Australia, and Japan.
Data residency is determined by mapping each customer’s Core Org instance to the nearest corresponding Data 360 regional instance. For example, Core Orgs located in the United States or Canada are paired with a Data 360 instance within the U.S. region, while core orgs within the European Union are mapped to an instance hosted in Germany. Similarly, Core Orgs in India, Australia, New Zealand, or Singapore are associated with a Data 360 instance hosted in India.
Salesforce’s Hyperforce infrastructure underpins this model, providing the foundation for geographic data control, security isolation, and regulatory compliance. Hyperforce ensures that customer data, including metadata, backups, and derived datasets, remains within defined regional boundaries. This architecture allows enterprises to meet local data residency and compliance mandates such as GDPR, FFIEC, HIPAA, and regional privacy laws across APAC and EMEA.
Salesforce continues to expand the availability of Data 360 to additional Hyperforce regions to align with evolving global privacy standards, regional compliance requirements, and customer expectations for sovereign data control.
#### Regulatory Compliance Enablement
Salesforce Data 360 is engineered to help enterprises meet stringent global privacy and regulatory requirements such as GDPR and CCPA. The platform provides native capabilities to manage Data Subject Rights (DSRs), including data access, export, and deletion (“Right to be Forgotten”), ensuring compliant handling of personal data throughout its lifecycle.
While the customer retains ultimate responsibility for compliance, Salesforce operates as a certified “service provider” under regulations like the CCPA, delivering the platform-level controls, security assurances, and contractual mechanisms that enable organizations to implement their compliance frameworks efficiently and at scale.
#### Foundational Trust: Certifications and Attestations
Trust is the cornerstone of Salesforce’s platform — and that trust is earned through independent validation. Salesforce maintains a broad portfolio of global security certifications and attestations that demonstrate its ongoing commitment to protecting customer data and upholding the highest standards of cloud security.
These certifications are not just checkboxes — they represent rigorous, recurring audits that verify the strength and consistency of Salesforce’s security controls, processes, and infrastructure. Together, they form the backbone of Salesforce’s foundational trust model.
**Key Certifications and Attestations Include:**
* **ISO/IEC 27001:** Validates Salesforce’s comprehensive information security management system.
* **ISO/IEC 27017:** Establishes best practices for cloud-specific security controls.
* **ISO/IEC 27018:** Focuses on safeguarding personally identifiable information (PII) in the cloud.
* **SOC 1, SOC 2, and SOC 3:** Independent reports confirming the design and operational effectiveness of Salesforce’s security and privacy controls.
* **PCI DSS:** Ensures the secure processing and storage of payment card information.
* **FedRAMP High & DoD Impact Level 4:** Certifies Salesforce Government Cloud for use by U.S. federal agencies managing sensitive workloads.
By maintaining this comprehensive set of certifications, Salesforce gives customers confidence that their data is managed within a platform that meets — and often exceeds — global compliance and security expectations.
### Maximizing Visibility: Logging, Monitoring, and Observability in Salesforce Data 360
In today's fast-paced digital landscape, having a 360-degree view of your customer data is crucial, but equally important is having a 360-degree view of the platform managing that data. Salesforce Data 360 provides robust, built-in logging, monitoring, and observability features that empower customers to ensure data quality, security, and performance.
These tools help you move from reactive problem-solving to proactive management, ensuring your Data 360 implementation runs smoothly and efficiently.
#### Proactive Threat Detection and Response
Security doesn’t end with prevention — it evolves with vigilance. In a constantly shifting threat landscape, Salesforce combines advanced platform monitoring capabilities with customer-managed review processes to ensure proactive, continuous protection.
Salesforce provides powerful native tools for visibility and threat detection:
* **Setup Audit Trail** captures a full history of administrative changes, helping teams trace configuration or policy updates.
* **Event Monitoring** delivers deep insight into user behavior, API activity, and data access patterns. This telemetry can be seamlessly integrated with a **Security Information and Event Management (SIEM)** solution for centralized analysis and correlation.
#### 1. Event Monitoring: The Pulse of Your Org
Event Monitoring, part of the Salesforce Shield offering, is the central hub for tracking detailed user activity and system performance data in your Salesforce org, including Data 360-specific actions. It captures a wide array of "events" into log files and objects for your analysis.
* **Event Log Files (ELFs):** These provide granular details of user activity and system events, available for download after a short delay (hourly or daily). You can access up to 30 days of data via API or the Event Log File browser, with the option to export for longer-term storage.
* **Real-Time Event Monitoring:** For immediate insights, real-time events are streamed as platform events, allowing you to monitor and detect activity in near real-time. This is vital for security and performance, enabling you to take immediate action if needed.
* **Data 360 Specific Events:** Event Monitoring includes event types specific to Data 360 usage, such as Lightning Page View, Lightning Interaction, and Report Event related to Data 360 pages and data.
* **Integration with External Tools:** Salesforce facilitates seamless integration with popular third-party monitoring solutions like Splunk, Datadog, New Relic, and Sumo Logic. You can stream or export Event Monitoring data to these platforms for consolidated observability across your entire tech stack.
#### 2. Performance Monitoring & Optimization
Understanding the performance of your Data 360 implementation is key to a great user experience.
* **Lightning Usage App:** This built-in app provides an aggregated view of performance metrics, such as page load times (Experienced Page Time or EPT) and browser performance, for Data 360 pages in Lightning Experience.
* **Custom Reports and Dashboards:** You can build custom reports and dashboards using Data 360 objects and Event Monitoring data, including using a free CRM Analytics templated app called Event Monitoring Plus. These visualizations help you spot trends and identify performance bottlenecks quickly.
But technology alone isn’t enough. True resilience requires a disciplined partnership between automated detection and human review. Automated alerts can surface real-time anomalies, but subtle or long-term threats, such as slow, unauthorized data exfiltration by a valid user, are often best identified through periodic audits and trend analysis.
Salesforce provides the telemetry, audit logs, and integration hooks; customers bring the process rigor, operational cadence, and context-specific intelligence. Together, they form a **defense-in-depth model** — blending automation, analytics, and human oversight to detect, investigate, and respond to threats before they become incidents.
### Driving Informed Decisions: Reports, Dashboards, Metrics, and Notifications in Salesforce Data 360
Salesforce Data 360 isn't just about unifying your customer data; it's about making that data intelligent and actionable. A core part of this value proposition is providing robust reporting, powerful dashboards, insightful metrics, and real-time notification features. These tools enable customers to monitor data health, track performance, and automate actions based on unified data, all within the familiar Salesforce environment.
#### Reports and Dashboards: Your Data Visualization Hub
Salesforce's native reporting and dashboard capabilities extend seamlessly into Data 360, allowing you to visualize and analyze your unified data without leaving the platform.
#### Building Reports on Unified Data
You can create standard and custom reports on data stored in Data 360, including unified data from various sources and calculated insights.
* **Standard & Custom Report Types:** Data 360 introduces new report types specifically for Data 360 objects, such as Data Streams, Segments, Activations, Identity Resolution, and Calculated Insights. This allows you to query your unified data with standard Salesforce report builders.
* **Granular Analysis:** Reports support up to 10 row groupings, allowing for finer segmentation and detailed analysis of customer attributes and trends.
* **Formulas and Summaries:** You can leverage row-level and summary formulas to evaluate each record or group of records, helping you track detailed metrics and high-level aggregate summaries within a single report.
#### Dynamic Dashboards for Holistic Views
Dashboards provide a visual display of key metrics and trends across your Data 360 implementation.
* **Unified View:** Combine data from multiple Data 360 reports, or even mix Data 360 reports with standard CRM reports, in a single dashboard for a holistic view of your operations and customer insights.
* **Customizable Widgets:** Use various chart types (bar, line, pie, gauge, etc.) and tables to display report data effectively.
* **Real-time Insights:** Dashboards can be refreshed to provide up-to-date information, aiding in fast, data-driven decision-making.
#### Metrics & KPIs: Measuring Success
Data 360 enables you to define and track key performance indicators (KPIs) that are relevant to your business goals. These can be generated through:
* **Calculated Insights:** Create powerful metrics using data processed in high-volume batches. For instance, calculate metrics like "Average Customer Lifetime Value" or "Total Active Contract Revenue" and use these as dimensions or measures in your reports and dashboards.
* **Streaming Insights:** Process data from streaming sources in near real-time to build time-series aggregations, such as website or mobile engagement data. These metrics can drive immediate orchestrations and data actions.
#### Notifications and Alerts: Staying Informed and Proactive
Salesforce offers powerful automation and notification features to ensure you're aware of critical events or data changes within Data 360\.
* **Flow-Based Notifications:** You can set up Process Flows to trigger actions and send notifications based on events in Data 360 objects like Data Streams, Segments, and Activations.
* **Custom Alerts:** Create custom notifications that trigger an email or appear in the Salesforce Notification Bell when specific conditions are met. For example, you can receive an alert if a data stream fails, an identity resolution rule encounters an error, or a key metric crosses a certain threshold.
* **Event Notification Service (ENS):** For developers, the API-first Event Notification Service allows external systems to receive notifications when certain events occur, enabling seamless integration and real-time reactions across your tech stack.
* **Data Actions:** Based on streaming insights, you can trigger data actions, which can be configured to send alerts, invoke platform events, or integrate with other SaaS applications via webhooks.
By leveraging these comprehensive capabilities, Salesforce Data 360 customers can effectively monitor their data ecosystem, visualize key metrics, and receive timely alerts to drive proactive engagement and operational excellence.
### Strategic Recommendations for Enterprise Adoption
Adopting Salesforce Data 360 at enterprise scale requires more than technical enablement — it demands a deliberate, security-first architecture. The following strategic recommendations provide CTOs and enterprise architects with a roadmap to build trust, resilience, and compliance into every layer of their Data 360 deployment.
* **Implement a “Secure-by-Design” Approach :** Security should not be retrofitted — it should be foundational. Start with Salesforce’s default *“Deny All”* policy and explicitly grant access as needed. Define governance, policies, and access frameworks before ingesting or activating data. Building security from day one eliminates the risk of hidden exposures and simplifies long-term compliance.
* **Enforce a Robust Identity and Access Management (IAM) Strategy :** Centralize identity through federated SSO and enforce Multi-Factor Authentication (MFA) to mitigate credential compromise. Restrict access by Login IP Ranges and use Salesforce’s Identity Provider (IdP) capabilities to establish end-to-end accountability across users and integrations. A unified IAM layer reduces operational complexity and hardens your authentication surface.
* **Apply the Principle of Least Privilege :** Design roles for precision, not convenience. Use Salesforce’s standard permission sets as the foundation for separation of duties, ensuring users only access what’s necessary. Avoid over-customization of permissions — each deviation increases maintenance overhead and the risk of unintended access.
* **Establish a Multi-Layered Data Governance Framework:** Segregate data by business unit or brand using Data Spaces, and enforce Attribute-Based Access Control (ABAC) with Object-, Field-, and Record-Level Security (OLS, FLS, RLS). Use Dynamic Data Masking to protect sensitive information in real-time without hindering analytics or usability. This layered model ensures governance remains consistent as data scales across domains.
* **Strategically Leverage Encryption and Secure Integrations :** For sensitive workloads, deploy Platform Encryption with Customer-Managed Keys (CMK) to maintain sovereignty over your encryption lifecycle. Use Named Credentials and Private Connect to secure all system-to-system integrations — eliminating hard-coded secrets and ensuring all traffic remains private, compliant, and auditable.
* **Build a Continuous Security Operations Program :** Security does not end with configuration — it thrives on operational discipline. Complement automated monitoring with regular audit reviews of event logs and access trails. Establish a dedicated Security Operations (SecOps) function to identify anomalies, investigate threats, and validate compliance. The goal: detect early, respond fast, and continuously improve posture.
### Path Forward: Building a Resilient, Trusted Data 360
The journey to a secure and intelligent enterprise does not end with deployment — it evolves through discipline, design, and trust. Salesforce Data 360 provides the architectural foundation, but the true value emerges when organizations operationalize security, governance, and intelligence as one unified motion.
Enterprises should approach Data 360 not as another data platform, but as a secure, composable trust layer that connects data, AI, and customer engagement under a single governance framework. By adopting a *secure-by-design* philosophy, enforcing least privilege at every layer, and extending private connectivity to all data flows, organizations transform compliance from a checkbox into a competitive advantage.
The next step is continuous modernization — embedding audit automation, policy enforcement, and encryption lifecycle management into day-to-day operations. As enterprises evolve toward agentic, AI-driven architectures, the same principles that protect data today will form the backbone of AI governance tomorrow — ensuring that every model, agent, and decision is explainable, policy-aware, and compliant by design.
Ultimately, trust becomes the new currency of digital transformation. With Salesforce Data 360, enterprises can confidently scale their data ecosystem — knowing that every byte, every connection, and every insight is secured, governed, and activated with integrity.
## About the Authors
**Krishna Chalamasandra** is a seasoned cybersecurity expert with 25+ years of experience in Information Security technology and compliance. At Salesforce, he serves as a trusted advisor to customers and a key leader in the Security and Compliance Customer Trust function within the CISO organization. Previously, Krishna spent 10 years at Cisco, leading security architecture across IAM, network security, and PKI, and driving key certifications including ISO 27001, SOC 1–3, PCI, FedRAMP, and FIPS 140-2. He also spent over 8 years at Novell implementing infrastructure-level controls and supporting complex security reviews for global, regulated customers.
**Yugandhar Bora** is a Software Engineering Architect at Salesforce, specializing in data architecture within the Data & Intelligence Applications platform. He leads enterprise architecture review board (EARB) initiatives focused on data governance and unified data models, while contributing to automated platform provisioning solutions.
## Overview
Most enterprise integration pipelines between Salesforce and external analytics platforms rely on custom code. They work until something breaks. Schema drift, API exhaustion, and hard-delete gaps require constant engineering intervention. As companies push toward agile, citizen-developer-enabled architectures, this model becomes a bottleneck\: analytics teams wait on engineering sprints to add a Salesforce field to a downstream schema, failed nightly loads delay Monday morning reporting, and simple configuration changes require code reviews and deployments.
CRM Analytics, the Salesforce native analytics and business intelligence platform, solves this problem by enabling companies to explore data, build interactive dashboards, and uncover AI-driven insights without leaving the Salesforce ecosystem. Central to this capability is a declarative, low-code data synchronization feature built natively into the platform\: CRM Analytics SyncOut and CRM Analytics SyncIn.
CRM Analytics SyncOut moves Salesforce records into external data stores on a configured schedule, using Change Data Capture (CDC) for incremental loads and built-in hard-delete tracking to flag permanently removed records. CRM Analytics SyncIn brings external data back into Salesforce, mapping columns to object fields and upserting records using Bulk API 2.0. Both are configured entirely through Salesforce Setup. No pipelines, no staging scripts, no custom monitoring. Administrators configure a sync job in a single Setup session; the platform handles execution, retry, error logging, and schema mapping automatically.
This guide explains the pattern, when to use it, how to implement it with Snowflake as a worked example, and the architectural considerations that determine whether it fits a given integration problem.
## Products in Scope
CRM Analytics is the Salesforce native analytics and business intelligence platform, enabling users to explore data, build interactive dashboards, and uncover AI-driven insights—all within the Salesforce ecosystem. This platform moves data between Salesforce and external systems through two key capabilities\: CRM Analytics SyncOut and CRM Analytics SyncIn. CRM Analytics SyncOut pushes Salesforce object data to an external data platform, supporting both full and incremental (CDC) sync modes with built-in hard-delete tracking. CRM Analytics SyncIn completes the bidirectional loop by pulling data from an external platform back into Salesforce objects using Bulk API 2.0, ensuring large data volumes are handled reliably and efficiently.
**Licensing note\:** CRM Analytics SyncIn and SyncOut are not available on base Salesforce editions without a CRM Analytics license add-on. Confirm license entitlements before designing a synchronization architecture that depends on these capabilities.
## Why It Matters
Data integration is one of the highest-friction surfaces in enterprise architecture. A custom ETL pipeline from Salesforce to an analytics platform typically requires a Connected App for authentication, a scheduled job for SOQL extraction, a transformation layer to reconcile field types, a staging area for bulk load, and a monitoring layer to catch failures. Each component of custom code represents a failure point.
The cost of this friction compounds over time. Schema drift in Salesforce (a renamed field, a new picklist value, a changed API name) breaks the pipeline silently. API exhaustion during peak usage stalls the extract. Hard-deleted records never appear in the target table, leaving stale data that downstream analytics treat as live. The engineering team becomes the bottleneck for routine data operations.
CRM Analytics SyncIn and SyncOut change the operating model. Configuration replaces code. The platform takes responsibility for execution, error handling, schema mapping, and observability. Administrators can define, modify, and monitor sync jobs without raising a development ticket.
The result of this new operating model is reduced time from integration design to operational sync, lower engineering overhead, and an integration model that scales within platform constraints rather than requiring custom code maintenance.
## Core Concepts
**SyncIn and SyncOut** are the two directional modes of CRM Analytics data synchronization. SyncOut moves Salesforce records to an external platform. SyncIn brings external records into Salesforce. Both operate on a declarative configuration model with no custom code required.
**Declarative configuration** means all sync behavior is defined through point-and-click UI in Salesforce Setup. Source object, target table, field mappings, sync schedule, sync mode, and filters are all set through configuration metadata. The platform derives the execution plan from that metadata and manages it end to end.
**Full sync vs. incremental sync** controls what data moves on each run. A full sync queries all records that match the filter criteria on every execution. An incremental sync uses CDC to query only records that have changed since the last run. Incremental sync is the recommended mode for high-volume objects, as it reduces API consumption and sync duration significantly.
**Change Data Capture (CDC)** is a Salesforce platform capability that records field-level changes to objects as event streams. SyncOut uses CDC to detect creates, updates, and deletes without performing full table scans. CDC must be enabled per object in Salesforce Setup before it can be referenced by a sync configuration.
**Hard-delete tracking** solves one of the most persistent problems in Salesforce-to-external ETL. When a record is hard deleted in Salesforce, it disappears from standard SOQL queries. Without explicit tracking, the external platform never learns the record was removed. SyncOut's hard-delete tracking, when enabled, flags deleted records in the target table with `DEL_FLAG = 'Y'`, giving downstream systems a reliable signal to filter stale data.
**Sync frequency** is configurable from 15 minutes to weekly. The choice is a trade-off between data freshness, API consumption, and Snowflake warehouse compute cost. 15-minute syncs approach near-real-time for operational dashboards; daily syncs are appropriate for batch reporting workloads.
**Governor limits constrain sync job design\:** The Salesforce API request limit (15,000 calls per 24 hours on Unlimited Edition), the Bulk API 2.0 batch size of 10,000 records, and the SOQL query row limit of 50,000 per transaction all inform how to size and schedule sync jobs. The platform handles chunking and pagination automatically, but architects must account for limited headroom across all sync jobs running in the org.
## Data Synchronization with Snowflake\: A Worked Example
Snowflake is a primary target and source for data synchronization with Salesforce CRM Analytics. It serves as a concrete example of how batch and incremental data movement works end to end.
This section provides an overview of implementing CRM Analytics SyncOut and SyncIn using Snowflake as the external analytics platform. It covers each method, the shared authentication models, security frameworks, key platform considerations, and observability practices.
### SyncOut (Salesforce → Snowflake)
In this SyncOut configuration, Salesforce uses CRM Analytics SyncOut to push records to Snowflake. The platform extracts data via SOQL, handles type conversions automatically, and loads it into Snowflake tables on a configured schedule (ranging from 15 minutes to weekly). Refer to current Salesforce and Snowflake documentation for specific loading semantics.

### SyncIn (Snowflake → Salesforce)
In this SyncIn configuration, Salesforce uses CRM Analytics SyncIn to pull data back into Salesforce. The platform queries Snowflake via the Statements API and upserts results into Salesforce using Bulk API 2.0. Large result sets are automatically paginated to stay within API limits. The sync runs on a configured schedule, ranging from 15 minutes to weekly.

### Authentication Model
Salesforce synchronization supports multiple authentication methods to connect securely with Snowflake. The two primary approaches for enterprise integrations are Key-Pair (Private Key) and delegated OAuth 2.0.
**Method 1\: Key-Pair (Private Key) Authentication**\: Key-pair authentication is the recommended approach for automated, system-to-system data movement such as CRM Analytics SyncIn and SyncOut. Authentication relies on JSON Web Tokens (JWT) rather than passwords or refreshable tokens, making it well-suited for unattended, scheduled jobs that don't require token refresh.
- **Salesforce Certificate\:** Generate a private key and store it securely in Salesforce Certificate and Key Management.
- **External/Named Credential\:** Configured to use a JWT exchange. Salesforce uses the stored private key to sign outbound connection requests.
- **Snowflake user public key\:** The matching public key is assigned directly to the dedicated Snowflake service account (e.g., ALTER USER CRM\_ANALYTICS\_SYNC\_USER SET RSA\_PUBLIC\_KEY = '...'). Snowflake then uses this key to verify the incoming JWT signature. No Security Integration is required for this method.
**Method 2\: Delegated OAuth 2.0 Authentication\:** Alternatively, Salesforce can use an OAuth handshake to authenticate. The key components are\:
- **Auth Provider\:** Manages the OAuth handshake with Snowflake, using the client credentials retrieved from the Snowflake Security Integration.
- **External Credential\:** Holds the OAuth tokens securely within Salesforce and injects them into the sync callouts automatically.
- **Named Credential\:** Defines the Snowflake endpoint URL (e.g., https\://\.snowflakecomputing.com) and references the External Credential.
- **Snowflake Security Integration\:** Registers Salesforce as a trusted OAuth client in Snowflake (OAUTH\_CLIENT = CUSTOM). Defines the allowed redirect URI and enables refresh tokens.
**Configuration dependency\:** Regardless of the chosen method, these components form a dependency chain connecting the sync configuration to the endpoint. Granting the relevant Salesforce profiles access to the Named Credential is required; without this access, sync jobs fail due to authentication errors regardless of all other configurations.
### Security Model\: Least-Privilege Principal
Background synchronization relies on a single integration identity.
- **Dedicated Service Account\:** Create a dedicated Snowflake service account with a least-privilege role scoped only to the databases, schemas, and tables required for the sync.
- **Granular Permissions\:** For SyncOut, this role requires INSERT, UPDATE, and SELECT on target tables. Never use high-privilege roles such as ACCOUNTADMIN, SECURITYADMIN, or SYSADMIN.
### Key Platform Considerations
- **Governor limits and chunking\:** During SyncOut extraction, large result sets are automatically chunked to respect Salesforce SOQL governor limits. SyncIn fetches large result sets from the Snowflake Statements API via automatic pagination to manage data volumes efficiently.
- **Change Data Capture (CDC)\:** Incremental SyncOut relies on the Salesforce CDC event stream to identify records created, updated, or deleted. If hard-delete tracking is enabled, deleted Salesforce records are not dropped but flagged with `DEL_FLAG = 'Y'` in Snowflake.
- **Upsert constraints\:** SyncIn relies on Bulk API 2.0 to load data back into Salesforce. This requires a designated External ID field to be configured on the target Salesforce object to act as the upsert key.
- **Design guidance\:** Always sync from curated Snowflake views rather than raw tables. Views allow for the pre-filtering of rows, column selection, and the application of business logic, reducing data volume, sync duration, and Snowflake warehouse compute costs in proportion to the pre-filtering applied.
### Observability
Every synchronization run generates comprehensive audit trails to validate data movement. The Sync Job Monitor dashboard provides real-time status, processed record counts, execution durations, and detailed error logs for both SyncIn and SyncOut. On the Snowflake side, every query submitted by Salesforce is logged in Snowflake Query History, providing full visibility into execution latency, rows scanned, and warehouse compute usage. Additionally, architects define dedicated Snowflake audit tables to capture sync run metadata — timestamp, record counts, and errors; these are not generated automatically by the platform. For end-to-end validation, compare record counts across both platforms\: verify active records in Snowflake (`WHERE DEL_FLAG = 'N'`) for SyncOut runs, and compare Salesforce target object counts directly against the original Snowflake source view for SyncIn runs.
## When to Use Data Synchronization
Use CRM Analytics SyncIn and SyncOut when\:
- **Bidirectional synchronization is a requirement\:** Data flows both into Salesforce via SyncIn and out to an external platform via SyncOut.
- **Hard-delete tracking is critical\:** SyncOut's built-in flagging solves a historically complex ETL problem without custom reconciliation logic.
- **CDC-based incremental sync is viable\:** For high-volume Salesforce objects, CDC reduces API consumption and sync duration significantly versus full scans.
- **Scheduled batch sync meets latency requirements\:** The minimum sync frequency is 15 minutes, suitable for operational dashboards and near-real-time analytics reporting.
- **Low operational overhead is a priority\:** Built-in dashboards provide full sync visibility without custom logging or alerting infrastructure, and the declarative Setup UI allows administrators to define, modify, and monitor sync jobs without raising a development ticket.
**Do not use this pattern if\:**
- **Complex transformations are required\:** Multi-table joins, JSON parsing, or handle advanced business logic in Snowflake views or a dedicated transformation layer before or after sync.
- **Sub-15-minute latency is required\:** For real-time use cases, use Platform Events or Streaming APIs.
- **Very high-volume streaming workloads are in scope\:** Objects with millions of transactions per hour are better served by dedicated streaming pipelines (Kafka, Platform Events).
- **Custom error handling logic is needed\:** The platform provides standard retry and error logging. Complex retry patterns or custom alerting require Apex or external orchestration.
- **Multi-org or cross-cloud sync\:** CRM Analytics SyncIn and SyncOut operate within a single Salesforce org. MuleSoft or a custom integration layer is required for multi-org scenarios.
## Use Cases\: The Pattern in Practice
### Eliminating Legacy Dataset Upload Pipelines
A team ran complex ETL pipelines to upload Snowflake analytics data into CRM Analytics datasets. The pipelines were slow, fragile, and required constant engineering maintenance.
CRM Analytics SyncIn was configured to sync curated Snowflake aggregated views directly into Salesforce custom objects. The team reconfigured CRM Analytics dashboards to read from those objects instead of CRM Analytics datasets. The result\: two ETL pipelines eliminated, sync duration reduced from four hours to 30 minutes, and administrators able to modify sync configurations without raising an engineering ticket.
### Solving the Permanent Delete Problem
A data team needed to track hard-deleted Salesforce records in their Snowflake operational data store. Traditional approaches required split jobs and complex ID reconciliation logic that took hours to run and was brittle across schema changes.
The team configured CRM Analytics SyncOut with CDC and hard-delete tracking enabled. Deleted records are now automatically flagged with DEL\_FLAG = 'Y' in the Snowflake consumption table. Downstream analytics queries apply WHERE DEL\_FLAG = 'N' to see only active records. Reconciliation logic was eliminated entirely, and sync duration dropped from eight hours to 15-minute incremental runs.
### M&A Cross-Org Reporting and Compliance
During an acquisition, the acquiring company synced six high-volume Salesforce objects into Snowflake for cross-org reporting and regulatory compliance within a fixed timeline.
The team configured CRM Analytics SyncOut for all six objects with CDC-based incremental syncs. Audit metadata tables tracked schema changes and record counts across the integration period. They did not write any custom code. Data freshness improved from daily to 15-minute intervals, and the audit metadata tables provided the traceability required for compliance reporting.
## Design Considerations and Failure Modes
### Governor Limit Planning
Sync jobs share the org's API budget. An org running many high-frequency sync jobs against large objects risks exhausting the 15,000 API calls per 24-hour limit. Inventory all sync jobs, estimate API consumption per run, and stagger schedules to distribute load. For objects with low-to-moderate change rates, CDC-based incremental mode can significantly reduce per-run API consumption compared to full sync.
### Snowflake Warehouse Sizing and Cost
SyncIn and SyncOut execute queries and data loads against a Snowflake warehouse, consuming compute credits. For simple SELECT queries, an X-Small or Small warehouse is typically sufficient. For large SyncOut loads, Medium or Large may be required. Configure auto-suspend (5 minutes of inactivity) and auto-resume on the warehouse. Use a dedicated warehouse for production sync jobs to isolate costs and prevent contention with user queries.
### Schema Drift
If a Salesforce field is renamed, removed, or changes API name, the corresponding SyncOut field mapping fails silently or logs errors. Establish a change management process that includes reviewing active sync configurations as part of any Salesforce metadata change. The Snowflake audit tables provide a change history that helps to identify when a drift event occurred.
### Hard-Delete Tracking Dependency
Hard-delete tracking in SyncOut requires CDC to be enabled on the Salesforce object. If CDC isn't enabled, the "Track Hard Deletes" option has no effect. Validate CDC enablement as part of the sync configuration checklist, particularly during initial setup or after org migrations.
### Authentication Failure Modes
The most common failure class is credential expiry or permission loss. Named Credentials must remain valid and the Snowflake service account must retain its warehouse usage grants and table permissions. For OAuth-based setups, token refresh failures can silently stall sync jobs. Monitor the Sync Job Monitor dashboard for authentication error patterns and configure Chatter or email notifications for job failures.
### SyncIn Upsert Key Integrity
SyncIn uses a Salesforce External ID field as the upsert key. If the source Snowflake view contains duplicate values on the key field, the upsert fails for affected records. Enforce uniqueness on the key field in the Snowflake view layer before it reaches the sync configuration.
### Failure Escalation
When sync jobs fail, the platform logs detailed error messages per record in the Sync Job Monitor. Common failure scenarios and their resolutions\:
- **Authentication failure\:** verify Named Credential status and Snowflake account expiry. Re-authenticate OAuth if token refresh has failed.
- **Field mapping error\:** check type compatibility between Snowflake columns and Salesforce fields. Review field-level security for the running user.
- **Governor limit exceeded\:** reduce sync frequency or move to incremental CDC mode to spread API consumption.
- **Snowflake warehouse suspended\:** configure auto-resume on the warehouse or trigger a manual resume before the next scheduled sync.
- **Hard-delete tracking not working\:** confirm CDC is enabled on the object and the "Track Hard Deletes" flag is set in the sync configuration.
## Well-Architected Alignment
CRM Analytics data synchronization aligns with multiple pillars of the Salesforce Well-Architected Framework.
- **Reliability (fault tolerance)\:** The platform manages execution, retry logic, and partial failure handling automatically. Failed records are logged individually in the Sync Job Monitor. Implement record count reconciliation after failures to confirm consistency, supplement with failure notifications, and monitor the Sync Job Monitor for recurring error patterns. CDC-based incremental sync reduces the blast radius of a failed run by limiting the data window in scope.
- **Trust\:** The credential model (Named Credentials, External Credentials, Auth Provider) enforces encrypted storage, automatic token refresh, and centralised management. Least-privilege access on the Snowflake side limits the blast radius of a compromised credential. Field-level security is enforced during sync; users cannot sync fields they are not authorized to access.
- **Resource and Cost Optimization\:** Incremental CDC mode is the primary lever for performance optimization. It reduces API consumption, sync duration, and Snowflake compute cost compared to full sync. Snowflake view pre-filtering further reduces data volume in transit. Warehouse auto-suspend prevents idle compute spend.
- **Operational Excellence\:** The declarative configuration model means sync jobs are defined in metadata, not code. This makes them auditable, reproducible, and manageable without engineering involvement. Built-in monitoring dashboards provide full observability without custom logging infrastructure.
- **Reliability (scalability)\:** The platform handles chunking, pagination, and Bulk API batching automatically. For objects with very high record volumes, incremental CDC mode and off-peak scheduling are the primary architectural levers for maintaining throughput within governor limit constraints.
## Architect's Quick Start
This checklist covers the minimum steps to set up and validate a sync configuration.
**Pre-configuration checklist\:**
- Enable Change Data Capture on all Salesforce objects intended for SyncOut incremental mode (Setup → Change Data Capture).
- Create a dedicated Snowflake service account with a least-privilege role; grant only required table and warehouse permissions.
- Create a Snowflake Security Integration if using OAuth authentication.
- Identify the External ID field on each Salesforce object that SyncIn will use as the upsert key; confirm uniqueness in the source data.
**Connectivity\:**
- Create Auth Provider in Salesforce (Setup → Auth. Providers).
- Create External Credential and link to Auth Provider (Setup → Named Credentials → External Credentials).
- Create Named Credential and link to External Credential (Setup → Named Credentials).
- Grant Named Credential access to relevant Salesforce profiles.
**SyncOut configuration\:**
- Create Snowflake Connection (Setup → Analytics Studio → Data Manager → Connections → Snowflake Connections).
- Create SyncOut Configuration\: source object, target table, sync mode, field mappings, CDC, hard-delete tracking, schedule.
- Start with daily sync; validate that data quality and performance before increasing frequency.
**SyncIn configuration\:**
- Create External Data Source (Setup → Analytics Studio → Data Manager → Connections → Snowflake Connections).
- Create SyncIn Configuration\: source view, target object, External ID field, field mappings, schedule.
- Sync from Snowflake views, not raw tables.
**Validation\:**
- Review Sync Job Monitor after first execution (Setup → Analytics Studio → Data Manager → Sync Job Monitor).
- Query Snowflake audit table to confirm sync metadata was written.
- Validate hard-delete flagging by confirming DEL\_FLAG column is present and populated.
- Compare record counts between source and target.
- Configure failure notifications via Chatter or email.
## Conclusion
Use this pattern when scheduled batch synchronization meets latency requirements, bidirectional data flow is necessary, and reducing engineering dependency on integration operations is a priority.
The Snowflake worked example in this guide illustrates the full lifecycle\: connectivity setup, configuration, execution flow, and validation. The same principles apply to any supported external data platform.
When sub-15-minute latency, complex transformations, or multi-org scenarios are in scope, evaluate Platform Events, Streaming APIs, or MuleSoft as complementary or alternative approaches.
## About the Author
**Yugandhar Bora** is a Software Engineering Architect at Salesforce, specializing in data architecture within the Data & Intelligence Applications platform. He leads Enterprise Architecture Review Board (EARB) initiatives focused on data governance and unified data models, while contributing to automated platform provisioning solutions.
# Trusted Agent Identity for the Agentic Enterprise
As enterprises embrace the agentic paradigm, a new security challenge emerges: **How does end-user identity flow through a network of autonomous AI agents?** In traditional API architectures, a user authenticates once and the application calls backend services on the user’s behalf. The identity chain is short, well-understood, and typically managed within a single trust domain. Agentic architectures, however, feature much longer chains where a single request fans out across various agents, services, and Model Context Protocol (MCP) servers,each potentially crossing service boundaries, trust domains, and even organizational borders. Without a deliberate strategy for identity propagation, enterprises face a choice between security and functionality–a dilemma no architect should have to face.
MuleSoft addresses the complexities of identity propagation with its [**Trusted Agent Identity**](https://www.mulesoft.com/ai/trusted-agent-identity/announcement) feature. This solution utilizes a policy-based, gateway-managed strategy to ensure end-user identity is maintained across various interaction types—including agent-to-agent (A2A) protocols, MCP tool calls, and REST API requests.By centralizing identity management at the Flex Gateway layer through [outbound authentication policies](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory), enterprises can secure their entire agent network without modifying backend services or agents.
This document walks through the identity propagation challenge using a progressive series of scenarios, each introducing additional complexity. Together, these scenarios illustrate why [Trusted Agent Identity](https://www.mulesoft.com/ai/trusted-agent-identity/announcement) is a foundational requirement for any enterprise-scale agent deployment.
## The Identity Challenge in Agentic Architectures
In a conventional application, the identity flow (OAuth JWT flow) is straightforward: The user logs in, receives a token, and the application uses the token to access backend resources. The token is embedded with the user's identity–including who they are and what they’re authorized to do– and travels with every request. The call chain is short, typically one or two hops, and identity propagation is solved.
Agentic architectures, however, feature much longer call chains where a single user request might fan out across various agents, backend services, and Model Context Protocol (MCP) servers.Each request destination constitutes a separate hop. While these challenges–such as multi-hop identity propagation, mixed authorization models, cross-domain trust boundaries–are common in any distributed API setup, what _is_ distinct is how the current ecosystem responds by default.. Today, the dominant pattern for agent-to-agent and agent-to-API communication relies on **client credentials**, **API keys**, or **shared secrets**. This means:
- **User identity is lost by default.** When an agent calls an MCP server or downstream API using client credentials, the request carries the agent’s service identity and not the end user’s. The downstream service has no way to know _which user_ initiated the action, making per-user authorization and audit trails impossible.
- **Mixed authorization needs are ignored.** Not every downstream service requires user-context.While some manage user-specific information like transactions or portfolios, others provide public-facing or system-level data such as reference material or market trends.Because the current standard relies exclusively on client credentials, there is no way to differentiate between these needs or to selectively propagate user identity only when necessary.
- **Cross-domain trust boundaries are unaddressed.** Agents in B2B and regulated scenarios may need to interact with systems governed by entirely separate identity providers (IdPs). For example, an external banking system cannot interpret a corporate single-sign-on (SSO) token, yet it must still receive the user's consent and intent.. Client credentials flow has no mechanism for this.
The result is a gap between the enterprise requirement for user-attributable, least-privilege access and the current ecosystem's reliance on service-level authentication lacking user context. Closing this gap requires a deliberate, layered approach to identity propagation. To illustrate these concepts, the following scenarios utilize **Finport**, a fictional fintech application, to provide practical examples of these architectural patterns.
## Meet Finport \- A Fintech Portfolio Application
Finport is a fictional consumer-facing Fintech portfolio management web application backed by an agentic architecture. An Agent Broker (built using [MuleSoft Agent Broker](https://www.mulesoft.com/ai/agent-broker)) coordinates multiple downstream agents and MCP servers to fulfill user requests.
Finport exposes three core functionalities, each with a distinct identity requirement:
1. **"Show me my portfolio.":** The user requests their personal holdings and transaction history. Because this data is user-specific, the downstream Portfolio Service Agent and Portfolio MCP Server must know _which_ user's data to return and must verify the user is authorized to access it. User identity must be propagated through every hop.
2. **"What are the current market trends?"**: The user requests public market data and asset prices. Because the data is public and doesn’t vary by user, the downstream Market Data Agent and Asset Market MCP Server don’t need, or expect, a user-scoped token. The broker's own service credentials are sufficient.
3. **"Transfer \$5,000 to my external savings account."**: The user initiates a fund transfer to a bank that uses a different IdP(for example, Auth0 instead of Okta). The user's Finport token is meaningless to the bank's system. The user must authenticate directly with the bank (inline within the conversation) before the transfer can proceed.
Each of these functionalities map to a different identity propagation pattern. The following scenarios build progressively from a standard baseline (without agents) through each distinct pattern, illustrating how outbound policies in Flex Gateway address each requirement without modifying the agents or backend services.
## The Starting Point: User Authentication
Before introducing agents, it’s essential to establish the baseline: a user authenticating with a client application and accessing a backend service.
**The flow**:
1. The user opens Finport and is redirected to the IdP’s login page (for example, Okta) .
2. The user authenticates (username, password, SSO, multi-factor authentication (MFA), and any other requirements).
3. The IdP issues a signed JWT access token to the Finport application.
4. Finport now has a user token that represents the user's identity: who they are, what scopes they have been granted, and when the token expires. It can present it to any downstream service on behalf of this user.
**What this establishes**: This process follows the standard OAuth 2.0 architecture pattern. The initial user token, validated by a trusted IdP, serves as the essential foundation for all subsequent operations. Every subsequent scenario builds on this token.
**The ask**: Once authenticated, the user initiates actions such as fund transfers, market analysis, or portfolio reviews. These requests are processed through an Agent Broker and may involve multiple downstream agents or MCP servers. _This raises critical questions: How is the user's identity maintained across these distributed requests? What happens when a downstream service uses a completely different IdP?_
## Scenario 1 Propagating User Identity Through Agents
The user asks the Finport agent to _"Show me my portfolio."_ This interaction triggers a backend chain starting with the **Finport Agent Broker**, built using [MuleSoft Agent Broker](https://www.mulesoft.com/ai/agent-broker). The broker hands off the task to a **Portfolio Service Agent**, which in turn queries a **Portfolio MCP Server**. The user's initial authentication token must now travel through multiple hops to access the requested portfolio records.
### Problem
Passing the original token violates the principle of least privilege, while using a service account loses the user's identity.
The Finport Agent receives the user's token, but it cannot simply forward that same token to the Portfolio Service Agent, as it would violate the principle of least privilege and wouldn’t properly scope the request for the downstream service. Conversely, using a service account results in a total **loss of user identity**. The Portfolio Service Agent and the Portfolio MCP Server would have no way to know _which_ user's portfolio to return, and the audit trail would attribute every action to the broker's service identity rather than the end user.
### Solution
Flex Gateway resolves these identity propagation complexities transparently through its [**Outbound OAuth 2.0 Token Exchange policy**](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo). This solution intercepts outbound requests at every hop in the call chain, exchanging the incoming user token with the IdP for a new credential scoped specifically for the downstream service. The On-Behalf-Of (OBO) policy supports both OAuth 2.0 Token Exchange ([RFC 8693](https://datatracker.ietf.org/doc/html/rfc8693)) and [Microsoft Entra ID On-Behalf-Of](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-on-behalf-of-flow) protocols.
**Key architectural benefit**: This entire process is handled by [Flex Gateway outbound policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo). The broker and agents contain _zero_ authentication logic. Instead, they focus purely on business logic while the gateway layer enforces identity propagation.
**The flow**:
1. The user authenticates with Okta and the Finport application sends a request through Flex Gateway.
2. The broker receives the validated user token and determines the Portfolio Service Agent is needed.
3. Flex Gateway's outbound OBO policy exchanges the user token with the IdP for a token scoped to the Portfolio Service Agent.
4. The Portfolio Service Agent receives a properly scoped token and calls the Portfolio MCP Server.
5. Flex Gateway again exchanges the token, this time scoped for the MCP Server.
6. The Portfolio MCP server returns the user's specific portfolio data.
7. A complete audit trail exists. Every hop is attributable to the original end user.
**Why this matters**: Without OBO token exchange, enterprises must choose between forwarding the original token, which violates least privilege, or using service accounts, which risks losing user identity. The OBO pattern eliminates this tradeoff since the user's identity is preserved at every hop, each token is scoped to its target, and the agents themselves remain completely unaware of the identity mechanics.
## Scenario 2 \- Server-to-Server (S2S): When User Identity Is Not Needed
Not every downstream service requires user context. The user asks the Finport agent, _"What are the current market trends?"_ Unlike the portfolio request in Scenario 1, market trend data is public when it does not vary by user. The downstream **Market Data Agent** and **Asset Market MCP Server** do not need, or expect, a user-scoped token.
### Problem
**Propagating user tokens where they are not needed expands the attack surface.**
If the Finport Agent Broker were to propagate the user's token to the Market Data Agent using the [OBO pattern](#scenario-1-propagating-user-identity-through-agents) from Scenario 1, it would work but would be unnecessary. Propagating user tokens where they are not needed expands the attack surface, creates unnecessary dependencies on the IdP for token exchanges, and violates the principle of least privilege. The Market Data Agent simply needs to know that the request comes from an authorized service, not which _user_ is asking.
### Solution
Flex Gateway’s [Outbound OAuth 2.0 Client Credentials policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth) handles this transparently. Instead of exchanging the user's token, the policy injects the broker's own service credentials via a client credentials grant into the outgoing request. The downstream Market Data Agent receives a properly authenticated service-level token where no user identity is propagated because none is needed.
**Key architectural benefit**: The identity propagation strategy is not one-size-fits-all, rather it’s determined per downstream route based on the nature of the data and the requirements of the target service. Flex Gateway's outbound policies make this configurable per route. The same Finport Agent Broker can participate in both OBO flows (in Scenario 1\) and S2S flows without any code changes. The policy configuration on the egress gateway determines which pattern applies to which downstream call.
**The flow:**
1. The user asks the Finport agent,_"What are the current market trends?"_
2. The broker determines that the Market Data Agent is needed to fulfill the request.
3. Flex Gateway's outbound Client Credentials policy obtains a service-level token using the broker's own credentials (no user token is exchanged or propagated).
4. The Market Data Agent receives a properly authenticated service request and calls the Asset Market MCP Server.
5. The Asset Market MCP Server returns the public market data.
6. No user identity is present in the chain by design because none is needed for this type of data.
**Why this matters**: Flex Gateway's policy-driven framework empowers architects to select the optimal identity model for every interaction, resolving the difficult choice between universal user token propagation—which increases overhead and security risks—and global service account usage, which sacrifices user context and compliance.
## Scenario 3 \- Crossing Trust Boundaries using A2A In-Task Authentication
The most complex identity scenario arises when an agent needs to interact with a system governed by a completely different IdP, one that does not recognize the existing user token.
**The scenario**: The Finport user asks the Finport Agent to _"Transfer \$5,000 to my external savings account."_ This request involves two distinct downstream paths:
1. The **Portfolio Service Agent** (OBO) path to verify the user's holdings
2. The **Transaction Agent → Transaction MCP Server → User's Bank** path to execute the actual transfer
### Problem
The Transaction Agent needs to interact with the user's bank, which uses its own IdP. The user's Okta token from Finport is meaningless to the bank's system, as the bank has no trust relationship with Finport's IdP. Neither the [OBO pattern](#scenario-1-propagating-user-identity-through-agents) (from Scenario 1\) nor the [S2S pattern](#scenario-2---server-to-server-s2s-when-user-identity-is-not-needed) (from Scenario 2\) can solve this. OBO exchanges tokens within the same IdP, and S2S uses service credentials that carry no user identity at all. The bank requires the user to authenticate directly with their own banking credentials, potentially including MFA.
### Solution
The [Outbound A2A In-Task Authorization Code policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-a2a-intask-authorization-code) on Flex Gateway uses a challenge-response mechanism within the agent conversation. If a secondary token is missing when contacting the bank, the policy returns an auth-required challenge. This challenge includes all necessary details—such as endpoints, scopes, and PKCE parameters—for the client to initiate an OAuth 2.0 flow with the bank’s provider.
The Finport app then displays the bank's login inline for direct user authentication. Once completed, the client returns the token in the A2A request. The policy extracts this token for the bank's system and scrubs it from the message body to ensure security.
**Key architectural benefit**: The gateway policy layer orchestrates the entire cross-domain authentication process, ensuring that neither the broker nor the agents ever interact with raw credentials or require knowledge of the bank's IdP. By using this challenge-response framework, users maintain full control: they provide explicit consent to authenticate with external systems, while the resulting token is transmitted securely via the policy layer.
**The flow**:
1. The user asks Finport to initiate a transfer. The request flows through the broker.
2. The broker fans out, using the Portfolio (OBO) to verify holdings, and the Transaction (In-Task) to execute the transfer.
3. The Transaction path triggers an auth-required challenge from the In-Task policy on Flex Gateway.
4. The challenge propagates back to the Finport application, which presents the bank's login flow to the user inline.
5. The user authenticates with their bank, including MFA if required.
6. The bank token is included in the subsequent A2A request. The policy extracts it, sets it in the Authorization header, and forwards the request.
7. The Transaction MCP Server receives the request with the bank's token and executes the transfer.
**Why this matters:** Cross-domain identity is a major challenge in agentic architectures. Without in-task authentication, enterprises must either pre-establish complex trust relationships between every IdPin the network, or ask users to provide banking credentials to an agent. The In-Task pattern solves this by allowing direct user authentication with external providers; the policy manages token mechanics while keeping agents decoupled from external identity domains.
## Gateway-Enforced Identity Propagation
Across all three scenarios, a single architectural principle holds: **Identity propagation is enforced at the gateway layer, not within agents or services**. The agents and MCP servers contain zero authentication logic. Their role is restricted to processing authenticated requests and returning results, while the Flex Gateway outbound policy layer manages all identity-related operations.
This works because Flex Gateway's [outbound authentication policies](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory) intercept traffic at the right point: after the agent makes its routing decision, but before the request reaches the downstream service. The policy transforms the token–whether it’s an [OBO exchange](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo), [client credentials injection](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth), or [in-task challenge-response](https://docs.mulesoft.com/gateway/latest/policies-outbound-a2a-intask-authorization-code)–and forwards a properly authenticated request. The downstream service never knows the difference, therefore the agent never has to care. Authentication logic is centralized at the gateway, not scattered across services. The backend services require no code changes and the same policy configuration can be reused across multiple routes.
This approach is also protocol agnostic. Because the policies operate at the HTTP layer, they apply consistently whether the agent communicates via REST, MCP, A2A, or webhooks. As documented in the [Agent Fabric Deep Dive](https://architect.salesforce.com/docs/architect/fundamentals/guide/mulesoft-agent-fabric-deep-dive), all A2A and MCP traffic is routed through Flex Gateway to ensure that policies are applied on every endpoint, which means identity propagation is enforced uniformly regardless of the communication protocol.
Three composable patterns cover the full spectrum of identity requirements in an agentic architecture:
| Pattern | Policy | User identity | User Interaction | Use Case |
| :----------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- | :------------------- | :------------------------------ | :---------------------------------------------------------- |
| **On-Behalf-Of (OBO)** | [OAuth 2.0 OBO Credential Injection Policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo) | Preserved | None (transparent) | User-specific data within the same trust domain |
| **Server-to-Server (S2S)** | [Outbound OAuth 2.0 Client Credentials](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory) | Not propagated | None | Public data, system-level operations |
| **In-Task Authorization Code** | [Outbound A2A In-Task Authorization Code](https://docs.mulesoft.com/gateway/latest/policies-outbound-a2a-intask-authorization-code) | Primary \+ Secondary | Required (inline authentication | Cross-domain, multi-identity-provider, high-risk operations |
These patterns are not mutually exclusive. As the Finport scenarios show, a single Agent Broker can use OBO for one downstream call, S2S for another, and In-Task for a third. The policy configuration on each outbound route determines which pattern applies. There are no agent code changes and no service modification, only policy.
## Trusted Agent Identity as a Pillar of Agent Governance
The gateway-enforced patterns described above secure individual interactions, but identity propagation isn’t an isolated concern. It’s a foundational layer of the broader MuleSoft Agent Fabric governance model. As described in the [Agent Fabric Deep Dive](https://architect.salesforce.com/docs/architect/fundamentals/guide/mulesoft-agent-fabric-deep-dive), Agent Fabric is built on four pillars: [**Discover, Orchestrate, Govern, and Observe**](https://architect.salesforce.com/docs/architect/fundamentals/guide/mulesoft-agent-fabric-deep-dive#agent-fabric-four-pillars-together), and each one depends on a reliable identity chain to function effectively.
- **Discover**: The [Agent Registry](https://docs.mulesoft.com/general/learning-map-agent-fabric) catalogs agents and their capabilities. Agent metadata including authentication requirements enables brokers to understand which identity patterns each agent expects.
- **Orchestrate**: The Agent Broker coordinates multi-agent workflows. Flex Gateway transparently handles identity transformation at each hop, so the broker can focus on task decomposition and routing.
- **Govern**: All A2A and MCP traffic is routed through Flex Gateway, even if the target system is unsecured, to ensure that policies are applied on every endpoint. Outbound authentication policies are part of the governance layer.
- **Observe**: Agent Visualizer provides real-time observability through a dynamic, interactive map of agent interactions. With user identity preserved at every hop, traces and logs provide user-attributable audit trails across the agent network.
Without trusted identity propagation, governance is incomplete. You can catalog and orchestrate agents, but you cannot ensure they act within the boundaries of the user's authorization. Trusted Agent Identity closes this gap, ensuring that security and user context remain central to agentic workflows.
## Get Started
To implement these patterns:
1. **Understand the Outbound Policy Directory**. Review the complete set of [outbound authentication policies](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory) available for Flex Gateway.
2. **Start with OBO**. The [OAuth 2.0 Token Exchange policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo) addresses the most common identity propagation need: preserving user context across agent hops.
3. **Add In-Task for Cross-Domain Scenarios**: When your agent network crosses trust boundaries, the [A2A In-Task Authorization Code policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-a2a-intask-authorization-code) provides the challenge-response mechanism for obtaining secondary credentials from the user.
4. **Leverage Agent Fabric**. Define your agent network in the [agent-network YAML](https://docs.mulesoft.com/anypoint-code-builder/af-project-files) with policy configurations that specify the identity model per route. The platform handles the rest.
## References
- [MuleSoft Trusted Agent Identity Announcement](https://www.mulesoft.com/ai/trusted-agent-identity/announcement)
- [Delegated Access Control in MuleSoft Agent Fabric](https://blogs.mulesoft.com/news/delegated-access-control-mulesoft-agent-fabric/)
- [Outbound Authentication Policies Directory](https://docs.mulesoft.com/gateway/latest/policies-outbound-directory)
- [Outbound OAuth 2.0 Token Exchange (OBO) Policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-oauth-obo)
- [Outbound A2A In-Task Authorization Code Policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-a2a-intask-authorization-code)
- [Architecting the Agentic Enterprise with MuleSoft](https://architect.salesforce.com/fundamentals/mulesoft-architecting-agentic-enterprise)
- [MuleSoft Agent Fabric Deep Dive](https://architect.salesforce.com/fundamentals/mulesoft-agent-fabric-deep-dive)
- [MuleSoft Agent Fabric Documentation](https://docs.mulesoft.com/agent-fabric/)
- [RFC 8693 — OAuth 2.0 Token Exchange](https://datatracker.ietf.org/doc/html/rfc8693)
_For detailed implementation guidance, refer to the [companion implementation guide](https://blogs.mulesoft.com/dev-guides/identity-propogation-mulesoft-agent-fabric/)._
## About the Authors
Nikhil Aggarwal is a Distinguished Engineer at Salesforce, where he leads architecture for MuleSoft and Salesforce Automation Clouds. Nikhil brings over 18 years of experience delivering large-scale products and is passionate about scalable architecture, intuitive developer experiences, and building high-performing teams. Prior to Salesforce, he led multiple initiatives in Microsoft Power Platform, Dataverse and Office 365 from concept to launch. His work continues to shape how modern enterprises connect systems, automate workflows, and unlock business value in the AI-first era.
Akash Trivedi is a Director of Engineering at Salesforce with over 18 years of experience building scalable, secure, high-performance enterprise systems. He works at the intersection of AI, enterprise architecture, and process intelligence, with a focus on cloud-native platforms and reliable solutions that operate at scale. Prior to Salesforce, he held engineering roles at Microsoft, where he contributed to products including Copilot, Dataverse, and Power Platform.
# About This Whitepaper
**Enterprise Agentic Architecture and Design Patterns** brings structure to the possibilities of multi-agent architectures, identifying and highlighting how capabilities novel to AI agents may be combined to deliver reliable, repeatable, scalable, and manageable agentic solutions. Taking inspiration from “Design Patterns” for Object Oriented programming, we lay out patterns that can be combined and extended to solve the many exciting challenges that prior to agentic technologies lay outside the scope of business systems built on traditional deterministic technologies.
Following discussion of the rationale for multi-agent architectures we introduce numerous agentic patterns, from simple patterns that leverage natural language processing to determine user intent, to multi-agent patterns that provide for separation of concerns between agents, to UX agentic patterns that bring agentic reasoning to the presentation and interaction with systems, information, and content.
## What Will You Get From This Document?
First and foremost you will get a new way of thinking about agents - agents as components, agents as composers, agents as actors, agents as collaborators, and most importantly agents within a larger architecture that act with intent and act within their individual scope of concerns.
You will get the pointers you need to conceive of rich agentic solutions that span user journeys and inform significant agentic experiences, experiences that have never been possible before.
The initial sections of this document provide the rationale for muti-agent architectures. Read these for a better understanding of the challenges and opportunities that multi-agent architectures present.
Following are definitions and descriptions of agentic patterns, from simple to complex, covering patterns that support interactions, patterns for specialist agents, patterns for background operations, and long-running patterns. Each pattern includes a diagram of the key components that realize the pattern, plus recommendations for usage and representative use cases.
Lastly, the appendix includes examples of how these patterns are combined into holistic agentic solutions supporting a larger agentic experience, for example, to support Customer Service or Brokered Sales. Reference this section to see how a rich agentic experience leverages decomposition and separation of concerns at the agent and action level to drive reuse at the interaction level, with shared agents supporting both internal and external constituents, in both assistive and autonomous modes.
## 1. Multi-Agent System Architecture
As enterprise architects integrate Generative AI into their ecosystems, they must address a common set of design questions:
- How many agents are required?
- How will agents interoperate?
- What’s the division of labor between agents and humans?
- How are these components assembled into a coherent system?
This document presents a pattern-based methodology for designing and building agentic solutions.
_Monolithic_ agents are the starting point for most agentic solutions. Agents—and more specifically, Agentforce agents—are capable performers across a range of topics. For common use cases, start with a single agent.
As your organization grows, multi-agent architectures are the preferred approach. _Multi-agent architecture_ enables greater scale, control, and flexibility compared to monolithic, single-agent systems.
Multi-agent architecture provides these key benefits:
- **Increased Performance & Complexity Breakdown**: A system of multiple, specialized agents provides increased capabilities and simplifies instruction adherence.
- **Modularity & Extensibility**:Individual agents can be added, replaced, modified, and tested with greater ease, which promotes agility.
- **Resilience & Fault Tolerance**: The failure of a single component doesn’t compromise the entire system, which leads to better overall resilience.
- **Decentralized Governance**: Troubleshooting and management can be isolated to specific agents and their corresponding applications, which simplifies maintenance and oversight.
## 2. Core Architectural Principles
Rationalizing a multi-agent architecture starts with projecting core architectural principles onto the capabilities and structure of agents. The resulting multi-agent architectures are then a manifestation of core system design and system architecture principles that are aligned with the unique “grain” of AI technologies.
Key principles that drive this architecture include:
- Manage complexity through decomposition
- Improve resilience and reduce brittleness through decoupling
- Improve dependability and efficiency through code reuse
- Improve agent reliability by limiting any one agent’s scope of concerns
- Improve system maintenance and evolution through modularity and extensibility
- Simplify agent management and accountability though specialization
Unlike more primitive agentic architectures (for example, those that focus on LLMs as the core architectural construct), _Agentforce was designed for multi-agent orchestration from its inception_. Multi-agent orchestration underlies the Atlas Reasoning engine and agentic reasoning to create dynamic, effective programming paths within an agentic response to dramatically expand the ability to deliver a broad, deep agentic augmentation to the user experience (UX).
Within Agentforce this type of coordination is enabled by these key open, interoperable protocols and Salesforce Products:
- **Agentforce** provide an Agent sub-system to encapsulate all of the key elements of an agent: topics, instructions, actions, guardrails, context, invocations, outputs, execution details, logs, etc.
- **Actions**: provide hooks to access data, call flows, invoke external systems, and call other agents.
- **Data 360**: provides a data virtualization layer to bring specific, individualized context to the agent (leveraging Data 360’s unified profile and key chain to pull specific information from across the enterprise).
And for agents across the enterprise or to access agents or resources, we support:
- **Model Context Protocol (MCP)**: is a secure communication layer that connects agents to enterprise tools, data, and knowledge to ensure contextual accuracy.
- **Agent-to-Agent (A2A) Protocol**: is a standardized handshake for inter-agent delegation that enables secure, governed coordination across systems, orgs, and vendors.
These principles provide the foundation for building a scalable, governable system of orchestrated intelligence.
### Additional Considerations
Robust agentic solutions require clear approaches to the non-functional requirements that underpin effective technology delivery:
- Security and Governance (Identity and Access Management, Data Privacy, Data Security, and Threat Modeling).
- Observability & Monitoring (Distributed tracing, Centralized Logging, Metrics, and Dashboards).
- Operationalization and Lifecycle Management (Specification, Test Case Generation, Testing, Feedback, Continual Learning, Deprecation).
These are key architectural considerations for building Enterprise Agentic solutions that aren’t covered in this whitepaper; however, they will be addressed in future publications.
## 3. Enterprise Agent Taxonomy
To manage an enterprise-wide agentic landscape, architects must classify agents through two complementary lenses: technical function and business impact.
### 3.1 Functional Role Classification
This taxonomy categorizes the functional roles that agents may assume within an architecture.
- **Channel/UX Roles**: Define the modality of interaction (for example, Headless, Prompt, Chats and Messages, or AI-Managed Workspaces).
- **Specialist Roles**: Encapsulate deep-domain knowledge (for example, Domain Expert, Knowledge Minion, Assistant, or Planner).
- **Utility Service Roles**: Perform discrete, transactional tasks (for example, Generation, Summarization, Transformation, or Configuration).
- **Maintenance & Proactive Service Roles**: Focus on data health and quality (for example, Curation, Conformation, Data Quality, or Data Enrichment).
- **Long-Running Roles**: Manage processes over extended periods of time (for example, Concierge, Project Manager, Nurturer, or Watcher/Alerter).
## 4. The Agentic Map Template
To facilitate clear design and communication, the **Agentic Map** is the standard template to describe agentic solutions. It defines key entities, systems, and interactions within a specific design pattern.
Here are the Agentic Map Template Components:
- **User Layers** define the human actors in the system (for example, Customers, Authenticated Employees (SF-Users), and Non-Authenticated Employees).
- **Agent Layers** describe required agents, exhibited patterns, relationships with one another, and instructions that are used to actualize specific patterns.
- **Context/Actions** are the resources, capabilities, or actions that the agent manages or accesses.
- **Sources** are the underlying data, applications, knowledge bases, and other systems that the agents connect to.
Appendices A and B illustrate system-level agentic patterns by demonstrating their composition within the Agentic Map Template swimlanes.
## 5. Agentic Pattern Frameworks
At Salesforce, we use a library of agent patterns to organize and deliver reliable, predictable agentic solutions. These patterns are our blueprints for solving common architectural problems.
They’re grouped into four primary categories:
- **Interaction Patterns**: Focus on agentic engagement and user experience (UX).
- **Specialist/Worker Patterns**: Encapsulate deep knowledge or specific skills within a particular domain.
- **Utility & Data Management Patterns**: Perform specific, often repeatable tasks that support other agents or processes.
- **Long-Running Patterns**: Manage processes and workflows that occur over extended periods, involving multiple steps.
The following sections detail key patterns from each category. Each pattern description provides an **Overview**, **Output Type**, **Pattern Use Guidance**, **Representative Use Cases**, and a **Solution Diagram**, as well as mapping to the **Salesforce Agentic Maturity Rubric**.
## 6. Interaction Patterns
_Interaction patterns_ are foundational designs that focus on agentic engagement and user experience.
### Greeter Pattern
- **Overview**: The _Greeter pattern_ is a simple, easy-to-implement pattern that uses natural language to determine user intent. Then, it routes the user to the appropriate human agent.
- **Output Type**: Hand-off/Escalate to the next resource.
- **Business Value**: Facilitate a seamless, efficient first contact for customers while maximizing intent resolution and context collection for service providers.
- **Pattern Use Guidance**: Configure the agent as the primary engagement resource for brand channels. Provide instructions on brand, products, and services that are paired with routing instructions based on user intent. The agent collects and summarizes intent to deliver a warm handoff.
- **Representative Use Case**: Imagine a web page that uses a chat bot to present a menu of options where users must click through all of the options before they’re routed to a human. To improve back-office productivity and efficiency, chatbots often use complex, complicated work paths and interactions. This leads to a “fill, choose, and click” fatigue scenario for customers that often results in frustration if their context lies outside of the available menu options. By replacing traditional chatbots with the _Agentic Front Door_—which uses natural language interactions—it eases the burden and provides a human-like interaction.
- **Agentforce Recipe**:
- Agentforce Service Agent: [Assemble a Service Agent with Agentforce Builder](https://trailhead.salesforce.com/content/learn/modules/quick-start-assemble-a-service-agent-with-agentforce-builder)
- The packaged Service Agent has configurable transfer capabilities that support transfer:
- To human agents
- To AI agents
- To external agents
- Industry specific patterns that contain code examples
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 1 (or Level 0 if you use the Out-of-the-Box Service Agent with built in transfer and escalation)
### Operator Pattern
- **Overview**: The _Operator pattern_ builds on the _Greeter pattern_ by routing requests to the appropriate specialist agent or human and negotiating intent (if needed).
- **Output Type**: Hand-off/Transfer to the next resource.
- **Pattern Use Guidance**: Pair brand- and service-specific instructions with instructions on where to send the user based on intent. Define escalation resources, which may be humans or other agents.
- **Representative Use Case**: Use the _Agentic Front Door_ for scenarios where there’s a high degree of specialization among human or AI representatives.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
### Orchestrator Pattern
- **Overview**: The _Orchestrator pattern_ manages an AI Agent "Swarm." When it receives a user request, it passes the utterance to one or more specialist agents, and then aggregates the responses for the user. Unlike the _Operator pattern_, it remains the first point of contact (POC).
- **Output Type**: Collate and prepare response(s) from worker agents.
- **Pattern Use Guidance**: Configured as the primary engager. Provide instructions for each supporting worker agent (for example, a Prioritizer or Domain SME) that allows the orchestrator to relay utterances to them.
- **Representative Use Case**: Use the _Orchestrator Pattern_ as the agentic front door to assist customers who may need to discuss multiple topics per conversation, which requires multi-agent solutions and consistent interactions. In a multi-system architecture, consider the _Orchestrator Pattern_ to coordinate responses across systems and with the collaboration of external agents.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 3
### Listener/Feed Pattern
- **Overview**: The _Listener/Feed pattern_ surfaces context and insights during the flow of a conversation. The _Listener_ is triggered during each conversational turn to find and display relevant information for an employee.
- **Output Type**: Provide relevant context based on conversation, which can be formatted for effect (for example, making comparisons or highlighting key points).
- **Pattern Use Guidance**: Attach the Listener to a turn-based channel (for example, chat, voice, or SMS). Define topics for each subject area. The agent consumes the transcript, identifies topics, and invokes actions to search for and post relevant content to a running feed for the employee.
- **Representative Use Case**: Use the _Universal Assistant_ to assist Customer Service or Sales representatives.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 3
### Workspace (Radar O'Reilly) Pattern
- **Overview**: The _Workspace (Radar O’Reilly) pattern_ manages a responsive single-pane-of-glass UX in the flow of a conversation. It processes each utterance to update portions of the UX with relevant content.
- **Output Type**: Provide relevant context that’s located in a portlet within a larger single-pane-of-glass view.
- **Pattern Use Guidance**: An _Orchestrator_ agent passes utterances to a suite of _Topic_ agents. Each Topic agent assesses the statement to determine whether a UX update is necessary. If so, it pushes dynamic updates to the corresponding LWC.
- **Representative Use Case**: This functions like an advanced agentic front door.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 3
## 7. Specialist Patterns
_Specialist patterns_ encapsulate deep knowledge or skills in a particular domain, and they’re typically orchestrated by _Interaction patterns_.
### Answerbot Pattern
- **Overview**: The _Answerbot pattern_ is an effective pattern for self-service that uses GenAI to determine natural language for knowledge retrieval, not just keywords.
- **Output Type**: Summarized knowledge and references/citations to supporting materials.
- **Pattern Use Guidance**: Organize and ingest reliable source materials (for example, Knowledge Stores or FAQs) to configure the agent. Position the agent on corporate websites or within internal portals. Monitor questions to identify and address knowledge gaps.
- **Representative Use Case**: Facilitating natural language searches on a corporate website, interacting with an HR Benefits Bot, and providing self-service components for all constituents.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 1
### Domain SME Pattern
- **Overview**: The _Domain SME pattern_ is a foundational pattern that provides a natural language front end for a business domain (for example, Orders or Claims).
- **Output Type**: Provide relevant content, topics, data, and formatted information about the domain.
- **Pattern Use Guidance**: Use this pattern to encapsulate a subject or business domain. Configure the agent with the ability to perform appropriate CRUD operations. Make these agents available through [_Interaction patterns_](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#6-interaction-patterns) (for example, - Orchestrator or Listener).
- **Representative Use Case**: Gatekeeping a business data domain, providing an "Order Agent" or "Inventory Agent," and providing an agentic interface for a business domain.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
### Interrogator Pattern
- **Overview**: The _Interrogator pattern_ is an SME agent that can be interrogated on a topic to assemble context from multiple sources to answer questions. The key agentic capability leveraged is the ability to pull context and connect concepts across a body of content, in the way a human would after reading and internalizing the content. This pattern mitigates the need for "swivel-chair integration."
- **Output Type**: Provide answers to questions.
- **Pattern Use Guidance**: It’s often configured as a console widget that’s wired to the user's current context so they can ask questions directly. It’s also used in conjunction with knowledge resources like FAQs, Policies, and Product catalogs. Pair the _Interrogator pattern_ with standard prompts to scale common answers to common questions.
- **Representative Use Case**: Use as a contract assistant agent; Benefit inquiries assistant, or specialist worker agent in multi-agent patterns (for example, Listener or Workspace).
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
### Prioritizer Pattern
- **Overview**: The _Prioritizer pattern_ is used to order a set of tasks or work objects based on a defined objective. It leverages GenAI for qualitative analysis, unstructured data analysis, or integrative analysis across multiple data domains.
- **Output Type**: Provide generative insight.
- **Pattern Use Guidance**: Use natural language to describe the desired qualities for prioritization. Ground the agent using a set of selectable options. Combine with the Listener pattern to create a responsive "Next Best Action" in the flow of work.
- **Representative Use Case**: Use as a _Next Best Action_ generator or a specialist worker agent in long-running or multi-agent patterns.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
## 8. Utility and Data Patterns
_Utility patterns_ perform specific, repeatable tasks that support other agents or processes.
### Generator Pattern
- **Overview**: The _Generator pattern_ is a basic pattern for creating new content (for example, case summaries or email drafts) from existing inputs and standards. It’s often implemented as a prompt and may be embedded within other agents.
- **Output Type**: Provide generated content that conforms to the requested format and intent.
- **Pattern Use Guidance**: The _Generator pattern_ can be used within most other patterns or as a standalone. Context can be provided through the request, hydration during execution, or additional enrichment steps.
- **Representative Use Case**: Provide case summaries, email drafts, knowledge articles, or proposals/responses to QBRs.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 1
### Data Steward Pattern
- **Overview**: The _Data Steward pattern_ is an autonomous, background pattern that introduces an agentic step into data operations to ensure consistent data quality, conformance, and enrichment.
- **Output Type**: Provide updated record and data fields prior to saving.
- **Pattern Use Guidance**: Embed data quality at the point of data creation by adding data stewards that record trigger flows prior to saving data. Helps to ensure consistent application of categorization, summary, and state data.
- **Representative Use Case**: Ensuring consistent "Pizza-Tracker" style updates, enriching account data, and eliminating mismatched zip codes and addresses.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
### Zen Data Gardener Pattern
- **Overview**: The _Zen Data Gardener pattern_ is a scheduled background pattern that’s used to groom and standardize data, leveraging low-cost reasoning to validate, enrich, and conform data across otherwise unconnected data domains.
- **Output Type**: Provide updated records and/or data management tasks.
- **Pattern Use Guidance**: Use the pattern to enable regular, periodic data review and validation. For slow-changing data, schedule the agent on a slow cadence (for example, monthly). Combine with the [Data Steward Pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#data-steward-pattern) to provide prospective and retrospective data quality operations.
- **Representative Use Case**: Ensuring alignment between sold benefits and the claims system, as well as periodic validation of broker licenses against national registries.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 4
### Configurer Pattern
- **Overview**: The _Configurer pattern_ generates configuration artifacts (for example, SQL/SOQL, JSON, and CSVs) from natural language requirements. It can also run in reverse to validate an existing configuration against requirements.
- **Output Type**: Provide updated records, data management tasks, or build issues/errors for corrections.
- **Pattern Use Guidance**: Ground the agent using specific standards, guidelines, or examples. Configure build requirements using sources like contracts or product specs. Connect the _Configurer pattern_ to the target system to push the generated configuration.
- **Representative Use Case**: Generating product configuration records for health insurance products and validating contract/payment terms for health providers.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 4
### Judge & Jury Pattern
- **Overview**: The _Judge & Jury pattern_ is designed to minimize hallucinations by using an ensemble of "juror" agents and a "judge" agent that assesses the congruence of responses to ensure they’re materially consistent and grounded.
- The _Ensemble Approach_ is embedded within Agentforce and the Atlas Reasoning engine to address response veracity and relevancy. The _Judge and Jury pattern_ builds on this capability when high levels of accuracy are essential.
- The combination of _Data Grounding_ (for example, “find your answer in these records/documents”) and _Prompt Engineering_ (for example, “only return an answer if it’s found in these records” or “validate your answer against this external source”) are also effective ways to minimize hallucinations.
- **Output Type**: Provide generative insight.
- **Pattern Use Guidance**: Use when there’s a strong need for consistent and grounded generative outputs. A _Judge agent_ compiles a grounded prompt and passes it to two or more _Juror agents_, and then the Judge assesses the responses. For best results, use different models (for example, one from OpenAI and another from Anthropic), for each Juror agent.
- **Representative Use Case**: Provide high-fidelity, factually-grounded responses to minimize hallucinations.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
### Model of Models Pattern
- **Overview**: The _Model of Models pattern_ leverages multiple expert agents to generate a broad swath of perspectives, and then it extracts the consensus. Unlike the [Judge & Jury pattern](/docs/architect/fundamentals/guide/enterprise-agentic-architecture#judge--jury-pattern), this pattern embraces multiple points of view to enhance richness.
- This pattern may also be called the Panel of Experts pattern when there are expert models with different Points of View (POV) that it may be useful to tap.
- Unlike the Judge and Jury pattern where the intent is to ensure that the agentic response converges on a commonly accessible “truth,” the _Model of Models pattern_ extends the scope of the response by leveraging diversity in the agentic environment.
- This pattern assumes that there are additional agents that have a distinct POV. For example, in a multi-org, multi-agent environment, or an environment with multiple vendor-supplied agents across tech stacks, the _Model of Models pattern_ provides a structure for integrating multiple POVs.
- When considering this pattern also consider other, often more lightweight approaches:
- Instead of defining multiple expert agents, specify multiple prompts and have the system work as an ensemble of prompts.
- Leverage “grounding” through actions that access contextually appropriate data.
- **Output Type**: Provide generative insight.
- **Pattern Use Guidance**: An _Aggregator_ agent's role is to form and return a rich POV based on the key concepts that the Model agents returned. Model Agents determine a response based on their unique POV.
- **Representative Use Case**: Use in situations that may benefit from bringing together disparate viewpoints to add to the quality of the responses.
For example, a multi-system agentic environment where privileged agents (for example, an _ERP agent_) may have a POV that’s valuable and otherwise inaccessible.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 2
## 9. Long-Running Process Patterns
_Long-Running Process patterns_ manage processes that occur over extended periods and involve multiple steps and actors.
### Project Manager Pattern
- **Overview**: The _Project Manager pattern_ is a complex pattern that oversees a long-running project. It coordinates activities, tracks completion, notifies users, and represents project status to stakeholders.
- **Output Type**: There are multiple outputs (for example, cases, tasks, status updates, and notifications).
- **Pattern Use Guidance**: Use as an umbrella pattern to support regular, repeated, multi-step activities. The _Project Manager pattern_ takes an input template/outline of a project—includingtasks, roles, and dependencies—then it instantiates cases and activities and assigns them to users.
- **Representative Use Case**: Use for account installation management and enterprise sales engagement.
- **Diagram**:
- **Salesforce Agentic Maturity**: Level 4
## 10. Enterprise Orchestration Archetypes
While patterns describe agent roles, _orchestration archetypes_ define the system-level blueprints for how a fleet of agents collaborate. These archetypes clarify the roles of _Agentforce_ as the orchestration brain and _MuleSoft_ as the universal connector and adapter.
**Archetype 1: SOMA (Single Org, Multiple Agents)**
- **Definition**: Multiple agents collaborate within one Salesforce org that uses shared governance and data.
- **Architectural Flow**: In Agentforce, a _Supervisor agent_ acts as a single front door, routing requests to _Specialist agents_ within the org. For external functionality, agents use the _Agentforce MCP Client_ with MuleSoft acting as an MCP-wrapper for non-MCP-enabled APIs.
- **Key Considerations**: This pattern centralizes the orchestration logic in Salesforce (similar to CRM context and Data 360) to preserve unified governance, identity, permissions, and observability.
**Archetype 2: MOMA (Multi Org, Multiple Agents)**
- **Definition**: Agents collaborate across multiple Salesforce orgs, which requires secure coordination across data and permission boundaries.
- **Architectural Flow**: A _Supervisor agent_ in one org delegates a task to an agent in another org via the standardized _agent-to-agent (A2A)_ protocol. This handshake ensures org-level trust, user identity flow, and shared conversation context.
- **Key Considerations**: This pattern preserves org autonomy while enabling enterprise-wide workflows, which provides a foundation for coherent agentic operations in complex, multi-org estates.
**Archetype 3: Multi-Vendor A2A (Salesforce-led Orchestration)**
- **Definition**: A _Supervisor agent_ in Salesforce coordinates work across a mix of Salesforce-native agents and agents from other vendors (for example, Google/Vertex or LangGraph) via the A2A protocol.
- **Architectural Flow**: The _Supervisor agent_ processes the request and orchestrates a plan, invoking internal and external vendor agents via the A2A protocol. For external systems that aren’t A2A-capable, _MuleSoft_ can expose a "lightweight agent facade" that wraps the existing tool and communicates with the A2A.
- **Key Considerations**: This archetype keeps the orchestration brain close to CRM and Data 360 by using A2A to produce clean, governable composition without a separate orchestration tier.
**Archetype 4: Multi-Vendor A2A (MuleSoft-led Orchestration)**
- **Definition**: Orchestration is initiated from a non-Salesforce entry point, which requires a neutral, external orchestrator to perform reasoning and routing.
- **Architectural Flow**: A _UI agent_ in an external system forwards the request to an orchestration service (conceptualized as _MuleSoft Conductor_), which interprets intent and plans the task. The conductor then uses the A2A to route calls to vendor agents, including Agentforce agents for CRM or service actions.
- **Key Considerations**: This pattern is for non-Salesforce entry points where a neutral orchestrator is architecturally preferable. It keeps the UX in the domain system while centralizing reasoning, governance, policy, and observability in MuleSoft.
## 11. Solution Assembly: Composing Patterns
These individual patterns and orchestration archetypes are architectural building blocks that are designed to be composed into end-to-end solutions. The Agentic Solution Map is used to visualize how these components are wired together.
- A _Member Services Solution_ for a healthcare provider is a standard implementation of the SOMA archetype. It uses an Answerbot for anonymous users, an _Orchestrator_ for authenticated members, and multiple _Domain SME agents_ (for example, Case, Claims, and Benefits) to handle specific requests.
- A _B2C Broker Portal_ is a complex composition that uses a Portal _Orchestrator_ agent to invoke a long-running _Project Manager agent_ for an RFP process, which in turn, uses _Headless_, _Data Steward_, and _Interrogator agents_ for back-office data operations.
## 12. Conclusion
An agentic design pattern methodology provides the architectural discipline required to build robust, scalable, and maintainable enterprise AI systems. By breaking down complexity and promoting modularity, these patterns enable architects to deliver reliable, predictable agentic solutions.
The choice of orchestration archetype is a strategic decision based on where users work, where context resides, and how the enterprise governs the interaction between humans, agents, and systems. By understanding the distinction between building agents and orchestrating them—and by leveraging open protocols like _MCP_ and _A2A_—architects can move beyond creating isolated bots to engineering a cohesive, governed, and distributed enterprise-reasoning system. This approach provides a shared language and a set of reusable blueprints to build a sustainable agentic architecture.
## Appendix: Solution Maps and System Architectures
This appendix provides concrete examples of how agentic patterns are composed into system-level solutions.
### Appendix A: Basic Pattern Composition Example
This diagram illustrates how five foundational patterns can be wired together to create a common customer service workflow.
1. **Answerbot**: An anonymous user asks a question, which is handled by a knowledge-based agent.
2. **Operator**: An employee's question is triaged by an Operator, which fields the conversation and hands it off to a more specialized agent.
3. **Orchestrator**: An authenticated user (SF User) engages with an Orchestrator that coordinates multiple agents to handle a potentially multi-faceted inquiry.
4. **Domain SME**: Specialist agents (for example, HR Agents or Benefits Agents) are invoked by the orchestrator to perform subject matter updates and retrieve specific data.
5. **Generator**: Utility agents are used to summarize account details or wrap up a case after the interaction is complete.
### Appendix B: Agentic Solution Map - Member Services
This solution map details an agentic architecture for a Member Services use case, demonstrating the composition of multiple patterns.
- **User Profiles**: The solution serves three distinct user types: Anonymous User, Authenticated Member, and SF User (for example, a human CSR).
- **Interaction Patterns**: An _Answerbot_ handles anonymous "Find-A-Doc" queries, while an Orchestrator (Agentic Front Door) manages authenticated user inquiries. A _Listener/Feed pattern_ assists the SF User.
- **Domain Agent Reuse**: Specialized _Domain SME agents_ (for example, Case Agent, Claims Agent, or Benefits Agent) are reused across different interaction flows.
- **Autonomous & Assistive**: The system combines _autonomous agents_ (to direct user interaction) and _assistive agents_ (to augment human CSRs).
- **Data Sources**: The architecture integrates a mix of public and enterprise data sources, with extensive use of _Data 360_ and _MuleSoft_ for connectivity.
### Appendix C: System Architecture - Contact Center
This diagram illustrates a logical architecture for an Assistive AI solution in a Contact Center, organized into functional layers.
- **Orchestrator Agents**: Manage user experiences for different personas (for example, Anonymous, External Member, or CSR) and orchestrate the overall interaction flow.
- **Worker Agents**: _Multiple SME agents_ are focused on core business domains like Knowledge, Case/Claims/Benefits, and Provider Directory. A _Next Best Action_ agent is also included.
- **Utility Agents**: Perform specific, reusable tasks such as Translation, Case Wrap-Up, and Call Summary.
Integration & Core Systems: The entire agentic system is connected via a cross-platform integration layer to unstructured data resources, structured data resources, and core enterprise systems.
- **Governance**: A governance layer provides observability, evaluation, and management for the LLMs/SLMs that are used by the agents.
### Appendix D: Agentic Solution Map - Broker Portal
This solution map details a complex, long-running agentic interaction for a B2B health insurance broker portal. The model includes a _Portal agent_ (_Orchestrator_) that facilitates the broker's journey through multiple steps (for example, submitting an RFP and receiving a proposal). This orchestrator invokes a _Project Manager_ agent, which in turn, coordinates several headless agents for back-office data quality and transformations, such as an RFP Extractor, Census Transform, and Data Steward.
### Appendix E: System Architecture - B2C Broker Agents
This diagram shows a logical architecture for a B2C Broker solution, which demonstrates a similar layered approach to the Contact Center. It includes _Orchestrator agents_ for different user personas, reusable _Worker agents_ for key domains (for example, Knowledge, Member Services, or Commissions), and _Utility agents_ for specific functions like translation and summarization.
### Appendix F: System Architecture - Provider Contracting
This diagram shows a logical architecture for a Provider Contracting solution. _Orchestrator_ agents manage complete interactions, _Worker agents_ manage specific intents within a domain (for example, a Contracting SME agent), and _Utility_ agents perform discrete tasks like comparing contracts or generating insights.
### Appendix G: Interaction Patterns Summary Table
The following table summarizes several key interaction patterns, typical user experiences, and primary architectural purposes.
Pattern
User Experience (UX)
Purpose
Greeter
Turn-by-turn text (Chat, Voice, SMS, and so on) that ends with the responder transferring the interaction to a human
This is a simple pattern that’s used to determine user intent, and then route the user to the appropriate human agent.
Operator
Turn-by-turn text (Chat, Voice, SMS, and so on) that ends with the responder transferring the interaction to a human or Specialist agent
This is used to route requests to appropriate hybrid agents. Building upon the Greeter, it’s a simple pattern that negotiates intent, and then transfers the interaction to a specialized human or AI agent.
Orchestrator
Turn-by-turn text (Chat, Voice, SMS, and so on) with the responder collecting and aggregating Specialist agent responses and delivering it to the UX
This is used to coordinate a managed AI-Agent “Swarm” that responds to a conversation as it progresses. An Orchestrator agent passes each turn's text through to one or more specialist agents, and then it aggregates the responses from each one.
Answerbot
Prompt and response
This is a natural language interface that uses knowledge resources, FAQs, policies, and so on to form responses.
Interrogator
Prompt and response
This is a natural language interface that’s used to ask questions in a specific domain or area.
Listener / Feed
Turn-by-turn text (Chat, Voice, SMS, and so on) that ends with the Orchestrator pattern feeding a Linear Feed
This is used to surface context and insights in the flow of conversation.
Workspace (Radar O'Reilly)
Turn-by-turn text (Chat, Voice, SMS, and so on) that ends with an adaptive, single-pane-of-glass heads-up-display
This is used to manage a responsive, single-pane-of-glass UX in the flow of conversation.
## About the Authors
David Harshbarger is a successful entrepreneur and technology leader who has worked for many leading software companies, architecting solutions that align the grain of architecture with the grain of the business so that technologists are working with, not against, their enabling technology. Today, David works as a Principal Enterprise Architect at Salesforce, supporting Health & Life Sciences.
Chacha Choudhury is a highly accomplished and visionary IT CTO/Chief Architect with decades of experience, currently serving as a Principal Enterprise Architect leading the Salesforce Architecture Program and Global Community of Architects. He is recognized for his expertise in setting enterprise-wide technology strategy, driving architecture modernization, and pioneering innovative solutions, including Generative AI and Agentic AI applications.
# Get Started with Additional Resources
This section provides an understanding of how to apply best practices and design patterns across Salesforce platform capabilities, including Flows, Apex, and related tools.
## Step-Based Async Framework
## Additional Resources
[Step-Based Aysnc Framework](/docs/architect/fundamentals/guide/step-based-async-framework) is a Processing Framework for running asynchronous jobs with an arbitrary number of steps. This article covers three essential areas that every architect must master:
- **Scheduling and Invocation**: Uses Scheduled Flow and Invocable Apex to orchestrate, trigger, and control execution with environment checks and fault handling.
- **Step Design and Flexibility**: Defines a reusable step interface with support for Apex, Flow, cursor-based processing, and configurable patterns like feature flags and no-op steps.
- **Orchestration and Execution Engine**: Leverages a Step Processor to sequence, execute, retry, and manage steps with centralized logging and lifecycle control.
This article provides s scalable, step-based asynchronous framework for Salesforce that breaks complex processes into modular, independently executable steps with centralized orchestration, logging, and high-volume performance.
## Salesforce Data Synchronization
[Step-Based Aysnc Framework](/docs/architect/fundamentals/guide/data-synchronization) is the core capability part of Salesfore CRM analytics.It is the ecosystem's native business intelligence platform for interactive dashboards and AI-driven insights—facilitates seamless bidirectional data movement with external systems through two core capabilities: SyncOut and SyncIn. CRM Analytics SyncOut pushes Salesforce object data to external platforms, supporting both full and incremental Change Data Capture (CDC) modes alongside built-in hard-delete tracking to maintain absolute data integrity downstream. Completing the loop, CRM Analytics SyncIn pulls external data back into Salesforce objects, leveraging Bulk API 2.0 to reliably and efficiently ingest high-volume datasets for immediate operational use. This document explains how the pattern works, when to use it, and how to get started, using Snowflake as a concrete worked example.
## Salesforce Data Virtualization
[Step-Based Aysnc Framework](/docs/architect/fundamentals/guide/data-virtualization) is an integration architecture pattern that enables Salesforce to query data directly from external systems at runtime, without copying or replicating that data into Salesforce storage.Instead of moving data into Salesforce, it enables Salesforce to query data directly at its source, at runtime, with no replication. Users see live external data through standard Salesforce interfaces. The data never leaves its authoritative home. This document explains how the pattern works, when to use it, and how to get started, using Snowflake as a concrete worked example
## Architectural Patterns for Field Service: Optimizing Contractor Sharing and Visibility at Scale
[Architectural Patterns for Field Service: Optimizing Contractor Sharing and Visibility at Scale](/docs/architect/fundamentals/guide/field-service-contractor-sharing-patterns) compares two architectural patterns for managing external contractor networks in Salesforce Field Service: **territory-based sharing** and **account-based sharing**. This guide covers:
- **Contractor Personas**: Named Contractors, Contractor Companies, and Occasional Workers, and how each persona shapes the appropriate sharing architecture.
- **Territory-Based Sharing**: Using dedicated Service Territories as the primary security boundary, and the scalability trade-offs of this approach at scale.
- **Account-Based Sharing**: Decoupling visibility from geography using criteria-based sharing rules, enabling a unified resource pool across contractors and internal technicians.
- **Decision Framework**: A decision tree and comparison matrix for choosing the right pattern based on competitive overlap and geographical exclusivity.
Helps architects balance platform security with scheduling performance while building a foundation that scales with Agentforce and Data Cloud.
# Get Started with Agentforce
This section provides practical guidance for building intelligent AI agents on Salesforce’s Agentforce platform—covering agent patterns, implementation, enterprise architecture, and the full development lifecycle to help you design and deliver effective agentic solutions.
## Agentic Patterns and Implementation with Agentforce
[Agentic Patterns and Implementation with Agentforce](/docs/architect/fundamentals/guide/agentic-patterns) provides a technical exploration of the primary types of AI agents and how to build them. This whitepaper covers:
- **Agent Taxonomy**: The five core AI agent types—Conversational, Proactive, Ambient, Autonomous, and Collaborative—mapped to use case requirements.
- **CRM Use Cases**: Customer Relationship Management scenarios for each agent type, with real-world business process examples.
- **Architectural Blueprints**: Agentforce platform reference architectures, with technical examples across Flow, Apex, Data 360, Agent-to-Agent (A2A) communication, and Model Context Protocol (MCP) interoperability.
- **Implementation Guidance**: The shift from direct manipulation to goal-oriented delegation, with patterns for agents capable of understanding, reasoning, and acting on users’ behalf.
This whitepaper is for developers and architects who want to understand the different types of agents available and how to implement them effectively on the Agentforce platform.
## Enterprise Agentic Architecture and Design Patterns
[Enterprise Agentic Architecture and Design Patterns](/docs/architect/fundamentals/guide/enterprise-agentic-architecture) brings structure to multi-agent architectures using a pattern-based methodology. This document provides:
- **Design Pattern Approach**: Design pattern principles for agentic solutions, aligned with object-oriented pattern concepts and focused on reliable, repeatable, scalable, and manageable architectures.
- **Multi-Agent Rationale**: The rationale for multi-agent architectures, including enterprise challenges and opportunities.
- **Pattern Catalog**: A collection of agentic patterns, ranging from natural language–driven intent patterns to complex multi-agent patterns with separation of concerns, and UX-focused agentic patterns for reasoning in presentation and interaction layers.
- **Pattern Components**: Standard pattern elements, including component diagrams, usage recommendations, and representative use cases.
This whitepaper helps you think about agents as components, composers, actors, and collaborators within a larger architecture, enabling you to conceive rich agentic solutions that span user journeys and create experiences that were never possible before.
## The Agent Development Lifecycle: From Conception to Production
[The Agent Development Lifecycle: From Conception to Production](/docs/architect/fundamentals/guide/agent-development-lifecycle) provides a comprehensive guide to the Agent Development Lifecycle (ADLC), a methodology tailored for building autonomous agents. This document covers:
- **ADLC Framework**: The Agent Development Lifecycle in contrast to traditional Software Development Lifecycle (SDLC) methodologies, with a focus on autonomous agents and non-deterministic behavior.
- **Five Phases**: The five core ADLC phases—Ideation and Design, Development (the inner loop), Testing and Validation, Deployment, and continuous Monitoring and Tuning (the outer loop).
- **Agentforce Platform**: Agentforce capabilities across the full Agent Development Lifecycle, including agent design, data processing, deployment, and continuous monitoring.
- **Pro-Code Implementation**: Pro-code workflows and real-world examples for agent development on Agentforce, spanning prototyping, feature engineering, model deployment, performance tuning, and maintenance.
This document is designed for developers and Enterprise Architects familiar with SDLC who want to expand their expertise into agent-based systems, providing both theoretical knowledge and practical skills for building production-ready agents.
## IT Architecture for the AI-Powered Agentic Enterprise
[The Agentic Enterprise - The IT Architecture for the AI-Powered Future](/docs/architect/fundamentals/guide/agentic-enterprise-it-architecture) presents a strategic guide for CIOs, CDOs, and IT leaders planning their journey toward becoming an Agentic Enterprise. This document covers:
- **IT Transformation**: Enterprise IT architecture for the next 3–5 years, with requirements for large-scale deployment of an agentic workforce.
- **Business Capabilities**: New enterprise capabilities enabled by agentic systems, including augmented human productivity, adaptive improvement, and organizational resilience.
- **Reference Architecture**: Strategic guidance and reference architecture for integrating a digital workforce of intelligent AI agents with human workers.
- **Strategic Planning**: Approaches to enterprise transformation addressing information silos, manual processes, and misaligned incentives to agentic solutions.
This document is essential for executive leaders who need to understand the strategic implications and IT architecture requirements for building an Agentic Enterprise.
## Architecting the Agentic Enterprise with MuleSoft
[Architecting the Agentic Enterprise with MuleSoft](/docs/architect/fundamentals/guide/mulesoft-architecting-agentic-enterprise) presents a point of view for architecting the intelligent enterprise using MuleSoft's integration platform. This document covers:
- **Composable Integration Foundation**: MuleSoft’s three-layer API-led connectivity model—System, Process, and Experience APIs—as a foundation for agent actionability.
- **Agent Fabric**: MuleSoft Agent Fabric capabilities for agent discovery, orchestration, governance, and observability across the agent ecosystem.
- **Open Standards Support**: Support for open standards such as Model Context Protocol (MCP) and Agent2Agent (A2A), enabling simple commands and complex multi-agent collaboration.
- **Governance and Security**: Unified agent integration and governance for reduced silos, improved security posture, and lower operational complexity.
This document is valuable for architects who need to integrate agents with existing enterprise systems and ensure proper governance, security, and observability across their agent ecosystem.
## MuleSoft Agent Fabric - Deep Dive
[MuleSoft Agent Fabric - Deep Dive](/docs/architect/fundamentals/guide/mulesoft-agent-fabric-deep-dive) presents a comprehensive overview of using MuleSoft's Agent Fabric. It covers:
- **Agent Fabric Vision**: A unified platform for managing agent sprawl and enabling a governed, coordinated enterprise agent network across heterogeneous agents and tools.
- **Four Core Pillars**: Centralized discovery (Agent Registry), intelligent orchestration (Agent Broker), enterprise governance and security (Flex Gateway), and end-to-end observability (Agent Visualizer).
- **Specification-First Architecture**: Declarative, YAML-based agent network definitions decoupled from execution, enabling portability, reuse, versioning, and lifecycle governance.
- **Scalable Orchestration Patterns**: Hierarchical and domain-driven agent network designs for improved traceability, controlled context size, reliability, and enterprise-scale operations.
This document is valuable for architects and developers who need to design, orchestrate, and govern scalable multi-agent networks while ensuring security, observability, and seamless integration with enterprise systems.
# Get Started with Data 360 and Integration
This section covers how to architect data platforms and integrate Salesforce with enterprise systems. These articles provide essential knowledge for building unified data architectures and connecting Salesforce with your broader technology ecosystem.
## Data 360 Architecture
[Data 360 Architecture](/docs/architect/fundamentals/guide/data-360-architecture) introduces Salesforce's next-generation data platform designed for the AI-powered future. This comprehensive guide covers:
- **Modern Data Platform Architecture**: Data 360 integrates AI/ML, decentralized data, cloud lakehouses, unstructured data, knowledge management, and real-time processing.
- **Design Principles**: Openness, interoperability, multi-model storage, metadata-driven design, real-time hybrid processing, intelligent data, governance, and one-to-many tenancy.
- **Key Differentiators**: Federates with Snowflake, Databricks, BigQuery, and Redshift, extending Customer 360 without duplicating existing investments.
- **Use Cases and Capabilities**: Enables real-time insights, autonomous decision-making, and unified access to structured and unstructured data.
This document is essential for enterprise architects and CTOs planning their data strategy for the agentic enterprise era, providing both strategic guidance and technical deep dives into Data 360's architecture.
## Integration Patterns
[Integration Patterns](/docs/architect/fundamentals/guide/integration-patterns) provides a comprehensive guide to integrating the Salesforce Platform with other applications in your enterprise. This document offers:
- **Pattern-Based Approach**: Integration patterns for common scenarios, distilled from successful Salesforce implementations.
- **Pattern Selection Guide**: A matrix to choose the right pattern for your specific integration scenario.
- **Integration Best Practices**: Tips to build stable, scalable, and maintainable integrations quickly.
- **Comprehensive Coverage**: Patterns for real-time sync, batch processing, data migration, and event-driven architectures.
This document is designed for architects and developers who need to integrate Salesforce with other enterprise applications. Salesforce's own consulting architects use these patterns as reference points during architectural reviews, making this an authoritative guide for integration architecture.
---
These two articles work together to help you understand both how to architect modern data platforms with Data 360 and how to integrate Salesforce effectively with your existing enterprise systems. Start with Data 360 Architecture to understand the data platform capabilities, then explore Integration Patterns to learn how to connect Salesforce with your broader technology ecosystem.
# Get Started with Fundamentals
This section provides essential knowledge for understanding how the Salesforce Platform works at its core. Whether you're new to Salesforce architecture or looking to deepen your understanding, these foundational articles will help you build a solid architectural foundation.
## Salesforce Platform Architecture
[Architecture Basics](/docs/architect/fundamentals/guide/architecture-basics) is your starting point for understanding how to architect solutions on the Salesforce Platform. This article covers three essential areas that every architect must master:
- **Transactions**: Learn how Salesforce defines and controls transactions through governor limits and execution contexts. Understand the platform's order of execution and how it ensures data integrity across all database operations.
- **Metadata Versus Data**: Discover the critical distinction between metadata and data, and how this affects your application lifecycle—from sandbox development to production deployment and package management.
- **Platform APIs**: Explore the various Salesforce Platform APIs available, understand when to use each one, and learn how to plan for API versioning and maintenance.
Start with this article to build your foundational understanding of how the platform manages resources, enforces limits, and provides APIs for application development.
## The Salesforce Platform - Transformed for Tomorrow
[The Salesforce Platform - Transformed for Tomorrow](/docs/architect/fundamentals/guide/platform-transformation) documents the comprehensive transformation that has reshaped Salesforce's platform architecture. This detailed whitepaper explores:
- **Modern Platform Architecture**: Discover how Salesforce has evolved from a monolithic architecture to a structure with independent services, supporting AI-powered applications and agentic experiences.
- **Hyperforce Infrastructure**: Learn about Salesforce's next-generation infrastructure that operates across multiple public cloud providers, providing enhanced scalability, compliance, and data residency capabilities.
- **Architectural Principles**: Understand the six core principles that guide platform development: Enterprise-Grade Trust, Multitenant design, Metadata-Driven architecture, API First approach, Open and Interoperable systems, and Agentic capabilities.
- **Platform Layers**: Explore the interconnected layers that make up the modern Salesforce Platform, from infrastructure to user experience, and how they work together to deliver comprehensive business capabilities.
This article is essential reading for understanding how Salesforce has positioned itself for the future of enterprise applications, particularly in the age of AI and cloud-native architectures.
## Platform Multitenant Architecture
[Platform Multitenant Architecture](/docs/architect/fundamentals/guide/platform-multitenant-architecture) provides an in-depth technical look at how the Salesforce Platform delivers reliable, scalable, and customizable experiences. This article explains:
- **Multitenant Design**: Understand how a single shared database and schema safely isolate tenant-specific data, metadata, and business logic for hundreds of thousands of organizations.
- **The Platform Data Layer**: Explore the Universal Data Dictionary (UDD), flex columns, indexing systems, and how the platform stores both metadata and data efficiently.
- **Application Development**: Learn about the platform's support for no-code, low-code, and pro-code development approaches, including browser-based tools, APIs, query languages, and Apex.
- **Internal Processing**: Discover how the platform handles queries, searches, bulk operations, schema modifications, and multitenant isolation to ensure optimal performance and security.
This technical brief is invaluable for architects who need to understand the underlying mechanisms that make the Salesforce Platform scalable, secure, and customizable.
## Platform Sharing Architecture
[Platform Sharing Architecture](/docs/architect/fundamentals/guide/platform-sharing-architecture) is your comprehensive guide to architecting secure data access models. This document covers:
- **Sharing Components**: Learn about all the components that make up the sharing model, including profiles, permission sets, role hierarchies, organization-wide defaults, sharing rules, teams, territories, and more.
- **Implementation Scenarios**: Explore real-world customer scenarios and how different sharing components work together to meet complex data access requirements.
- **Best Practices**: Understand considerations for large data volumes, ownership skews, territory management, and how to plan for organizational changes.
- **Troubleshooting**: Follow a systematic approach to diagnose why users can or cannot access records, and learn how to resolve common sharing model issues.
Whether you're designing a new sharing model or optimizing an existing one, this guide provides the knowledge you need to create secure, flexible, and maintainable data access architectures.
---
These four articles form the foundation of Salesforce Platform architecture knowledge. We recommend reading them in order, starting with Architecture Basics, to build your understanding progressively from fundamental concepts to advanced architectural patterns.
# Introduction
_Note\: "Topics" have been renamed to "subagents" throughout this article, per our latest product naming conventions._
You might build an agent that performs well in a test environment, only to have it follow entirely different routes when processing the same workflow twice. This fundamental limitation shows how the previous Agentforce model handled execution\: every decision, from intent interpretation to action selection, was made in real time by the LLM, with no guaranteed path through the workflow.
LLMs can produce inconsistent outcomes in response to identical inputs. Subtle variations in context, system prompts, or token generation are enough to send an agent down a different route. For many interactions, this variability is acceptable. However, for multi-stage workflows that require auditability, reproducibility, and traceability, it isn't. A loan approval, an inventory transfer, or a patient triage process can't depend on an agent that reasons its way through the steps differently each time.
The new Agentforce Builder and Agent Script address this issue by separating deterministic execution from LLM reasoning. Agentforce's hybrid model ensures that the agent follows a precisely defined structure for every workflow execution, while still using LLM reasoning where judgment, natural language understanding, or contextual interpretation is genuinely needed.
## Previous Agentforce Limitations
In the previous version of Agentforce, an agent operated as a simple reactive loop. Every decision, from interpreting intent to selecting the next action, was made in real time by the LLM based solely on the user's most recent input. There was no guaranteed execution path, no persistent state, and no mechanism to enforce a sequence of steps.
**Execution paths couldn't be guaranteed**
Because every decision depended on the LLM's real-time reasoning, minor variations in input, system prompt, or model version produced different action selections on identical requests. This made the previous model difficult to test rigorously\: a workflow that passed in staging could behave differently in production, and no reliable way existed to reproduce a specific execution path for debugging or audit purposes.
**Every interaction paid the full LLM cost**
Even simple conversational scenarios required a minimum of three LLM cycles\: subagent selection, action selection, and final response generation. Multi-step tasks extended to five or more cycles. For architects designing high-volume or latency-sensitive workflows, this wasn't just a performance concern. It meant you couldn't short-circuit the reasoning loop for steps that didn't require judgment, because the architecture had no mechanism to distinguish between the two.
**Non-deterministic execution created an audit gap**
In regulated industries, auditability means being able to demonstrate that a specific process was followed in a specific way for a specific transaction. A purely non-deterministic model can't provide that guarantee. If the execution path varies between runs, the audit trail varies too, and "the agent decided" is not a defensible answer in a compliance review.
**State didn't survive the conversation**
Relying on single-turn processing meant the agent had no persistent memory of earlier steps. If the conversation deviated even slightly, the agent could drop previously captured context and force the user to restart. For multi-step transactional workflows, this created a reliability ceiling\: the more steps in the process, the higher the probability of context loss before completion.
**Completed steps weren't remembered**
Without state management, agents had no record of which mandatory steps a user had already completed. This produced unpredictable looping, where an agent would return to a step the user had already finished. Beyond the user experience impact, this created a deeper architectural problem\: designing a reliable sequential workflow was impossible because the agent couldn't enforce sequence.
## How the new Agentforce architecture works
The new Agentforce, GA since February 2026, shifts from purely probabilistic LLM reasoning to a hybrid model. Rather than routing every decision through the LLM, it separates deterministic execution from LLM reasoning and lets each handle only what it's suited for. To support this, Agentforce introduced two authoring tools\: Agent Script for code-based development, and Agentforce Studio, a no-code building environment.
**Agentforce Builder**
Agentforce Builder is the recommended environment for developing new agents. It's hosted within Agentforce Studio and replaces the legacy Setup experience, which remains available but is no longer the primary authoring path. In Builder, you work either in a visual Canvas view or directly in Script view, editing the Agent Script that defines your agent's behavior.
**Agent Script**
Agent Script is a declarative, domain-specific language (DSL) that defines everything about how an agent behaves\: its configuration, business logic, and prompting. It's structured as key-value pairs that can span multiple lines or include nested sub-properties, and it's designed to be human-readable without requiring knowledge of the underlying graph architecture.
Agent Script lets you express two fundamentally different types of instructions in the same agent\: deterministic logic instructions and prompt instructions. Deterministic logic instructions define conditions and action sequences that execute as code with no LLM involvement. Prompt instructions define natural language guidance that the LLM interprets at runtime. The boundary between the two is explicit and deliberate, and understanding where to place that boundary is one of the core design decisions you'll make when building with the new Agentforce.
**Deterministic logic in practice**
When instructions are deterministic, the agent follows a defined execution path regardless of how the user phrases their input. The example below shows a subagent that loads a customer intelligence dashboard. It checks for a customer ID, fetches profile data, order history, and support tickets, then calculates customer lifetime value and churn risk. None of these steps require LLM reasoning.
This logic calls actions in a fixed sequence every time certain conditions are met.
```
instructions: ->
# Ask for user_id if we don't have it
if @variables.user_id=="":
| Ask the user for customer ID to view personalized insights. Do not proceed until you have the customer ID.
Use {!@actions.set_user_id} to update the user_id variable and set context.
# Fetch customer data if we have user_id
if @variables.user_id!="":
run @actions.fetch_user_profile
with user_id=@variables.user_id
set @variables.user_profile = @outputs.profile
# Chain additional data fetches
run @actions.fetch_account_data
with user_id=@variables.user_id
set @variables.account_data = @outputs.account
run @actions.fetch_order_history
with user_id=@variables.user_id
with limit=10
set @variables.recent_orders = @outputs.orders
run @actions.fetch_support_history
with user_id=@variables.user_id
set @variables.support_history = @outputs.tickets
# Compute insights
run @actions.calculate_customer_value
with user_id=@variables.user_id
with orders=@variables.recent_orders
set @variables.customer_lifetime_value = @outputs.clv
set @variables.loyalty_status = @outputs.loyalty_tier
run @actions.assess_churn_risk
with account=@variables.account_data
with orders=@variables.recent_orders
with support_tickets=@variables.support_history
set @variables.churn_risk_score = @outputs.risk_score
run @actions.generate_recommendations
with profile=@variables.user_profile
with clv=@variables.customer_lifetime_value
with churn_risk=@variables.churn_risk_score
set @variables.recommended_actions = @outputs.recommendations
```
**Prompt instructions and deliberate LLM handoff**
Where deterministic logic handles conditions and sequences that can be expressed as code, prompt instructions handle everything that requires judgment, interpretation, or natural language generation. When the Atlas Reasoning Engine encounters a node with prompt instructions, it triggers an LLM call. When it doesn't, it executes deterministically.
The example below shows a subagent for product and services. The instructions are a multi-line prompt that tells the LLM how to respond, when to look up information, and how to handle ambiguity. This is the right pattern when the range of possible user inputs is too broad to anticipate with conditional logic, or when the quality of the response depends on the LLM's ability to interpret context and generate a natural reply.
The prompt instructions on a node trigger the LLM call. That's not incidental—it's the mechanism by which Agent Script makes the LLM boundary explicit and enforceable, rather than leaving it to runtime inference.
This subagent shows deterministic logic and LLM handoff in action.
```
instructions:->
| Answer the user's questions about products and services clearly and accurately.
When the user asks about a specific product, use {!@actions.get_product_info}
to look up current information.
When answering:
- Be specific and provide helpful details
- If the question is unclear, ask for clarification
- Stay focused on product-related subagents
- Use {!@actions.get_product_info} to get accurate, up-to-date information
Subagents you can help with:
- Product features and specifications
- Pricing and packages
- Availability and delivery
- Comparisons between products
```
**The three-stage execution pipeline**
Agentforce Builder and Agent Script are the authoring layer, but Agent Graph and the Atlas Reasoning Engine actually run your agent. By design, neither of these components is directly accessible to you. Separating authoring and execution allows the platform to enforce deterministic behavior independently of how the script was written.
The pipeline moves through three stages.
1. **Authoring** is where you work. Agent Script is human-readable and editable in either Canvas view or Script view in Agentforce Builder. This is the only layer you interact with directly.
2. **Compilation** is where the Salesforce compiler transforms your Agent Script into an Agent Graph, a serialized execution plan optimized for machine execution rather than human readability. You don't debug at this layer. Compilation produces a representation the runtime can traverse efficiently.
3. **Runtime execution** is where the Atlas Reasoning Engine takes over. It reads the Agent Graph, traverses it based on current session state, and decides at each node whether to execute deterministically or invoke the LLM. The engine explicitly enforces guard clauses and conditional routing here, rather than inferring.
**Agent Graph**
Agent Graph is the intermediate representation that sits between your human-readable script and actual runtime execution. Its structure is optimized for the state machine that consumes it, not for the architect who authored the script. Understanding that it exists, and what it represents, matters because it's the artifact the Reasoning Engine uses to enforce the execution plan your script defines.
**Atlas Reasoning Engine**
The Atlas Reasoning Engine is a state machine executor. On each turn, it traverses the Agent Graph based on session state, executes deterministic nodes as code, and triggers LLM calls only where prompt instructions are present. It also enforces guard clauses and handles conditional routing. The Reasoning Engine is where the hybrid reasoning model is actually implemented; the script defines the boundary, and the engine respects it.

## The LLM boundary\: where judgment ends and code begins
Agent Graph isn't an LLM wrapper. It's a hybrid reasoning engine that separates deterministic execution from probabilistic reasoning. The governing rule is straightforward\: if you can express a decision as code, it should be written as logic. If the decision requires judgment, interpretation, or natural language generation, the LLM should handle it. This design decision is the most important architectural choice in the new Agentforce model. Where the LLM boundary falls directly affects your solution's cost, latency, auditability, and reliability.
The Atlas Reasoning Engine evaluates every incoming user turn and routes it down one of two paths.
**Path A\: deterministic execution**
This path has no LLM exposure. It behaves like compiled code at runtime. The Reasoning Engine classifies the user's intent and determines that a logic instruction matches, bypassing the LLM entirely. The compiled Agent Script runs top to bottom, with if-else rules executing unconditionally on every turn. Flow, Apex, or API actions are called with deterministic parameters, with no prompt assembly or model call involved. The result passes back through the trust layer with full audit logging.
**Path B\: LLM reasoning**
The Reasoning Engine takes this path when it can't resolve intent using logic instructions alone. It traverses the Agent Graph and evaluates each node. Nodes with prompt instructions trigger an LLM call. Nodes without them execute deterministically. The presence of a prompt instruction is the trigger, and it's explicit in the script rather than inferred at runtime.
**What triggers an LLM call**
There are eight points in the execution lifecycle where the LLM is invoked. Subagent classification, or deciding which subagent matches the user's request, is one, though a short-circuit path can bypass the full LLM call when classification is unambiguous. Agent reasoning, where the agent decides what action to take next, always goes through the LLM. So does response generation, where the final reply is assembled from a hydrated prompt.
The remaining triggers are more operational\: groundedness validation confirms the output is grounded in retrieved data; action simulation emulates responses in the Preview and Simulate environment instead of executing live; structured output generation handles cases where the response needs to conform to a defined schema; and localization and progress indicator generation handle formatting and transient messaging where no pre-authored default exists.
**What stays deterministic**
Graph traversal and state transitions never involve the LLM. The `before_reasoning` and `after_reasoning` lifecycle blocks execute deterministically as long as they contain only action nodes with no prompt instructions. Math, data fetching, validation, and conditional logic all belong in code. Any action executing Flow, Apex, or a REST API directly stays on the deterministic path. Any node without prompt instructions executes without an LLM call.
Being explicit about this boundary with your team matters. Every unnecessary LLM call adds latency, cost, and variability. Architects should push deterministic logic by default, reserving the LLM for cases where the task actually requires its reasoning capability.
**Design guidance\: push logic to code by default**
Use Agent Script logic instructions when writing prompt instructions that could be expressed as a condition, a variable assignment, or an action filter. Every unnecessary LLM call adds latency, cost, and variability.
The default position should be deterministic. Isolate every agent behavior that can be codified as a rule and move it into Agent Script. The remaining tasks that require natural language synthesis, contextual judgment, or complex interpretation belong in prompt-bearing nodes. That's not a limitation; it's the boundary working as intended. The LLM handles what it's best suited for, and everything else runs as code.
## The parse boundary\: `before_reasoning`, `reasoning`, and `after_reasoning`
The primary unit of execution in Agent Script isn't the user turn. It's the parse\: a single complete cycle through a subagent's three lifecycle blocks. The Atlas Reasoning Engine initiates a parse each time a subagent needs to process something, which happens in three situations\: on first entry into the subagent, after every tool call when an action completes and returns a result, and on every new user turn within the same subagent.
Understanding the parse boundary matters because it determines how many times each block runs, and therefore where you can and can't rely on a given piece of logic executing exactly once.
Every subagent defines three execution zones\:
| Block | When it runs | LLM involvement |
| ------------------ | --------------------------------------------------------- | ----------------------------- |
| `before_reasoning` | At the start of every parse, before the LLM sees anything | None |
| `reasoning` | During deterministic resolution, prior to any LLM calls | Mixed |
| `after_reasoning` | After reasoning completes and the LLM has responded | None (with a critical caveat) |
Both `before_reasoning` and `after_reasoning` are fully deterministic. They execute actions, set variables, and apply conditional logic without involving the LLM. This makes them the reliable, low-cost blocks in the script.
**When to use `before_reasoning`**
`before_reasoning` runs at the start of every parse without exception. It executes on first entry into the subagent and again after every tool call or new user turn within that subagent. A `run @actions.X` in `before_reasoning` is code. Unlike an instruction inside a prompt block, which the LLM may or may not follow, `before_reasoning` executes unconditionally.
Use this block for session initialization\: fetching context records, setting session variables from Apex or Flow. It's also where authentication and entitlement checks belong, because you want those verified before the LLM sees any tools. Context hydration fits here too\: calling a data retrieval action so the LLM receives pre-populated variables rather than needing to request them. Any counter or audit variable that must be incremented on every parse should be set here, because the `set` directive in `before_reasoning` is guaranteed in a way that a pipe instruction is not.
What doesn't belong here is logic that should only run once per session, since `before_reasoning` runs on every parse, not just on the first entry. Anything that depends on user input from the current turn also doesn't belong here, because that input hasn't been processed yet. And transitions should never be in `before_reasoning`\: a `transition to` instruction here will fire unconditionally on every parse and create loops.
If you need once-per-session initialization, guard it explicitly\:
```
before_reasoning:
if @variables.sessionInitialized == False:
run @actions.InitializeSession
set @variables.sessionInitialized = True
```
One user turn can trigger multiple parses\: once on entry, then again after each tool call. That functionality has three practical consequences\: initialization actions in `before_reasoning` will run more than once per user turn in multi-action flows, counter variables incremented here will reflect parse count, not turn count, and actions with side effects, external API calls or record writes, should not live in `before_reasoning` unless re-execution on every parse is explicitly acceptable.
`before_reasoning` is not a constructor. It's a pre-flight check that runs with every parse. Design it accordingly.
**When to use `after_reasoning`**
`after_reasoning` runs once the reasoning loop is finished, after the LLM has responded and action outputs have been captured. This is where post-action deterministic checks belong\: evaluating action outputs and branching based on results. Deterministic transitions, or moving to the next subagent based on variable state rather than LLM judgment, sit here. So does variable cleanup before the next turn, and orchestration sequencing when you need to chain subagents in a predictable order without an LLM routing decision.
Treat `after_reasoning` as the guardrail layer. It's where you enforce business rules and state management after the LLM has done its work, ensuring that critical process flows remain predictable regardless of what the LLM generated.
**Use `is_displayable: True` wisely**
Every architect designing orchestration flows needs to understand this platform behavior. When `is_displayable: True` is set on an action, the platform exits the reasoning loop as soon as the LLM decides to surface that output. That exit happens immediately, which means `after_reasoning` never executes.
This is a known platform behavior, but it has a direct consequence for orchestration\: any logic you've placed in `after_reasoning` will be skipped when a displayable action is part of the flow.
The answer is straightforward. Move logic that **must execute** reliably into the `before_reasoning` block of the subsequent subagent rather than the `after_reasoning` block of the current one.
**Design guidance\: where to place initialization logic**
Deciding where to place logic is consequential when designing a subagent. This framework covers the most common scenarios\:
| Scenario | Where to put it |
| ------------------------------------------------------------------------------- | --------------------------------------------------------- |
| Must run before the LLM sees any context | `before_reasoning` |
| Runs every parse, including re-entry on new user turns | `before_reasoning` |
| Depends on action output from this turn | Conditional `if` block in `reasoning` |
| Requires deterministic subagent transition based on outcome | `after_reasoning` (but see `is_displayable` caveat below) |
| Requires orchestration logic when downstream action uses `is_displayable: True` | `before_reasoning` of the next subagent |
| Uses logic that requires judgment or user context | `reasoning` with prompt instructions |
The underlying principle is straightforward. When you write a prompt instruction telling the LLM to "always run" an action, that's a suggestion. The LLM may or may not follow it depending on context. When you place a `run` directive in `before_reasoning`, that's code. It executes on every parse without exception.
## Make Actions Available to LLMs Conditionally
Conditional action availability is the mechanism by which Agent Script exposes or hides actions from the LLM based on runtime variable state. When the `available when` condition evaluates to `false`, the action is removed from the tool list presented to the LLM entirely. Any false value, including `None`, `False`, `0`, or an empty string, suppresses the action.
This is not a prompt instruction telling the LLM "don't call this yet," it's a hard platform-level gate. The LLM can't call an action it can't access.
```
actions:
execute_transfer: @actions.execute_transfer
available when @variables.validation_passed
with from_account=@variables.source_account
with to_account=@variables.destination_account
with amount=@variables.transfer_amount
```
In this example, `execute_transfer` is invisible to the LLM until `validation_passed` evaluates to `true`. The gate is enforced by the platform, not by instruction.
**Design guidance\: never let the LLM set the gate variable**
Give every variable in an `available when` clause a deterministic code path that sets the variable before the associated action is executed. Use `before_reasoning` or a deterministic `run` and `set` block in `reasoning` to keep the variable in a known state. If you rely on the LLM to set the gate variable, you've reintroduced the variability the gate was designed to prevent. Depending on the conversation, the LLM may or may not set it, which means the gate may or may not open.
**The action loop problem**
An action loop occurs when the LLM calls the same action repeatedly without ever reaching a terminal state. It happens when two conditions are true simultaneously\: the `available when` condition remains satisfied after the action runs, and the reasoning instructions don't explicitly tell the LLM to stop calling it.
The platform doesn't automatically suppress an action after it's been called. If the gate stays open and the reasoning instructions are ambiguous, the LLM calls the same action on every parse indefinitely.
Consider `available when @variables.interest != ""` as an example. If the action executes but the interest variable is not empty, the gate remains open on the next parse. The LLM sees the action as available, has no instruction telling it to stop, and calls it again.
There are two reliable ways to break the loop. The first is to set the gate variable to a closed state as part of the action's post-execution logic, so that `available when` evaluates to `false` on the next parse. The second is to use a separate `has_run` boolean that closes the gate after first execution. Both approaches give the gate a deterministic closed state, which is the condition the platform needs to suppress the action.
## Make an Agentic Bank Transfer Deterministic
A bank transfer is a useful lens for understanding how these patterns work together in practice. The workflow looks simple from the outside\: move money from one account to another. The implementation requires multiple complex steps. Before the transfer executes, the agent must collect account details, validate the amount, check transfer limits, confirm the available balance, and only then expose the transfer action. Each step depends on the previous steps. None of them should be left to LLM judgment.
**Collect and validate inputs**
The first subagent collects the source account, destination account, and transfer amount from the user. It won't proceed until all three are present and valid. The Agent Script checks each field in sequence\: if the source account is missing, it asks. If the destination is missing, it asks. If the amount is zero or negative, it asks. The `validation_passed` variable is only set to `true` after all checks are clear.
The script below shows this in practice. Notice that `validation_passed` is explicitly set to `false` at each failure point, and the LLM is instructed not to proceed. The deterministic checks run unconditionally, while the prompt instructions handle the user-facing response.
```
instructions:->
| Always ensure to request the following data from the user, and to store it using {!@actions.store_details}
- source account number
- destination account number
- amount to transfer
Only after you have all the data, you can proceed with the next steps.
if not @variables.source_account:
set @variables.validation_information = "Missing source account"
set @variables.validation_passed = False
| You need the source account number before proceeding.
Ask the customer for the source account number.
else:
set @variables.validation_passed = True
if @variables.source_account and not @variables.destination_account:
set @variables.validation_information = "Missing destination account"
set @variables.validation_passed = False
| You need the destination account number before proceeding.
Ask the customer for the destination account number.
else:
set @variables.validation_passed = True
if not @variables.source_account or not @variables.destination_account:
| Do NOT proceed with the transfer yet.
if @variables.transfer_amount <= 0:
set @variables.validation_information = "Invalid transfer amount"
set @variables.validation_passed = False
| The transfer amount must be greater than zero. Ask the customer
how much they want to transfer.
Do NOT proceed with the transfer yet.
else:
set @variables.validation_passed = True
```
**Enforce business rules**
After the agent validates inputs, it checks whether the transfer amount exceeds the configured transfer limit. This is where business rules become code rather than instructions. The limit isn't something the LLM reasons about; it's a hard threshold defined in the script and checked deterministically on every parse.
If the amount exceeds the limit, `validation_passed` is set back to `false` and the LLM presents the user with three options\: transfer the maximum allowed amount, split into multiple transfers, or contact support for higher limits. The agent can't proceed until the user resolves the exception. Notice how the prompt instruction here is doing exactly what LLM reasoning is suited for\: presenting options conversationally and handling the user's response. The business rule itself is deterministic, but the conversation around it is not.
The script below shows how the limit check works. The deterministic condition evaluates the transfer amount against the limit variable, sets `validation_passed` to `false` if the threshold is breached, and delegates to a prompt instruction to handle the user-facing response.
```
instructions:->
if @variables.transfer_amount > @variables.transfer_limit:
set @variables.validation_information = "Amount exceeds transfer limit"
set @variables.validation_passed = False
| ⚠️ STOP: The requested amount (${!@variables.transfer_amount}) exceeds
the maximum transfer limit of ${!@variables.transfer_limit}.
Inform the customer and ask if they'd like to:
1. Transfer the maximum allowed amount (${!@variables.transfer_limit})
2. Split into multiple transfers
3. Contact support for higher limits
Do NOT proceed with the transfer.
```
**Apply guard clauses**
With amount and limit checks complete, the agent fetches the source account balance and confirms that sufficient funds are available. Guard clauses prevent the agent from attempting operations when preconditions aren't met. Unlike a prompt instruction that tells the LLM to check the balance, a guard clause in Agent Script makes the check unconditional. The LLM doesn't decide whether to run it.
If the balance is insufficient, the agent calculates the shortfall and presents the user with a concrete alternative. `validation_passed` is set to `false` until this check passes, which means the transfer action remains gated.
The script below shows a deterministic action call that fetches the balance, followed by a conditional check that evaluates it. The fetch only runs if the balance hasn't already been retrieved, avoiding redundant API calls on subsequent parses.
```
instructions:->
# Fetch balance if needed
if @variables.source_account and not @variables.source_balance:
run @actions.get_account_balance
with account_number = @variables.source_account
set @variables.source_balance = @outputs.balance
# Validate sufficient funds
if @variables.source_balance < @variables.transfer_amount:
set @variables.validation_information = "Insufficient funds"
set @variables.validation_passed = False
| ⚠️ STOP: Insufficient funds in the source account.
- Available balance: ${!@variables.source_balance}
- Requested transfer: ${!@variables.transfer_amount}
- Shortfall: ${!@variables.transfer_amount-@variables.source_balance}
Ask if they'd like to transfer a smaller amount.
Do NOT proceed with the transfer.
```
**Surface errors clearly**
Guard clauses set the state. Error messages communicate it. When `validation_passed` is `false`, the agent needs to give the user enough information to resolve the problem without restarting. Vague error messages create friction; structured ones close the loop faster.
The script below shows the insufficient funds error message in practice. It doesn't just tell the user the transfer failed. It shows the available balance, the requested amount, the calculated shortfall, and offers a concrete next step, all assembled from session variables rather than generated by the LLM.
```
| ⚠️ STOP: Insufficient funds.
- Available: ${!@variables.source_balance}
- Requested: ${!@variables.transfer_amount}
- Short by: ${!@variables.transfer_amount - @variables.source_balance}
Would you like to transfer ${!@variables.source_balance} instead?
```
The shortfall calculation happens in the script, not in the LLM. The suggested alternative, transferring the available balance, is deterministically derived from session state. The LLM's role here is purely presentational\: it delivers a message that the script has already structured.
**Gate the transfer action**
Every validation check in the preceding steps sets or clears the same variable\: `validation_passed`. That variable is now doing its most important job. The `execute_transfer` action is conditionally available, meaning it only appears in the LLM's tool list when `validation_passed` is `true`. Until every preceding check has passed and set that variable, the action doesn't exist from the LLM's perspective.
This is the pattern from the earlier gate section applied to a production workflow. The transfer action isn't hidden by a prompt instruction. It's hidden by the platform. No amount of conversational pressure or ambiguous phrasing can cause the LLM to invoke it before the preconditions are met.
The script below shows how the gate is configured. The `available when` clause references `validation_passed` directly, and the action parameters are bound to the session variables collected and validated in the preceding steps.
```
actions:
execute_transfer: @actions.execute_transfer
available when @variables.validation_passed
with from_account=@variables.source_account
with to_account=@variables.destination_account
with amount=@variables.transfer_amount
```
All three parameters, `from_account`, `to_account`, and `amount`, are passed deterministically from session variables. By the time this action becomes available, every value has been validated. The LLM isn't assembling the parameters from conversation context; it's reading them from the state.
**Track state throughout the workflow**
The patterns in the preceding sections only work because session state persists across the entire workflow. Account numbers captured in the first step are available in the fourth. Validation results set in one check gate actions in another. The conversation can deviate, the user can ask follow-up questions, and the agent will still know exactly where it is in the process.
The variables block below shows the full session state for this workflow. Each variable has a defined type, a default value, and a description. Two variables handle most of the orchestration work\: `validation_passed` controls action availability at every gate, and `validation_information` carries human-readable context about why a check failed, which the LLM can surface to the user without needing to reason about the underlying state.
```
variables:
source_account: mutable string = ""
description: "Account to transfer from"
destination_account: mutable string = ""
description: "Account to transfer to"
transfer_amount: mutable number = 0
description: "Amount to transfer"
source_balance: mutable number = 0
description: "Balance of source account"
transfer_limit: mutable number = 10000
description: "Maximum allowed transfer amount"
validation_passed: mutable boolean = False
description: "Whether all validations passed"
validation_information: mutable string = ""
description: "Human readable validation information"
```
Every variable starts in a known default state. Strings default to empty, numbers to zero, and the `validation_passed` boolean to `false`. This means the gate is closed by default. The workflow has to actively earn the right to proceed at each step, rather than starting with the gate open and relying on checks to close it.
## When to use deterministic logic
The bank transfer example illustrates where deterministic logic is the right tool, but it isn't always the best choice. Understanding the boundary is as important as understanding the patterns.
Deterministic logic is the right choice when the workflow requires a guaranteed execution sequence, when errors have significant consequences, when the process needs to produce a reproducible audit trail, or when business rules are well-defined enough to be expressed as conditions and thresholds. Finance, healthcare, and insurance workflows generally fall into this category.
Pure LLM reasoning without strict deterministic constraints makes more sense when the value of the interaction lies in flexibility rather than precision. Open-ended customer support, early-stage products where business processes are still evolving, and low-stakes informational queries are all cases where the variability of LLM reasoning is a feature, not a problem.
In practice, most production agents need both. The decision of where the boundary falls isn't a binary choice between deterministic and probabilistic; it's a design decision you make at the node level for every part of your agent's workflow.
| Use deterministic logic for | Use LLM reasoning for |
| ------------------------------------------- | --------------------------------------------------- |
| Input validation and sanitization | Natural language understanding and intent detection |
| Business rule enforcement | Generating conversational, empathetic responses |
| Sequential process orchestration | Handling ambiguous or unexpected inputs |
| State management and context preservation | Providing explanations and clarifications |
| Guard clauses preventing invalid operations | Adapting tone and messaging to user context |
**The boundary is the design decision**
The bank transfer example is an illustration of a design philosophy\: that the boundary between deterministic execution and LLM reasoning is the most consequential architectural decision you make when building a production agent.
Place a boundary that's too rigid and you'll end up with an agent that's rigid, expensive to maintain, and incapable of handling the natural variation of real conversations. Getting the boundary wrong in the other direction creates an agent that is flexible but unpredictable, performs well in testing but behaves differently in production, and can't produce a reliable audit trail or be trusted with a high-stakes transaction.
The new Agentforce model gives you the tools to place that boundary deliberately. Agent Script lets you express deterministic logic and prompt instructions in the same file, with an explicit syntax to make the boundary visible. The Atlas Reasoning Engine enforces logic and prompts at runtime. The `before_reasoning` and `after_reasoning` blocks give you guaranteed execution zones on either side of the LLM call. Conditional action availability ensures the LLM can only act when preconditions are met.
None of these features are in isolation. They work together to create a coherent architecture for building agents that enterprises can trust with mission-critical workflows. The hybrid reasoning model recognizes that determinism and flexibility both have roles in your architecture; it is the architect's job to decide precisely where each one applies.
## References
[Agent Script Recipes](https://developer.salesforce.com/sample-apps/agent-script-recipes)
[Agentforce Developer Guide](https://developer.salesforce.com/docs/ai/agentforce/guide/agent-script.html)
[Agentforce's Agent Graph\: Toward Guided Determinism with Hybrid Reasoning](https://engineering.salesforce.com/agentforces-agent-graph-toward-guided-determinism-with-hybrid-reasoning/)
## About the Authors
Gulal Kumar is a Software Engineering Architect at Salesforce with over 20 years of experience. His expertise spans AI, integration, APIs, and enterprise architecture, with a focus on driving business transformation through secure, resilient, and innovative AI solutions. Connect with him on [LinkedIn](https://www.linkedin.com/in/gulal/).
Miriam McCabe is Senior Director and leader of the Architect Evangelism team. Her work focuses on enabling the global Salesforce architect community to lead in the agentic era through deeply technical content, live programming, and community engagement. Follow her on [LinkedIn](https://www.linkedin.com/in/miriammccabe/).
# Integration Patterns Overview
Typically, when you implement Salesforce, you need to integrate it with other applications. Although each integration scenario is unique, there are common requirements and issues that developers and architects must resolve.
This document describes strategies (in the form of patterns) for these common integration scenarios. Each pattern describes the design and approach for a particular scenario rather than detailing a specific implementation. In this document you’ll find:
- A number of patterns that address key “archetype” integration scenarios
- A selection matrix to help determine which pattern best fits your scenario
- Integration tips and best practices
**Purpose and Scope**
This document is for designers and architects who need to integrate the Salesforce Platform with other applications in their enterprise. We have distilled this content from many successful implementations.
To become familiar with integration capabilities and options available for large-scale adoption of Salesforce-based applications, read the Pattern Summary and Pattern Selection Guide. Architects and developers should apply these pattern details and best practices during the design and implementation phase of a Salesforce integration project.
If implemented properly, these patterns enable you to get to production as fast as possible and have the most stable, scalable, and maintenance-free set of applications possible. Salesforce’s own consulting architects use these patterns as reference points during architectural reviews and actively maintain and improve them.
As with all patterns, this content covers most integration scenarios, but not all. While Salesforce allows for user interface (UI) integration, mashups, for example, such integration is outside the scope of this document.
**Pattern Template**
Each integration pattern follows a consistent structure. This structure makes it easier to compare patterns and locate relevant information.
_Name_
The pattern identifier that also indicates the type of integration contained in the pattern.
_Context_
The overall integration scenario that the pattern addresses. Context provides information about what users are trying to accomplish and how the application will behave to support the requirements.
_Problem_
The scenario or problem (expressed as a question) that the pattern is designed to solve. When reviewing the patterns, read this section to quickly understand if the pattern is appropriate for your integration scenario.
_Forces_
The constraints and circumstances that make the stated scenario difficult to solve.
_Solution_
The recommended way to solve the integration scenario.
_Sketch_
A UML sequence diagram that shows you how the solution addresses the scenario.
_Results_
Explains the details of how to apply the solution to your integration scenario and how it resolves the forces associated with that scenario. This section also contains new challenges that can arise as a result of applying the pattern.
_Sidebars_
Additional sections related to the pattern that contain key technical issues, variations of the pattern, pattern-specific concerns, and so on.
_Example_
An end-to-end scenario that describes how the design pattern is used in a real-world Salesforce scenario. The example explains the integration goals and how to implement the pattern to achieve those goals.
**Pattern Summary**
The following table lists the integration patterns contained in this document.
**List of Patterns**
| Patterns | Scenario |
| :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Remote Process Invocation—Request and Reply](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--request-and-reply) | Salesforce invokes a process on a remote system, waits for completion of that process, and then tracks state based on the response from the remote system. |
| [Remote Process Invocation—Fire and Forget](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--fire-and-forget) | Salesforce invokes a process in a remote system but doesn't wait for completion of the process. Instead, the remote process receives and acknowledges the request and then hands off control back to Salesforce. |
| [Batch Data Synchronization](/docs/architect/fundamentals/guide/integration-patterns.html#batch-data-synchronization) | Data stored in Salesforce Platform is created or refreshed to reflect updates from an external system, and when changes from Salesforce Platform are sent to an external system. Updates in either direction are done in a batch manner. |
| [Remote Call-In](/docs/architect/fundamentals/guide/integration-patterns.html#remote-call-in) | Data stored in Salesforce Platform is created, retrieved, updated, or deleted by a remote system. |
| [UI Update Based on Data Changes](/docs/architect/fundamentals/guide/integration-patterns.html#ui-update-based-on-data-changes) | The Salesforce user interface must be automatically updated as a result of changes to Salesforce data. |
| [Data Virtualization](/docs/architect/fundamentals/guide/integration-patterns.html#data-virtualization) | Salesforce accesses external data in real time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system. |
**Pattern Approach**
The integration patterns in this document are classified into three categories:
- Data Integration: These patterns address the requirement to synchronize data that resides in two or more systems so that both systems always contain timely and meaningful data. Data integration is often the simplest type of integration to implement, but requires proper information management techniques to make the solution sustainable and cost effective. Such techniques often include aspects of master data management (MDM), data governance, mastering, de-duplication, data flow design, and others.
- Process Integration: The patterns in this category address the need for a business process to leverage two or more applications to complete its task. When you implement a solution for this type of integration, the triggering application has to call across process boundaries to other applications. Usually, these patterns also include both orchestration (where one application is the central “controller”) and choreography (where applications are multi-participants and there is no central “controller”). These integrations often require complex design, testing, and exception handling requirements. Also, such composite applications are typically more demanding on the underlying systems because they often support long-running transactions, and the ability to report on or manage process state.
- Virtual Integration: The patterns in this category address the need for a user to view, search, and modify data that’s stored in an external system. When you implement a solution for this type of integration, the triggering application has to call out to other applications and interact with their data in real time. This type of integration removes the need for data replication across systems, and means that users always interact with the most current data.
Choosing the best integration strategy for your system isn’t trivial. There are many aspects to consider and many tools that can be used, with some tools being more appropriate than others for certain tasks. Each pattern addresses specific critical areas including the capabilities of each of the systems, volume of data, failure handling, and transactionality.
**Pattern Selection Guide**
The selection matrix tables list the patterns and their key aspects to help you determine which pattern best fits your integration requirements. The patterns are categorized using these dimensions.
| Aspect | Description |
| :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type | Specifies the style of integration: **Process**, **Data**, or **Virtual**.
**Process:** Process-based integrations are ways to integrate the processing of functional flow across two or more applications. These integrations typically involve a higher level of abstraction and complexity, especially for transactionality and rollback.
**Data:** Data integrations are the integration of the information used by applications. These integrations can range from a simple table insert or upsert to complex data updates requiring referential integrity and complex translations.
**Virtual:** Virtual integrations are where Salesforce interacts with data that resides in an external system without the need to replicate the data that’s within Salesforce. This type of integration is always triggered via an event from the Salesforce platform such as a user action, search, or record update, resulting in data integration with an external source in real time. |
| Timing | Specifies the style of integration based on timing: **Synchronous** or **Asynchronous**.
**Synchronous:** Blocking and real time requests are request/response operations. The result is returned to the caller immediately via this operation.
**Asynchronous:** Nonblocking, queue, or message-based requests are invoked by a one-way operation which are near-realtime. The results and any faults are returned by invoking other one-way operations. The caller therefore makes the request and continues without waiting for a response. |
_Integrating Salesforce with Another System_
This table lists the patterns and their key aspects to help you determine which pattern best fits your requirements when your integration is from Salesforce to another system.
| Type | Timing | Key Pattern to Consider |
| :------------------ | :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Process Integration | Synchronous | [Remote Process Invocation—Request and Reply](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--request-and-reply) |
| Process Integration | Asynchronous | [Remote Process Invocation—Fire and Forget](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--fire-and-forget) |
| Data Integration | Synchronous | [Remote Process Invocation—Request and Reply](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--request-and-reply) |
| Data Integration | Asynchronous | [UI Update Based on Data Changes](/docs/architect/fundamentals/guide/integration-patterns.html#ui-update-based-on-data-changes) |
| Virtual Integration | Synchronous | [Data Virtualization](/docs/architect/fundamentals/guide/integration-patterns.html#data-virtualization) |
_Integrating Another System with Salesforce_
This table lists the patterns and their key aspects to help you determine the pattern that best fits your requirements when your integration is from another system to Salesforce.
| Type | Timing | Key Pattern to Consider |
| :------------------ | :----------- | :-------------------------------------------------------------------------------------------------------------------- |
| Process Integration | Synchronous | [Remote Call-In](/docs/architect/fundamentals/guide/integration-patterns.html#remote-call-in) |
| Process Integration | Asynchronous | [Remote Call-In](/docs/architect/fundamentals/guide/integration-patterns.html#remote-call-in) |
| Data Integration | Synchronous | [Remote Call-In](/docs/architect/fundamentals/guide/integration-patterns.html#remote-call-in) |
| Data Integration | Asynchronous | [Batch Data Synchronization](/docs/architect/fundamentals/guide/integration-patterns.html#batch-data-synchronization) |
**Middleware Terms and Definitions**
This table lists some key terms related to middleware and their definitions with regards to these patterns.
| Term | Definition |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Event handling | Event handling is the receipt of an identifiable occurrence at a designated receiver (“handler”). The key processes involved in event handling include:
Identifying where to forward an event
Executing that forwarding action
Receiving a forwarded event
Taking some kind of appropriate action in response, such as writing to a log, sending an error or recovery process, or sending an extra message
Keep in mind that the event handler can ultimately forward the event to an event consumer.
Common uses of this feature with middleware can be extended to include the popular “publish/subscribe” or “pub/sub” capability. In a publish/subscribe scenario, the middleware routes requests or messages to active data-event subscribers from active data-event publishers. These consumers with active listeners can then retrieve the events as they’re published.
In Salesforce integrations using middleware, the middleware layer assumes control of event handling. It collects all relevant events, synchronous or asynchronous, and manages distribution to all endpoints, including Salesforce.
Alternatively, this capability can be achieved using the Salesforce event bus with platform events. |
| Protocol conversion | Protocol conversion is typically a software application that converts the standard or proprietary protocol of one device to the protocol suitable for another device to achieve interoperability.
In the context of middleware, connectivity to a particular target system may be constrained by protocol. In such cases, the message format needs to be converted to or encapsulated within the format of the target system, where the payload can be extracted. This is also known as tunneling.
Salesforce doesn’t support native protocol conversion, so it’s assumed that any such requirements are met by the middleware layer or the endpoint. |
| Translation and transformation | Transformation is the ability to map one data format to another to ensure interoperability between the various systems being integrated. Typically, the process entails reformatting messages en route to match the requirements of the sender or recipient. In more complex cases, one application can send a message in its own native format, and two or more other applications can each receive a copy of the message in their own native format.
Middleware translation and transformation tools often include the ability to create service facades for legacy or other non-standard endpoints. These service facades allow those endpoints to appear to be service-addressable.
With Salesforce integrations, it’s assumed that any such requirements are met by the middleware layer or the endpoint. While middleware is still preferred for complex transformations, the Salesforce platform has matured. OmniStudio Integration Procedures, Flow data mapping, and Apex with modern patterns are all viable for moderate transformations. |
| Queuing and buffering | Queuing and buffering generally rely on asynchronous message passing, as opposed to a request-response architecture. In asynchronous systems, message queues provide temporary storage when the destination program is busy or connectivity is compromised. In addition, most asynchronous middleware systems provide persistent storage to back up the message queue.
The key benefit of an asynchronous message process is that if the receiver application fails for any reason, the senders can continue unaffected. The sent messages simply accumulate in the message queue for later processing when the receiver restarts.
Salesforce provides asynchronous capability in the form of Change Data Capture / Platform Events with Pub/Sub API. To provide true message queueing for other integration scenarios, including orchestration, process choreography, and quality of service, a middleware solution is required. |
| Synchronous transport protocols | Synchronous transport protocols refer to protocols that support activities wherein a “single thread in the caller sends the request message, blocks to wait for the reply message, and then processes the reply....The request thread awaiting the response implies that there is only one outstanding request or that the reply channel for this request is private for this thread.” |
| Asynchronous transport protocols | Asynchronous transport protocols refer to protocols supporting activities wherein “one thread in the caller sends the request message and sets up a callback for the reply. A separate thread listens for reply messages. When a reply message arrives, the reply thread invokes the appropriate callback, which reestablishes the caller’s context and processes the reply. This approach enables multiple outstanding requests to share a single reply thread.” |
| Mediation routing | Mediation routing is the specification of a complex “flow” of messages from component to component. For example, many middleware-based solutions depend on a message queue system. While some implementations permit routing logic to be provided by the messaging layer itself, others depend on client applications to provide routing information or allow for a mix of both paradigms. In such complex cases, mediation on the part of middleware simplifies development, integration, and validation. A mediator ensures that the right message reaches the right consumer. |
| Process choreography and service orchestration | Process choreography and service orchestration are each forms of “service composition” where any number of endpoints and capabilities are being coordinated.
The difference between choreography and service orchestration is:
Choreography can be defined as an asynchronous approach that enables processes to work autonomously, removing any issues caused by dependencies which is behavior resulting from a group of interacting individual entities with no central authority.
Orchestration can be defined as a synchronous approach that enables the execution of a query or process by allowing each microservice to implement tasks assigned by the orchestrator which is behavior resulting from a central conductor coordinating the behaviors of individual entities performing tasks independent of each other.
In addition, an orchestration shows the complete behavior of each service whereas the choreography combines the interface behavior descriptions of each service. Portions of business process choreographies can be built in Flow Orchestration, Salesforce workflows or using Apex.
Salesforce native Flow Orchestration provides long running, multi-step processes with background, interactive, and MuleSoft steps. Its native capabilities can orchestrate without middleware, using built-in stage management and assignment routing.
We recommend implementing all complex cross-system orchestrations in the middleware layer to avoid Salesforce timeout and governor limits, especially in solutions that require true transaction handling. |
| Transactionality (encryption, signing, reliable delivery, transaction management) | Transactionality can be defined as the ability to support global transactions that encompass all necessary operations against each required resource. Transactionality implies the support of all four ACID properties, atomicity, consistency, isolation, durability, where atomicity guarantees all-or-nothing outcomes for the unit of work (transaction).
While Salesforce is transactional within itself, it’s not able to participate in distributed transactions or transactions initiated outside of Salesforce. Therefore, it’s assumed that for solutions requiring complex, multi-system transactions, transactionality and associated roll-back/compensation mechanisms are implemented at the middleware layer. |
| Routing | Routing can be defined as specifying the complex flow of messages from component to component. In modern services-based solutions, such message flows can be based on a number of criteria, including header, content type, rule, and priority.
For Salesforce integrations, it’s assumed that these criteria are met by the middleware layer or the endpoint, but message routing can be coded in Apex too. |
| Extract, transform, and load | Extract, transform, and load (ETL) refers to a process that involves:
Extracting data from the source systems. This process typically involves data from several source systems, and both relational and non-relational structures.
Transforming the data to fit operational needs, which can include data quality levels. The transform stage usually applies a series of rules or functions to the extracted data from the source to derive the data for loading into the end target(s).
Loading the data into the target system. The target system can vary widely from database, operational data store, data mart, data warehouse, or other operational systems.
While not strictly necessary, most mature ETL tools provide a change data capture capability. This capability is where the tool identifies records in the source system that have changed since the last extract, which reduces the amount of record processing.
Salesforce also supports Change Data Capture, which is the publishing of change events that represent changes to Salesforce records. With Change Data Capture, the client or external system receives near-real-time changes of Salesforce records. With this information, the client or external system can synchronize corresponding records in an external data store. |
| Long polling | Long polling, also called Comet programming, emulates an information push from a server to a client. Similar to a normal poll, the client connects and requests information from the server. However, instead of sending an empty response if information isn’t available, the server holds the request and waits until information is available (an event occurs). The server then sends a complete response to the client. The client then immediately re-requests information. The client continually maintains a connection to the server, so it’s always waiting to receive a response. If the server times out, the client connects again and starts over.
The Salesforce Streaming API uses the Bayeux protocol and CometD for long polling.
Bayeux is a protocol for transporting asynchronous messages, primarily over HTTP.
CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeux protocol.
This mechanism is a legacy way of integration. All new solutions should use Pub/Sub API. |
In addition to these integration tools, MuleSoft and Informatica provide foundational pillars for a modern, high-performance integration strategy. While both reside in the same ecosystem, they solve distinct architectural challenges. Leading enterprises deploy these platforms in tandem to create a comprehensive "[Better Together](/docs/architect/fundamentals/guide/integration-informatica-mulesoft.html)" framework that meets the full spectrum of data and application needs.
[MuleSoft](https://www.salesforce.com/mulesoft/) is Salesforce's leading integration platform. It enables organizations to connect applications, data, and devices across on-premises and cloud environments. MuleSoft gives IT the tools to unlock data across systems, develop scalable integration and automation frameworks, and create differentiated, connected experiences at speed. It can also connect a core org to an Anypoint instance in an API catalog to make MuleSoft APIs available for invocation in Apex, Flow, and Agentforce as actions. Anypoint Exchange has a number of prebuilt Salesforce connectors.
[Informatica](https://www.informatica.com/salesforce.html) is a leading enterprise data management and integration platform. It helps organizations collect, manage, integrate, and analyze data from diverse sources. It uses ETL (Extract, Transform, Load) processes to provide the connected, reliable data necessary to power modern analytics and autonomous AI agents.
## Remote Process Invocation — Request and Reply
**Context**
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. But, the Salesforce system doesn’t contain or process orders. After the order details are captured in Salesforce, the order is created in the remote system, which manages the order to conclusion.
When you implement this pattern, Salesforce calls the remote system to create the order and then waits for successful completion. If successful, the remote system synchronously replies with the order status and order number. As part of the same transaction, Salesforce updates the order number and status internally. The order number is used as a foreign key for subsequent updates to the remote system.
**Problem**
When an event occurs in Salesforce, how do you initiate a process in a remote system, pass the required information to that process, receive a response from the remote system, and then use that response data to make updates within Salesforce?
**Forces**
Consider the following forces when applying solutions based on this pattern.
- Does the call to the remote system require Salesforce to wait for a response before continuing processing? Is the call to the remote system a synchronous request-reply or an asynchronous request?
- If the call to the remote system is synchronous, does Salesforce have to process the response as part of the same transaction as the initial call?
- Is the message size small or large?
- Is the integration based on the occurrence of a specific event, such as a button click in the Salesforce user interface, or DML-based events?
- Is the remote endpoint able to respond to the request with low latency? How many users are likely to be executing this transaction during a peak period?
**Solution**
This table contains solutions to this integration problem.
| Solution | Fit | Comments |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| External Services invokes a REST API call | Best | External Services allows you to invoke an externally hosted service in a declarative manner (no code required). This feature is best used when the following conditions are met:
The externally hosted service is a RESTful service and the definitions are available in an OpenAPI 2.0 or OpenAPI 3.0 or YAML schema format.
The request and response definitions contain primitive data types such as boolean, datetime, double, integer, string, or an array of primitive data types. Nested object types, and send parameters such as headers within the HTTP requests are supported. Note: if the externally hosted service is RESTful, but OpenAPI spec is not available or viable, use Named Credentials in Apex to make the HTTP callout directly. Apex code will be needed to parse the results.
The transaction can be invoked from a flow.
|
| Salesforce Lightning—Lightning component or page initiates a synchronous Apex REST or SOAP callout. If the remote endpoint poses a risk of high latency response (refer to latest limits documentation for the applicable limits here), then an asynchronous callout, also called a continuation, is recommended to avoid hitting synchronous Apex transaction governor limits. | Best | Salesforce enables you to consume a WSDL and generate a resulting proxy Apex class. This class provides the necessary logic to call the remote service. Salesforce also enables you to invoke HTTP (REST) services using standard GET, POST, PUT, and DELETE methods. A user-initiated action on a Lightning page then calls an Apex controller action to execute this proxy Apex class to perform the remote call using Named Credentials. Lightning pages require customization of the Salesforce application. |
| HTTP Callout action in Flow | Good | This solution allows synchronous outbound REST calls declaratively from Flow without Apex and without the full External Services registration process.It’s a good fit for declarative implementation when a full OpenAPI specification isn’t available. |
| A synchronous trigger that’s invoked from Salesforce data changes performs an asynchronous Apex SOAP or HTTP callout. | Suboptimal | You can use Apex triggers to perform automation based on record data changes.An Apex proxy class can be executed as the result of a DML operation by using an Apex trigger. However, all calls made from within the trigger context must execute asynchronously from the initiating event. Therefore, this solution isn’t recommended for this integration problem. This solution is better suited for the Remote Process Invocation—Fire and Forget pattern. |
| A batch Apex job performs a synchronous Apex SOAP or HTTP callout. | Suboptimal | You can make calls to a remote system from a batch job. This solution allows batch remote process execution and processing of the response from the remote system in Salesforce. However, a given batch has limits to the number of calls. For more information, see [Governor Limits.](https://developer.salesforce.com/docs/atlas.en-us.integration_patterns_and_practices.meta/integration_patterns_and_practices/integ_pat_remote_process_invocation_state.htm#governor_limits_header) A given batch run can execute multiple transaction contexts (usually in intervals of 200 records). The governor limits are reset per transaction context. | |
**Sketch**
This diagram illustrates a synchronous remote process invocation using Apex calls.
**Salesforce Calling Out to a Remote System**

In this scenario:
- An action is initiated on the Lightning page (for example, a button click).
- The browser (via a client-side controller in the case of a Lightning component) performs an HTTP POST that in turn performs an action on the corresponding Apex controller.
- The controller invokes the actual call to the remote web service.
- The response from the remote system is returned to the Apex controller. The controller processes the response, updates data in Salesforce as required, and re-renders the page.
In cases where the subsequent state must be tracked, the remote system returns a unique identifier that’s stored in the Salesforce record.
**Results**
The application of the solutions related to this pattern allows for event-initiated remote process invocations in which Salesforce handles the processing.
**Calling Mechanisms**
The calling mechanism depends on the solution chosen to implement this pattern.
Calling Mechanism
Description
Enhanced External service embedded in a flow or
Lightning component or
Apex controllers
Used when the remote process is triggered as part of an end-to-end process involving the user interface, and the result must be displayed or updated in a Salesforce record. For example, the submission of a credit card payment to an external payment gateway and the payment results are immediately returned and displayed to the user.
Apex triggers
Used primarily for invocation of remote processes using Apex callouts from DML-initiated events. For more information about this calling mechanism, see pattern Remote Process Invocation—Fire and Forget.
**Error Handling and Recovery**
It’s important to include an error handling and recovery strategy as part of the overall solution.
- **Error handling:** When an error occurs (exceptions or error codes are returned to the caller), the caller manages error handling. For example, an error message displayed on the end user’s page or logged to a table requiring further action.
- **Recovery:** Changes aren’t committed to Salesforce until the caller receives a successful response. For example, the order status isn’t updated in the database until a response that indicates success is received. If necessary, the caller can retry the operation.
**Idempotent Design Considerations**
Idempotent capabilities guarantee that repeated invocations are safe. If idempotency isn’t implemented, repeated invocations of the same message can have different results, potentially resulting in data integrity issues. Potential issues include the creation of duplicate records or duplicate processing of transactions.
It’s important to ensure that the remote procedure being called is idempotent. If the call is made by the user interface, handle idempotency at the integration layer especially if there is no guarantee that Salesforce will only invoke the call once.
The most typical method of building an idempotent receiver is for it to track duplicates based on unique message identifiers sent by the consumer. Apex web service or REST calls must be customized to send a unique message ID.
In addition, operations that create records in the remote system must check for duplicates before inserting. Check by passing a unique record ID from Salesforce. If the record exists in the remote system, update the record. In most systems, this operation is termed as an upsert operation.
**Security Considerations**
Any call to a remote system must maintain the confidentiality, integrity, and availability of the request. The following security considerations are specific to using Apex SOAP and HTTP calls in this pattern.
- One-way SSL is enabled by default, but two-way SSL is supported with both self-signed and CA-signed certificates to maintain authenticity of both the client and server.
- To streamline your Apex code and simplify the setup of authenticated callouts, specify a named credential in the callout endpoint.
- Consider the use of OAuth 2.0 as the authentication mechanism for integration to external systems.
- Where necessary, consider using one-way hashes or digital signatures using the Apex Crypto class methods to ensure request integrity.
- The remote system must be protected by implementing the appropriate firewall mechanisms. See [Security Considerations](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations).
- Salesforce currently doesn’t support WS-Security. While it does not natively generate these complex WS-Security headers or automatically enforce them from an incoming WSDL, you can manually construct and implement them by creating custom Apex classes to handle the SOAP headers and security tokens for incoming requests.
**Sidebars**
None.
**Timeliness**
Timeliness is of significant importance in this pattern. Usually:
- The request is typically invoked from the user interface, so the process must not keep the user waiting.
- Salesforce has a configurable timeout of up to 120 seconds for calls from Apex.
- Completion of the remote process is executed in a timely manner to conclude within the Salesforce timeout limit and within user expectations.
- External calls are subject to Apex synchronous transaction governor limits, so make sure to mitigate the risk of instantiating more than 50 transactions that run for more than five seconds each. In addition to ensuring the external endpoint is performant, options to mitigate the risk of a timeout include:
- Setting the timeout of the external callout to five seconds.
- Using a continuation in Lightning Components to handle long-running transactions
**Data Volumes**
This pattern is used primarily for small volume, real-time activities, due to the small timeout values and maximum size of the request or response for the Apex call solution. Don’t use this pattern in batch processing activities in which the data payload is contained in the message.
**Endpoint Capability and Standards Support**
The capability and standard support for the endpoint depends on the solution that you choose.
| Solution | Endpoint Considerations |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Apex HTTP callouts | The endpoint must be able to receive HTTP calls. Salesforce must be able to access the endpoint over the public Internet. For private and secure communications, Salesforce also supports Salesforce Private Connect through the Hyperforce platform. See Salesforce Private Connect for more details.
You can use Apex HTTP callouts to call REST services using the standard GET, POST, PUT, DELETE, and PATCH methods. Use Named Credentials to define the endpoint and the required authentication, and do not implement your own authentication mechanism. |
| Apex SOAP callouts | The endpoint must be able to receive HTTP calls. Salesforce must be able to access the endpoint over the public Internet. For private and secure communications, Salesforce also supports Salesforce Private Connect through the Hyperforce platform. See Salesforce Private Connect for more details.
This solution requires that the remote system is compatible with the standards supported by Salesforce. The web service standards currently supported by Salesforce for Apex SOAP callouts are:
WSDL 1.1
SOAP 1.1
WSI-Basic Profile 1.1
|
**State Management**
When integrating systems, keys are important for ongoing state tracking. There are two options.
- Salesforce stores the remote system’s primary or unique surrogate key for the remote record.
- The remote system stores the Salesforce unique record ID or some other unique surrogate key.
There are specific considerations for handling integration keys, depending on which system contains the master record, as shown in the following table.
| Master | System Description |
| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce | The remote system stores either the Salesforce RecordId or some other unique surrogate key from the record. |
| Remote system | The call to the remote process returns the unique key from the application, and Salesforce stores that key value in a unique record field. |
**Complex Integration Scenarios**
In certain cases, the solution prescribed by this pattern can require the implementation of several complex integration scenarios. This is best served by using middleware or having Salesforce call a composite service. These scenarios include:
- Orchestration of business processes and rules involving complex flow logic
- Aggregation of calls and their results across calls to multiple systems
- Transformation of both inbound and outbound messages
- Maintaining transactional integrity across calls to multiple systems
**Governor Limits**
For information about Apex limits, see [_Execution Governors and Limits_](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) in the Apex Developer Guide.
**Middleware Capabilities**
The following table highlights the desirable properties of a middleware system that participates in this pattern.
| Property | Mandatory | Desirable | Not Required |
| :-------------------------------------------------------------------------------- | :-------- | :-------- | :----------- |
| Event handling | | X | |
| Protocol conversion | | X | |
| Translation and transformation | | X | |
| Queuing and buffering | | X | |
| Synchronous transport protocols | X | | |
| Asynchronous transport protocols | | | X |
| Mediation routing | | X | |
| Process choreography and service orchestration | | X | |
| Transactionality (encryption, signing, reliable delivery, transaction management) | | X | |
| Routing | | | X |
| Extract, transform, and load | | | X |
| Long polling | | | X |
| gRPC support (for Pub/Sub API) | | | X |
**Example**
A utility company uses Salesforce and has a separate system that contains customer billing information. As part of the ordering process, new billing accounts must be created in the billing system. Salesforce should reflect the billing account number within the order activation process. The company has an existing REST API that allows the creation of a billing account and returns the billing account number as a response.
This requirement can be accomplished with the following approach.
- Salesforce consumes the billing account HTTP API as an external service or Flow HTTP Callout. We should only use an Apex proxy class for SOAP service consumption if the billing system provides only SOAP based services and no HTTP APIs.
- Customer information is passed to the external HTTP API object.
- The External Service or HTTP Flow Callout returns the response of HTTP API which can be stored in Salesforce objects.
This example demonstrates that:
- The customer state is tracked with an account number stored on the Salesforce account object.
- The caller subsequently processes the reply message.
## Remote Process Invocation — Fire and Forget
**Context**
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. However, as a part of the order management processes, a billing account needs to be created in the billing system for the order.
When you implement this pattern, Salesforce calls the remote system to create the billing account, but doesn’t wait for the call’s successful completion. The remote system can optionally update Salesforce with the new billing account created in a separate transaction.
**Problem**
When an event occurs in Salesforce, how do you initiate a process in a remote system and pass the required information to that process without waiting for a response from the remote system?
**Forces**
Consider the following forces when applying solutions based on this pattern.
- Does the call to the remote system require Salesforce to wait for a response before continuing processing? Is the call to the remote system synchronous or asynchronous?
- If the call to the remote system is synchronous, does the response need to be processed by Salesforce as part of the same transaction as the call?
- Is the message size small?
- Is the integration based on the occurrence of a specific event, such as a button click in the Salesforce user interface, or DML-based events?
- Is guaranteed message delivery from Salesforce to the remote system a requirement?
- Is the remote system able to participate in a contract-first integration in which Salesforce specifies the contract? In some solution variants (for example, outbound messaging), Salesforce specifies a contract that the remote system endpoint implements.
- Does the endpoint or the Enterprise Service Bus (ESB) support long polling?
- Are declarative configuration methods preferred over custom Apex development? In this case, solutions such as platform events are preferred over Apex callouts.
**Solution**
The following table contains solutions to this integration problem.
| Solution | Fit | Comments |
| ----------------------------------------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Flow-driven platform events | Best | Create flows declaratively to implement platform events. The recommended solution is when the remote process is invoked from an insert or update event.
Platform events are the event messages (or notifications) that your apps send and receive to take further action. Platform events simplify the process of communicating changes and responding to them without writing complex logic. One or more subscribers can listen to the same event and carry out actions.
For example, a software system can send events containing information about printer ink cartridges. Subscribers can subscribe to the events to monitor printer ink levels and place orders to replace cartridges with low ink levels.
External apps can listen to event messages by using the Salesforce Pub/Sub API, which is based on gRPC and HTTP/2.
Salesforce also supports Platform Event-Triggered Flows, which effectively allows creating a listener using the Flow Builder interface. This type of flow starts automatically when a specific platform event message is published to the Salesforce Event Bus. |
| Pub/Sub API | Best | The Pub/Sub API is the recommended way for external consumers to consume the events on the Event Bus.
The gRPC-based Pub/Sub API:
Supports both publishing and subscribing to platform events from external applications
Is available with proper authentication (OAuth, JWT, or session tokens)
|
| Change Data Capture | Best | Change Data Capture (CDC) publishes events for changes in Salesforce records corresponding to create, update, delete, and undelete operations. Enabling Change Data Capture (CDC) in Salesforce is a purely declarative process, requiring no Apex code.
Notification messages are sent to the event bus to which clients can subscribe using Pub/Sub API or Apex triggers. Event-driven systems streamline the communication between distributed enterprise systems, increase scalability, and deliver real-time data.
For example, if order information resides in both your ERP system and Salesforce, you can stream order change events from Salesforce to an integration app. The app then synchronizes the changes in the ERP system. |
| Event Relay | Best (with AWS integrations) | Salesforce Event Relay provides a serverless, low-code, real-time integration to stream Salesforce Platform Events and Change Data Capture (CDC) events directly to Amazon EventBridge. Salesforce Event Relays send these events from Salesforce to Amazon Web Services (AWS), and achieve end-to-end event flow by sending events back to Salesforce. With Event Relay, we can stream events to AWS natively without writing an integration app. |
| Omnistudio Integration Procedures | Good | Use Omnistudio Integration Procedures to declaratively automate data interactions between Salesforce and external third-party applications. Integration Procedures handle complex data transformations, API calls, and event-driven automation, and they can execute multiple actions in a single server call.
Use Integration Procedures when no user interaction is required during the execution, and you want to:
Retrieve, transform, and send data between Salesforce and external systems
Offload processing to the server to improve performance and scalability
Bundle multiple operations in a single server transaction
Enable data caching for frequently accessed information
Check out more detail on Integration Procedures here. |
| Customization-driven platform events | Good | Similar to Flow-driven platform events, but the events are created by Apex triggers or classes. You can publish and consume platform events by using Apex or an API.
Platform events integrate with the Salesforce platform through Apex triggers. Triggers are the event consumers on the Salesforce platform that listen to event messages.
When an external app uses the API or a native Salesforce app uses Apex to publish the event message, a trigger on that event is fired. Triggers run the actions in response to the event notifications. |
| Flow-driven outbound messaging | Suboptimal | This is a legacy way of integration and can be used when the remote process is invoked from an insert or update event. Salesforce provides this flow-driven outbound messaging capability to send SOAP messages to remote systems triggered by an insert or update operation in Salesforce. These messages are sent asynchronously and are independent of the Salesforce user interface.
The outbound message is sent to a specific remote endpoint. The remote service must be able to participate in a contract-first integration where Salesforce provides the contract.
On receipt of the message, if the remote service doesn’t respond with a positive acknowledgment, Salesforce retries sending the message, providing a form of guaranteed delivery.
This is a legacy way of integration. All new solutions should use Flow with Pub/Sub API. |
| Custom Lightning component that initiates an Apex SOAP or HTTP asynchronous callout | Suboptimal | This solution is typically used in user interface-based scenarios, but does require customization. In addition, the solution must handle guaranteed delivery of the message in the code.
Similar to the solution for the Remote Process Invocation—Request and Reply pattern solution that specifies using a Lightning component, together with an Apex callout using Named Credentials. The difference is that in this pattern, Salesforce doesn't wait for the request to complete before handing off control to the user.
After receiving the message, the remote system responds and indicates receipt of the message, then asynchronously processes the message. The remote system hands control back to Salesforce before it begins to process the message; therefore, Salesforce doesn’t have to wait for processing to complete. |
| Apex Triggers to make Apex SOAP or HTTP asynchronous callout | Suboptimal | You can use Apex triggers to perform automation based on record data changes.
An Apex proxy class can be executed as the result of a DML operation by using an Apex trigger. However, all calls made from within the trigger context must be executed asynchronously. |
| Apex Triggers to make Apex SOAP or HTTP asynchronous callout | Suboptimal | Calls to a remote system can be performed from a batch job. This solution allows for batch remote process execution and for processing of the response from the remote system in Salesforce. However, there are limits to the number of calls for a given batch context. For more information, see the Salesforce Developer Limits and Allocations Quick Reference. |
**Sketch**
The following diagram illustrates a call from Salesforce to a remote system in which creating or updating operations on a record trigger the call.

[Download Diagram](https://a.sfdcstatic.com/developer-website/prod/assets/architect/pdf/integration-patterns/Integration%20Patterns%20-%20Fire%20and%20Forget.pdf)
In this scenario:
- A remote system subscribes to the platform event.
- An update or insert occurs on a given set of records in Salesforce.
- A Salesforce Flow triggers when a set of conditions is met.
- This flow creates a platform event.
- The remote listener receives the event message, and places the message on a local queue.
- The queuing application forwards the message to the remote application for processing.
In the case where the remote system must perform operations against Salesforce, you can implement an optional callback operation.
**Results**
The application of the solutions related to this pattern allows for:
- User interface–initiated remote process invocations in which the result of the transaction can be displayed to the end user
- DML event-initiated remote process invocations in which the result of the transaction can be processed by the calling process
**Calling Mechanisms**
The calling mechanism depends on the solution chosen to implement this pattern.
| Calling Mechanism | Description |
| :--------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Flow | Used by both the process-driven and customization-driven solutions. Events trigger the Salesforce process, which can then publish a platform event for subscription by a remote system. |
| Pub/Sub API | Pub/Sub API provides a single interface for publishing and subscribing to platform events, including real-time event monitoring events, and change data capture events. Based on gRPC and HTTP/2, Pub/Sub API efficiently publishes and delivers binary event messages in the Apache Avro format. |
| Change Data Capture | Salesforce Change Data Capture publishes change events, which represent changes to Salesforce records. Changes include creation of a new record, updates to an existing record, deletion of a record, and undeletion of a record. |
| Lightning component and Apex controllers | Used to invoke a remote process asynchronously using an Apex callout. |
| Apex triggers | Used for trigger-driven platform events and invocation of remote processes, using Apex callouts from DML-initiated events. |
| Apex batch classes | Used for invocation of remote processes in batch mode. |
**Error Handling and Recovery**
An error handling and recovery strategy must be considered as part of the overall solution. The best method depends on the solution you choose.
| Solution | Error Handling and Recovery Strategy |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Flow |
Error handling — In certain conditions flows can fail to process completely. When a process or flow interview fails, a detailed email is sent to the admin who last modified the process or flow. Modify the default behavior by adding fault paths to all elements that can fail. This behaviour should be enhanced to put in custom behavior such as creating a case or writing errors to a custom object that can be monitored and tracked.
Recovery — Recovery is more complex in this scenario. A custom retry mechanism must be created if quality-of-service requirements dictate it.
|
| Apex callouts using Named Credentials |
Error handling — The remote system hands off invocation of the end process, so the callout only handles exceptions in the initial invocation of the remote service. For example, a timeout event is triggered if no positive acknowledgment is received from the remote callout. The remote system must handle subsequent errors when the initial invocation is handed off for asynchronous processing.
Recovery — Recovery is more complex in this scenario. A custom retry mechanism must be created if quality-of-service requirements dictate it.
|
| Change Data Capture (CDC) / Platform Events |
Error handling — Error handling must be performed by the remote service because the event is effectively handed off to the remote systems for further processing. Because this pattern is asynchronous, the remote system handles message queuing, processing, and error handling. Additionally, platform events aren’t processed within database transactions. As a result, published platform events can’t be rolled back within a transaction.
Recovery — Because this pattern is asynchronous, the remote system must initiate retries based on the service’s quality-of-service requirements. The replay ID associated with each event is atomic and increases with every published event. This ID can be used to replay the stream from a specific event (for example, based upon the last successfully captured event). High-volume platform event messages are stored for 72 hours (three days). You can retrieve past event messages when using Pub/Sub APIs to subscribe to a channel.
|
**Idempotent Design Considerations**
Platform events are only published to the bus once. There is no retry on the Salesforce side. It is up to the ESB to request that the events be replayed. In a replay, the platform event’s replay ID remains the same and the ESB can try duplicate messages based on the replay ID.
The [idempotent design considerations](/docs/architect/fundamentals/guide/integration-patterns.html#remote-process-invocation--request-and-reply) in the Remote Process Invocation—Request and Reply pattern also apply to this pattern.
**Security Considerations**
Any call to a remote system must maintain the confidentiality, integrity, and availability of the request. Different security considerations apply, depending on the solution you choose.
| Solution | Security Considerations |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Apex callouts using Named Credentials | A call to a remote system must maintain the confidentiality, integrity, and availability of the request. The following are security considerations specific to using Apex SOAP and HTTP calls in this pattern.
One-way SSL is enabled by default, but two-way SSL is supported with both self-signed and CA-signed certificates to maintain authenticity of both the client and server.
Salesforce does not support WS-Security when generating the Apex proxy class.
Where necessary, consider using one-way hashes or digital signatures using the Apex Crypto class methods to ensure the integrity of the request.
The remote system must be protected by implementing the appropriate firewall mechanisms.
|
| Change Data Capture (CDC) / Platform Events | For platform events the subscribing external system must be able to authenticate to the Salesforce Streaming API.
Platform events conform to the existing security model configured in the Salesforce org. To subscribe to an event, the user needs read access to the event entity. To publish an event, the user needs “create” permission on the event entity. |
See [Security Considerations.](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations)
**Sidebars**
None.
**Timeliness**
Timeliness is less of a factor with the fire-and-forget pattern. Control is handed back to the client either immediately or after positive acknowledgment of a successful hand-off to the remote system. For platform events, Salesforce sends the events to the event bus and doesn’t wait for a confirmation or acknowledgment from the subscriber. If the subscriber doesn’t pick up the message, the subscriber can request to replay the event using the event reply ID. High-volume event messages are stored for 72 hours (three days). To retrieve past event messages, use Pub/Sub APIs to subscribe to a channel.
**Data Volumes**
Data volume considerations depend on which solution you choose. For the limits of each solution, see the [Salesforce Limits Quick Reference.](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_overview.htm)
**Endpoint Capability and Standards Support**
The capability and standard support for the endpoint depends on the solution that you choose.
| Solution | Endpoint Considerations |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Apex SOAP callouts | The endpoint must be able to process a web service call via HTTP. Salesforce must be able to access the endpoint over the public Internet. This solution requires that the remote system is compatible with the standards supported by Salesforce. At the time of writing, the web service standards supported by Salesforce for Apex SOAP callouts are:
WSDL 1.1
SOAP 1.1
WSI-Basic Profile 1.1
HTTP
|
| Apex HTTP callouts | The endpoint must be able to receive HTTP calls and be accessible over the public internet by Salesforce.
Apex HTTP callouts can be used to call RESTful services using the standard GET, POST, PUT, and DELETE methods. |
| Change Data Capture (CDC) / Platform Events |
Triggers and flows can subscribe to events. You can receive event notifications regardless of how they were published.
|
**State Management**
When integrating systems, unique record identifiers are important for ongoing state tracking. For example, if a record is created in the remote system, you have two options.
- Salesforce stores the remote system’s primary or unique surrogate key for the remote record.
- The remote system stores the Salesforce unique record ID or some other unique surrogate key.
The following table lists considerations for state management in this pattern.
| Master | System Description |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce | The remote system must store either the Salesforce RecordId or some other unique surrogate key in the Salesforce record. |
| Remote system | Salesforce must store a reference to the unique identifier in the remote system. Because the process is asynchronous, storing this unique identifier can’t be part of the original transaction.
Salesforce must provide a unique ID in the call to the remote process. The remote system must then call back to Salesforce to update the record in Salesforce with the remote system’s unique identifier, using the Salesforce unique ID.
The callback implies specific state handling in the remote application to store the Salesforce unique identifier for that transaction to use for the callback when processing is complete, or the Salesforce unique identifier is stored on the remote system’s record. |
**Complex Integration Scenarios**
Each solution in this pattern has different considerations for complex integration scenarios such as transformation and process orchestration.
| Solution | Considerations |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Apex callouts using Named Credentials | In certain cases, solutions prescribed by this pattern require implementing several complex integration scenarios best served using middleware or having Salesforce call a composite service. These scenarios include:
Orchestration of business processes and rules involving complex flow logic
Aggregation of calls and their results across calls to multiple systems
Transformation of both inbound and outbound messages
Maintaining transactional integrity across calls to multiple systems
|
| Change Data Capture (CDC) / Platform Events | Given the static, declarative nature of events, no complex integration scenarios, such as aggregation, orchestration, or transformation can be performed in Salesforce. The remote system or middleware must handle these types of operations. |
| OmniStudio Integration Procedures | Integration Procedures (OmniStudio) provide server‑side, stateless orchestration to coordinate multiple back‑end services while performing complex, declarative data transformations.
Integration Procedures chain steps like HTTP Actions, DataRaptor Extract/Transform/Load, Set Values, Loop/If, and Matrix lookups to normalize, enrich, aggregate, and map payloads between UI contracts and disparate APIs.
They support robust runtime controls like conditional branching, pagination, timeouts, retries, partial‑failure handling, and continue‑on‑error, as well as performance optimizations like server‑side caching and response shaping.
IPs can be invoked synchronously from OmniScripts, or headlessly via REST, enabling reusable, versioned “integration façades” that hide back‑end complexity from channels. |
**Governor Limits**
Due to the multitenant nature of the Salesforce platform, there are limits to outbound callouts. Limits depend on the type of outbound call and the timing of the call.
For limits and allocations that apply to platform events, see the [Platforms Events Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.256.0.platform_events.meta/platform_events/platform_events_intro.htm).
**Reliable Messaging**
Reliable messaging attempts to resolve the issue of guaranteeing the delivery of a message to a remote system in which the individual components are unreliable. The method of ensuring receipt of a message by the remote system depends on the solution you choose.
In case of Salesforce Change Data Capture types of change events are provided to handle special situations, such as capturing changes not caught in the Salesforce application servers, or handling high loads of changes.
In some cases, Salesforce sends Gap events instead of change events to inform subscribers about errors, or if it’s not possible to generate change events. A gap event contains information about the change in the header, such as the change type and record ID. It doesn’t include details about the change, such as record fields. To capture changes more efficiently, Overflow events are generated for single transactions that exceed a threshold. For more information please see [here](https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_other_events.htm).
| Solution | Reliable Messaging Considerations |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Apex callouts using Named Credentials | Salesforce doesn’t provide explicit support for reliable messaging protocols (for example, WS-ReliableMessaging). We recommend that the remote endpoint receiving the Salesforce message implement a reliable messaging system, like JMS or MQ. This system ensures full end-to-end guaranteed delivery to the remote system that ultimately processes the message. However, this system doesn’t ensure guaranteed delivery from Salesforce to the remote endpoint that it calls.
Guaranteed delivery must be handled through customizations to Salesforce. Specific techniques, such as processing a positive acknowledgment from the remote endpoint in addition to custom retry logic, must be implemented. |
| Change Data Capture (CDC) / Platform Events | Platform Events attempts to provide reliable messaging by temporarily persisting event messages in the event bus. Subscribers can catch up on missed event messages by replaying messages from the event bus using the Replay ID of event messages.
The event bus is a distributed system and doesn’t have the same guarantees as a transactional database. As a result, Salesforce can’t provide a synchronous response for an event publish request. Events are queued and buffered, and Salesforce attempts to publish the events asynchronously. In rare cases, the event message might not be persisted in the distributed system during the initial or subsequent attempts. This means that the events aren’t delivered to subscribers, and they aren’t recoverable. |
| | |
**Middleware Capabilities**
The following table highlights the desirable properties of a middleware system that participates in this pattern.
| Property | Mandatory | Desirable | Not Required |
| :-------------------------------------------------------------------------------- | :----------------------------- | :-------- | :----------- |
| Event handling | | X | |
| Protocol conversion | | X | |
| Translation and transformation | | X | |
| Queuing and buffering | X | | |
| Synchronous transport protocols | | | X |
| Asynchronous transport protocols | X | | |
| Mediation routing | | X | |
| Process choreography and service orchestration | | X | |
| Transactionality (encryption, signing, reliable delivery, transaction management) | X | | |
| Routing | | | X |
| Extract, transform, and load | | | X |
| Long polling | X (required for Streaming API) | | |
| gRPC support (for Pub/Sub API) | X | | |
**Solution Variant: Platform Events Publishing Behavior and Transactions**
When platform event messages are published immediately, event publishing doesn't respect transaction boundaries of the publishing process. Event messages can be published before the transaction completes or even if a transaction fails. This behavior can lead to issues when a subscriber expects to find data that the publishing transaction commits. The data might not be present when the subscriber receives the event message. To solve this issue, set the platform event publish behavior to Publish After Commit in the event definition. The publish behaviors you can set in a platform event definition are:
- Publish After Commit to have the event message published only after a transaction commits successfully. Select this option if subscribers rely on data that the publishing transaction commits. For example, a process publishes an event message and creates a task record. A second process that is subscribed to the event is fired and expects to find the task record. Another reason for choosing this behavior is when you don’t want the event message to be published if the transaction fails.
- Publish Immediately to have the event message published when the publish call executes. Select this option if you want the event message to be published regardless of whether the transaction succeeds. Also choose this option if the publisher and subscribers are independent, and subscribers don’t rely on data committed by the publisher. For example, the immediate publishing behavior is suitable for an event used for logging purposes. With this option, a subscriber might receive the event message before data is committed by the publisher transaction.
**Example**
A telecommunications company wants to use Salesforce as a front end for creating accounts using the lead-to-opportunity process. An order is created in Salesforce when the opportunity is closed and won, but the back-end ERP system is the data master. The order must be saved to the Salesforce opportunity record, and the opportunity status changed to indicate that the order was created.
The following constraints apply.
- Only declarative development can be implemented.
- You don’t require immediate notification of the order number after the opportunity converts to an order.
- The organization has the capability to support gRPC and HTTP2 so that Salesforce Pub/Sub APIs can be used to subscribe to platform events.
This example is best implemented using Salesforce platform events, but does require that the ESB subscribes to the platform event.
On the Salesforce side:
- Create a Flow to initiate the platform event (for example, when the opportunity status changes to Close-Won).
- Create a new platform event which publishes the opportunity details.
On the remote system side:
- The integration tools (for example, ESB) subscribe to the Salesforce platform event using the Pub/Sub API.
- The ESB receives one or more notifications indicating that the opportunity is to be converted to an order.
- The ESB forwards the message to the back-end ERP system so that the order can be created.
- After the order is created in the ERP system, a separate thread calls back to Salesforce using the OAuth 2.0 with a connected app. The callback updates the opportunity with the order number and status. You can do this callback using documented pattern solutions, such as Salesforce platform events, Salesforce SOAP API, REST API, or an Apex web service.
This example demonstrates the following.
- Implementation of a remote process invoked asynchronously
- End-to-end guaranteed delivery
- Subsequent callback to Salesforce to update the state of the record
## Batch Data Synchronization
**Context**
You’re moving your CRM implementation to Salesforce and want to:
- Extract and transform accounts, contacts, and opportunities from the current CRM system and load the data into Salesforce (initial data import).
- Extract, transform, and load customer billing data into Salesforce from a remote system on a weekly basis (ongoing).
- Extract customer activity information from Salesforce and import it into an on-premises data warehouse on a weekly basis (ongoing).
**Problem**
How do you import data into Salesforce and export data out of Salesforce, taking into consideration that these imports and exports can interfere with end-user operations during business hours, and involve large amounts of data?
**Forces**
There are various forces to consider when applying solutions based on this pattern:
- Should the data be stored in Salesforce? If not, there are other integration options an architect can and should consider (mashups, for example).
- If the data should be stored in Salesforce, should the data be refreshed in response to an event in the remote system?
- Should the data be refreshed on a scheduled basis?
- Does the data support primary business processes?
- Are there analytics (reporting) requirements that are impacted by the availability of this data in Salesforce?
**Solution**
The following table contains various solutions to this integration problem.
| Solution | Fit | Data master | Comments |
| ----------------------------------------- | ---------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Replication via third-party ETL tool | Best | Remote system | Where an external system needs to send a large amount of data into Salesforce leverage a third-party ETL tool that allows you to run change data capture against source data.
The tool reacts to changes in the source data set, transforms the data, and then calls Salesforce Bulk API to issue DML statements. This can also be implemented using the Salesforce REST APIs if the number of records is less. |
| Replication via third-party ETL tool | Good | Salesforce | Leverage a third-party ETL tool that allows you to run change data capture against ERP and Salesforce data sets.
In this solution, Salesforce is the data source, and you can use time/status information on individual rows to query the data and filter the target result set. This can be implemented by using bulk API 2.0 or standard REST APIs (if the number of records is less). |
| Data 360 and Data Actions and Activations | Best | Data 360 | Move data between orgs using Data 360 actions and activations. After data is ingested from different orgs into Data 360, data actions and activations can sync the data to another org. This approach can be very useful for integrations with Marketing Cloud orgs. |
| Data 360, Data Graphs and Connect APIs | Best | Data 360 | Extract and move data using MuleSoft Anypoint. MuleSoft A nypoint can be used to extract data from Data 360 using Connect API and Data Graph API and move it to another Salesforce org. Without Data 360, MuleSoft Anypoint can also be used when data needs to be moved between orgs without being replicated in Data 360. |
| Composite Graph API | Best | Salesforce | The composite graph resource lets you submit composite graph operations. This resource is available in REST API version 50.0 and later.
Composite Graph API can support up to 75 graphs in one payload and maximum 500 nodes in one graph. |
| Data Import Wizard and Data Loader | Fit | Salesforce / External System | Data Import Wizard and Data Loader can be used to import, export and migrate data. While Data Loader commands can also be scripted to automate the import and export of data, the command-line interface is for Windows only. Neither of these tools is a recommended base for a data integration strategy. They should, instead, complement your data stewardship and maintenance strategy.
For more information, see the Data Loader documentation. |
| Remote call-in | Suboptimal | Remote system | It’s possible for a remote system to call into Salesforce by using one of the APIs and perform updates to data as they occur. However, this causes considerable on-going traffic between the two systems.
Greater emphasis should be placed on error handling and locking. This pattern has the potential for causing continual updates, which has the potential to impact performance for end users. |
| Remote process invocation | Suboptimal | Salesforce | It’s possible for Salesforce to call into a remote system and perform updates to data as they occur. However, this causes considerable on-going traffic between the two systems.
Greater emphasis should be placed on error handling and locking. This pattern has the potential for causing continual updates, which has the potential to impact performance for end users. |
**Sketch**
The following diagram illustrates the sequence of events in this pattern, where Salesforce is the data master.

The following diagram illustrates the subsequent synchronization of events in near real time, where Salesforce is the data master.

**Results**
You can integrate data that’s sourced externally with Salesforce under the following scenarios:
- **The external system is the data master:** Salesforce is a consumer of data provided by a single source system or multiple systems. In this scenario, it’s common to have a data warehouse or data mart that aggregates the data before the data is imported into Salesforce.
- **Salesforce is the data master:** Salesforce is the system of record for certain entities and Salesforce Change Data Capture client applications can be informed of changes to Salesforce data.
In a typical Salesforce integration scenario, the implementation team does one of the following:
- Implement change data capture on the source data set.
- Implement a set of supporting database structures, known as control tables, in an intermediate, on-premises database.
The ETL tool creates programs that will:
- Read a control table to determine the last run time of the job and extract any other control values needed.
- Use the above control values as filters and query the source data set.
- Apply predefined processing rules, including validation, enrichment, and so on.
- Use available connectors/transformation capabilities of the ETL tool to create the destination data set.
- Write the data set to Salesforce objects.
- If processing is successful, update the control values in the control table.
- If processing fails, update the control tables with values that enable a restart and exit.
**Note**: We recommend that you create the control tables and associated data structures in an environment that the ETL tool has access to even if access to Salesforce isn’t available. This provides adequate levels of resilience. Salesforce should be treated as a spoke in this process and the ETL infrastructure is the hub.
For an ETL tool to gain maximum benefit from data synchronization capabilities, consider the following:
- Chain and sequence the ETL jobs to provide a cohesive process.
- Use primary keys from both systems to match incoming data.
- Use specific API methods to extract only updated data.
- If importing child records in a master-detail or lookup relationship, group the imported data using its parent key at the source to avoid locking. For example, if you’re importing contact data, be sure to group the contact data by the parent account key so the maximum number of contacts for a single account can be loaded in one API call. Failure to group the imported data usually results in the first contact record being loaded and subsequent contact records for that account to fail in the context of the API call.
- Any post-import processing, such as triggers, should only process data selectively.
- If your scenario involves large data volumes, follow the best practices from this Trailhead module [Best Practices for Deployments with Large Data Volumes](https://developer.salesforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes)
**Error Handling and Recovery**
An error handling and recovery strategy must be considered as part of the overall solution. The best method depends on the solution you choose.
| Error location | Error handling and recovery strategy |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Read from Salesforce using Change Data Capture |
Error handling—Error handling must be performed in the remote service because the event is effectively handed off to the remote system for further processing. Because this pattern is asynchronous, the remote system handles message queuing, processing, and error handling. Additionally, Change Data Capture events aren’t processed within database transactions. As a result, published events can’t be rolled back within a transaction.
Recovery—Because this pattern is asynchronous, the remote system must initiate retries based on the service’s quality of service requirements. The replay ID associated with each Change Data Capture event is atomic and increases with every event published. This ID can be used to replay the stream from a specific event (for example, based upon the last successfully captured event). High-volume platform event messages are stored for 72 hours (3 days). You can retrieve past event messages when using Pub/Sub API clients to subscribe to a channel.
|
| Read from Salesforce using a 3rd party ETL system |
Error handling—If an error occurs during a read operation, implement a retry for errors that aren’t infrastructure-related. In the event of repeated failure, standard processing using control tables/error tables should be implemented in the context of an ETL operation to:
Log the error
Retry the read operation
Terminate if unsuccessful
Send a notification
Recovery— Restart the ETL process to recover from a failed write operation.
If the operation succeeds but there are failed records, an immediate restart or subsequent execution of the job should address the issue. In this case, a delayed restart might be a better solution because it allows time to triage and correct data that might be causing the errors. |
| Write to Salesforce |
Error handling—Errors that occur during a write operation can result from a combination of factors in the application. The API calls return a result set that consists of the information listed below. This information should be used to retry the write operation (if necessary).
Record identifying information
Success/failure notification
A collection of errors for each record
Recovery—Restart the ETL process to recover from a failed read operation.
If the operation succeeds but there are failed records, an immediate restart or subsequent execution of the job should address the issue. In this case, a delayed restart might be a better solution because it allows time to triage and correct data that might be causing the errors. |
| External master system | Errors should be handled in accordance with the best practices of the master system. |
**Security Considerations**
Any call to a remote system must maintain the confidentiality, integrity, and availability of the request. Different security considerations apply, depending on the solution you choose.
- Authenticated API access to the Salesforce API requires a Lightning Platform license with at least API-Only user permissions.
- We recommend that standard encryption be used to keep password access secure.
- Use the HTTPS protocol when making calls to the Salesforce APIs. You can also proxy traffic to the Salesforce APIs through an on-premises security solution, if necessary.
See [Security Considerations](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations).
**Sidebars**
None.
**Timeliness**
Timeliness isn’t of significant importance in this pattern. However, care must be taken to design the interfaces so that all of the batch processes complete in a designated batch window.
As with all batch-oriented operations, we strongly recommend that you take care to insulate the source and target systems during batch processing windows. Loading batches during business hours might result in some contention, resulting in either a user's update failing, or more significantly, a batch load (or partial batch load) failing.
For organizations that have global operations, it might not be feasible to run all batch processes at the same time because the system might continually be in use. Data segmentation techniques using record types and other filtering criteria can be used to avoid data contention in these cases.
**State Management**
You can implement state management by using surrogate keys between the two systems. If you need any type of transaction management across Salesforce entities, we recommend that you use the [Remote Call-In](/docs/architect/fundamentals/guide/integration-patterns.html#remote-call-in) pattern using Apex.
Standard optimistic record locking occurs on the platform, and any updates made using the API require the user, who is editing the record, to refresh the record and initiate their transaction. In the context of the Salesforce API, optimistic locking refers to a process where:
- Salesforce doesn’t maintain the state of a record being edited by a specific user.
- Upon reading, it records the time when the data was extracted.
- If the user updates the record and saves it, Salesforce checks to see if another user has updated the record in the interim.
- If the record has been updated, the system notifies the user that an update was made and the user should retrieve the latest version of the record before proceeding with their updates.
**Middleware Capabilities**
The most effective external technologies used to implement this pattern are traditional ETL tools like Informatica or MuleSoft. It’s important that the middleware tools chosen support the Salesforce Bulk API.
Middleware should be able to store the last successfully processed timestamp either internally or externally for watermarking. This last successfully processed timestamp should be used to consume the changes since the last successful execution.
The following table highlights the desirable properties of a middleware system that participates in this pattern.
| Property | Mandatory | Desirable | Not Required |
| :-------------------------------------------------------------------------------- | :---------------------------------------------- | :-------- | :----------- |
| Event handling | | X | |
| Protocol conversion | | X | |
| Translation and transformation | X | | |
| Queuing and buffering | X | | |
| Synchronous transport protocols | X | | |
| Asynchronous transport protocols | | | X |
| Mediation routing | | X | |
| Process choreography and service orchestration | X | | |
| Transactionality (encryption, signing, reliable delivery, transaction management) | | X | |
| Routing | | X | |
| Extract, transform, and load | X | | |
| Long polling | X (required for Salesforce Change Data Capture) | | |
| gRPC support (for Pub/Sub API) | X | | |
**Example**
A utility company uses a mainframe-based batch process that assigns prospects to individual sales reps and teams. This information needs to be imported into Salesforce on a nightly basis.
The customer has decided to implement change data capture on the source tables using a commercially available ETL tool. The solution works as follows:
- A cron-like scheduler executes a batch job that assigns prospects to users and teams.
- After the batch job runs and updates the data, the ETL tool recognizes these changes using change data capture. The ETL tool collates the changes from the data store.
- The ETL connector uses the Salesforce REST API to load the changes into Salesforce.
## Remote Call-In
**Context**
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. The Salesforce system creates the orders internally and then pushes that data to the external billing system for provisioning and activation. Billing Orders are managed by an external (remote) system. That remote system needs to update the order status in Salesforce when the order or billing entity on the billing system status changes.
**Problem**
How does a remote system connect and authenticate with Salesforce to notify Salesforce about external events, create records, and update existing records?
**Forces**
There are various forces to consider when applying solutions based on this pattern:
- Is the purpose of the remote call to Salesforce to notify Salesforce of an event that occurred externally using an event-driven architecture? Or is the purpose to perform CRUD operations on specific records? If you use an event-driven architecture, the event producer (the remote process) is decoupled from the Salesforce event consumer.
- Does the call to Salesforce require the remote process to wait for a response before continuing processing? Remote calls to Salesforce are always synchronous request-reply, although the remote process can discard the response if it isn’t needed to simulate an asynchronous call.
- Does each transaction operate against a single Salesforce object or multiple, related objects?
- What is the format of the message (for example, SOAP or REST, or both over HTTP)?
- Is the message size relatively small or large?
- If the remote system is SOAP-capable, is the remote system able to participate in a contract-first approach, where Salesforce dictates the contract? This is required where our SOAP API is used, for which a predefined WSDL is supplied.
- Is transaction processing required?
- What is the extent to which you’re tolerant of customization in Salesforce?
**Solution**
This table contains various solutions to this integration problem.
| Solution | Fit | Comments |
| ------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Composite API | Best | Salesforce provides a composite API which is a REST API and supports composite requests. This can be used by remote systems to:
Send up to 25 requests in a single call.
For querying, creating, and modifying data in Salesforce org using JSON requests.
Synchronous API—After the API call is made, the remote client application waits until it receives a response from the service.
Transaction/Commit Behavior—By default, composite API doesn’t allow for partial success if some records are marked with errors. This can be changed by marking “all or nothing” flag as false which will allow partial success.
Error Handling: Proper error handling should examine the response body, not just HTTP status codes. A composite endpoint responds with 200 HTTP status code even if inside the response body it shows that one of the subrequests failed and the transaction had to roll back. |
| Composite Graph API | Best | The composite graph resource lets you submit composite graph operations. This resource is available in REST API version 50.0 and later.
Composite Graph API can support up to 75 graphs in one payload and a maximum of 500 nodes in one graph. |
| REST API | Best | Accessibility—Salesforce provides a REST API that remote systems can use to:
Publish events to notify your Salesforce org
Query data in your org - using either the query resource or Named Query API
Create, update, and delete data
Obtain metadata about your org
Synchronous API—After the API call is made, the remote client application waits until it receives a response from the service.
The REST API respects object-level and field-level security configured in Salesforce based on the logged in user’s profile.
REST exposes resources (entities/objects) as URIs and uses HTTP verbs to define CRUD operations on these resources. Unlike SOAP, REST API requires no predefined contract, utilizes XML and JSON for responses, and has loose typing. REST API is lightweight and provides a simple method for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice for use with mobile apps and web apps.
Transaction/Commit Behavior—By default, each record is treated as a separate transaction and committed separately. Failure of one record change doesn’t cause rollback of other record changes. This behavior can be altered to an “all or nothing” behavior. Use the REST API composite resources to make a series of updates in one API call.
Bulk Data—Any data operation that includes more than 2,000 records is a good candidate for Bulk API 2.0 to successfully prepare, execute, and manage an asynchronous workflow that uses the Bulk framework. |
| Bulk API 2.0 | Best for bulk operations | Bulk API 2.0 is Salesforce's modern, streamlined API for handling large-scale data operations. The REST-based Bulk API 2.0 provides a programmatic option to asynchronously insert, upsert, query, or delete large datasets in your Salesforce org. It's designed for efficiency when you need to load large amounts of data into Salesforce or perform bulk queries on your organization's data.
Bulk API 2.0 always processes batches in parallel and does not support serial mode. This means that:
Records are processed concurrently across multiple threads
There is no guarantee of processing order between batches
There is higher performance but also a potential for lock contention
Each batch in Bulk API 2.0 is processed as its own transaction. This means:
Successful batches commit independently
Failed batches don't affect successful ones
By default, there is no "all-or-nothing" behavior across all the jobs
Although SOAP API can also be used for processing large numbers of records, it becomes less optimal when data sets contain hundreds of thousands to millions of records. This is due to its relatively high overhead and lower performance characteristics.
Event-Driven Architecture—Platform events are defined the same way you define Salesforce objects. Publishing an event via Bulk API 2.0 is the same as creating a Salesforce record. Only the create and insert operations are supported. Events within a batch are published to the Salesforce event bus asynchronously as the batch job is processed.
|
| GraphQL API | Best | For Remote Call-In scenarios involving complex, multi-object reads with selective fields, GraphQL is a superior option to REST API. |
| Pub/Sub API | Best | The Pub/Sub API is the recommended way for external publishers to publish events on the Event Bus.
Pub/Sub API is a gRPC-based API that allows external systems to publish platform events. The Pub/Sub API:
Supports both publishing and subscribing to platform events from external applications
Is available with proper authentication (OAuth, JWT, or session tokens)
|
| Platform Events | Best | Platform events are defined the same way you define Salesforce objects. Platform events can be published using different mechanisms like REST APIs, Bulk API, and SOAP APIs.
Publishing an event via REST API is the same as creating a Salesforce record.
Endpoint Format: POST /services/data/vXX.X/sobjects/EventName\_\_e/
Content-Type: application/json
Authentication: Bearer token (OAuth)
With Bulk API, only the create and insert operations are supported. Events within a batch are published to the Salesforce event bus asynchronously as the batch job is processed.
Since Platform Events are SObjects, standard SOAP API operations are supported. |
| SOAP API | Suboptimal | Accessibility—Salesforce provides a SOAP API that remote systems can use to:
Publish events to notify your Salesforce org
Query data in your org
Create, update, and delete data
Obtain metadata about your org
Run utilities to perform administrative tasks
Synchronous API—After the API call is made, the remote client application waits until it receives a response from the service. Asynchronous calls to Salesforce aren’t supported.
Generated WSDL—Salesforce provides two WSDLs for remote systems:
Enterprise WSDL - Provides a strongly-typed WSDL that’s specific to a Salesforce org.
Partner WSDL - Contains a loosely typed WSDL that’s not specific to a Salesforce org.
Security—The client executing SOAP API must have a valid login and obtain a session to perform any API calls. The API respects object-level and field-level security configured in Salesforce based on the logged in user’s profile.
Transaction/Commit Behavior—By default, each API call allows for partial success if some records are marked with errors. This can be changed to an “all or nothing” behavior where all the results are rolled back if any error occurs. It’s not possible to span a transaction across multiple API calls. To overcome this limitation, it’s possible for a single API call to affect multiple objects.
SOAP requires significant knowledge of the Salesforce object model, API mechanisms, and SOAP message handling. These additional factors make REST preferable over SOAP. |
| Apex web services | Suboptimal | Apex class methods can be exposed as web service methods to external applications. This method is an alternative to SOAP API, and is typically used only where the following additional requirements must be met.
Full transactional support is required (for example, create an account, contact, and opportunity all in one transaction).
Custom logic must be applied on the Salesforce side before committing.
The benefit of using an Apex web service must be weighed against the additional code that needs to be maintained in Salesforce.
Not applicable for platform events because transaction pre-insert logic at the consumer doesn’t apply in an event-driven architecture. To notify a Salesforce org that an event has occurred, use SOAP API, REST API, or Bulk API 2.0.
SOAP requires significant knowledge of the Salesforce object model, API mechanisms, and SOAP message handling. These additional factors make REST preferable over SOAP. |
| Apex REST services | Suboptimal | An Apex class can be exposed as REST resources mapped to specific URIs with a defined HTTP verb (for example, POST or GET).
You can use REST API composite resources to perform multiple updates in a single transaction.
Unlike SOAP, there’s no need for the client to consume a service definition/contract (WSDL) and generate client stubs. The remote system requires only the ability to form an HTTP request and process the returned results (XML or JSON).
Not applicable for platform events because transaction pre-insert logic at the consumer doesn’t apply in an event-driven architecture. To notify a Salesforce org that an event has occurred, use SOAP API, REST API, or Bulk API 2.0. |
**Sketch**
The following diagrams illustrate the sequence of events when you implement this pattern using either REST API for notifications from external events or SOAP API to query a Salesforce object. The sequence of events is the same when using the REST API.
**Remote System Querying Salesforce Via REST API**

**Remote System Notifying Salesforce with Events Via REST API**

**Results**
In an event-driven architecture, the remote system calls into Salesforce using SOAP API, REST API, or Bulk API 2.0 to publish an event to the Salesforce event bus. Publishing an event notifies all subscribers. Event subscribers can be on the Salesforce Platform such as Flows, or Lightning Components, Apex triggers. Event subscribers can also be external to the Salesforce Platform such as Pub/Sub API subscribers.
When working directly with Salesforce objects, the solutions related to this pattern allow for:
- The remote system calls the Salesforce APIs to query the database and execute single-object operations (create, update, delete, and so on).
- The remote system to call the Salesforce REST API composite resources to perform a series of object operations.
- Remote system to call custom-built Salesforce APIs (services) that can support multi-object transactional operations and custom pre/post processing logic.
**Calling Mechanisms**
The calling mechanism depends on the solution chosen to implement this pattern.
| Calling mechanism | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SOAP API | The remote system uses the Salesforce Enterprise or Partner WSDL to generate client stubs that are in turn used to invoke the standard SOAP API. |
| REST API | The remote system has to authenticate before accessing any Apex REST service. The remote system should use OAuth 2.0 for authentication and authorization. The client must set the authorization HTTP header with the appropriate value like an OAuth access token.
The remote system then generates REST invocations (HTTP requests) with the appropriate verbs and processes the results returned (JSON and XML data formats are supported). |
| Apex web service | The remote system consumes the custom Apex web service WSDL to generate client stubs that are in turn used to invoke the custom Apex web service. |
| Apex REST service | As per REST API, the resource URI and applicable verbs are defined using the @RestResource, @HttpGet, and @HttpPost annotations. |
| Bulk API 2.0 | Bulk API 2.0 is a REST-based API, so the same calling mechanisms as REST API apply. |
| REST API to invoke Flow | Use REST API to call a custom invocable actions endpoint to invoke an auto-launched flow. |
**Error Handling and Recovery**
An error handling and recovery strategy must be considered as part of the overall solution.
- Error handling — All the remote call-in methods, standard or custom APIs, require the remote system to handle any subsequent errors, such as timeouts and the management of retries. Middleware can be used to provide the logic for error handling and recovery.
- Recovery — Build a custom retry mechanism if quality-of-service requirements require it. In this case, it’s important to ensure idempotent design characteristics. Platform event enables subscribers to use the replay ID to fetch messages within a certain time period after those messages were published.
**Idempotent Design Considerations**
Idempotent capabilities guarantee that repeated invocations are safe and won’t have a negative effect. If idempotency isn’t implemented, then repeated invocations of the same message can have different results, potentially resulting in data integrity issues, for example, creation of duplicate records, duplicate processing of transactions, and so on.
The remote system must manage multiple (duplicate) calls, in the case of errors or timeouts, to avoid duplicate inserts and redundant updates (especially if downstream triggers and workflow rules fire). While it’s possible to manage some of these situations within Salesforce (particularly in the case of custom SOAP and REST services), we recommend that the remote system (or middleware) manages error handling and idempotent design.
**Security Considerations**
Different security considerations apply, depending on the pattern solution chosen. In all cases, the platform uses the logged-in user’s access rights (for example, profile settings, sharing rules, permission sets, and so on). Additionally, profile IP restrictions can be used to restrict access to the API for a specific IP address range.
| Solution | Security considerations |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SOAP API | Salesforce supports Transport Layer Security (TLS 1.2 or greater) protocols. Ciphers must have a key length of at least 128 bits. |
| REST API | We recommend that the remote system establish an OAuth trust for authorization. REST calls can then be made on specific resources using HTTP verbs. We recommend that clients that call the REST API, then cache and reuse the OAuth token to maximize performance, rather than obtaining a new OAuth token for each call. |
| Apex web service | We recommend that the remote system establish an OAuth trust for authorization. |
| Apex REST service | We recommend that the remote system establish an OAuth trust for authorization. |
| Bulk API 2.0 | We recommend that the remote system establish an OAuth trust for authorization. |
See [Security Considerations](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations).
**Sidebars**
None.
**Timeliness**
SOAP API and Apex web service API are synchronous. The following timeouts apply:
- Session timeout — The session times out if there’s no activity based on the Salesforce org’s session timeout setting.
- Query timeout — Each SOQL query has an individual timeout limit of 120 seconds.
**Data Volumes**
Data volume considerations depend on which solution and communication type you choose.
| Solution | Communication type | Limits |
| -------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SOAP API or REST API | Synchronous |
Create, Update, Delete—The remote system can create, update, or delete up to 200 records at a time. Multiple calls can be made to process more than a total of 200 records, but each request is limited to 200 records in size.
BLOB Data—You can use SObject Basic Information, SObject Rows, or SObject Collections REST resources to insert or update BLOB data in Salesforce standard objects. For the SObject Basic Information or SObject Rows resources, the maximum file size for uploads is 2 GB for ContentVersion objects and 500 MB for all other eligible standard objects. Using the SObject Collections resources, the maximum total size of all files in a single request is 500 MB.
Query Results Size — By default, the number of rows returned in the query result object (batch size), returned in a query() or queryMore() call is set to 500. The maximum number of rows returned is 2,000. You can explicitly set the batch size, but there's no guarantee that the requested batch size will be the actual batch size. This is done to maximize performance. Where the number of rows to be returned exceeds the batch size, use the queryMore() API call to iterate through multiple batches. Additional rules might apply, so for more information.
Event Message — The maximum event message size is 1 MB. Publishing an event using the Salesforce APIs counts against your standard API limits.
|
| Bulk API 2.0 | Asynchronous | Bulk API 2.0 is optimized for importing and exporting large sets of data asynchronously.
Any data operation that includes more than 2,000 records is a good candidate for Bulk API 2.0 to successfully prepare, execute, and manage an asynchronous workflow that uses the Bulk framework. Jobs with fewer than 2,000 records should involve “bulkified” synchronous calls in REST (for example, Composite) or SOAP.
Bulk API 2.0 is synchronous when submitting the batch request and associated data. The actual processing of the data occurs asynchronously. For more information about API and batch processing limits, see Limits. |
**Endpoint Capability and Standards Support**
The capability and standard support for the endpoint depends on the solution that you choose.
| Solution | Endpoint considerations |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SOAP API | The remote system must be capable of implementing a client that can call the Salesforce SOAP API, based on a message format predefined by Salesforce. The remote system (client) must participate in a contract-first implementation where the contract is supplied by Salesforce (for example, Enterprise or Partner WSDL). |
| REST API | The remote system must be capable of implementing a REST client that invokes Salesforce—defined REST services, and processes the XML or JSON results. |
| Apex web service | The remote system must be capable of implementing a client that can invoke SOAP messages of a predefined format, as defined by Salesforce. The remote system must participate in a code-first implementation, where the contract is supplied by Salesforce after the Apex web service is implemented. Each Apex web service has its own WSDL. |
| Apex REST service | The same endpoint considerations as REST API apply. |
**State Management**
When integrating systems, keys are important for on-going state tracking, for example, if a record gets created in the remote system, to support ongoing updates to that record. There are two options:
- Salesforce stores the remote system’s primary or unique surrogate key for the remote record.
- The remote system stores the Salesforce unique record ID or some other unique surrogate key. There are specific considerations for handling integration keys in this synchronous pattern.
| Master | System Description |
| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce | In this scenario, the remote system stores either the Salesforce RecordId or some other unique surrogate key from the record. |
| Remote system | In this scenario, Salesforce stores a reference to the unique identifier in the remote system. Because the process is synchronous, the key can be provided as part of the same transaction using external ID fields. |
**Complex Integration Scenarios**
Each solution in this pattern has different considerations when handling complex integration scenarios such as transformation and process orchestration.
| Solution | Considerations |
| :------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SOAP API or REST API | SOAP API and REST API provide for simple transactions on objects. Complex integration scenarios, such as aggregation, orchestration, and transformation, can’t be performed in Salesforce. These scenarios must be handled by the remote system or middleware, with middleware as the preferred method. |
| Apex web service or Apex REST service | Custom web services can provide for cross-object functionality, custom logic, and more complex transaction support. This solution should be used with care, and you should always consider the suitability of middleware for any transformation, orchestration, and error handling logic. |
**Governor Limits**
Due to the multitenant nature of the Salesforce platform, there are limits when using the APIs.
| Solution | Limits |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SOAP API, REST API, and custom Apex APIs |
API request limits—Salesforce applies a limit on the number of API calls per 24–hour period. The limit is based on the Salesforce edition type and number of licenses. For example, Unlimited Edition provides 5,000 API requests per Salesforce Platform license per 24 hours. For more information, see Salesforce Developer Limits and Allocations Quick Reference.
API query cursor limits—A user can have up to 10 query cursors open at a time. Otherwise, the oldest of the 10 cursors is released. If the remote application attempts to open the released query cursor, an error results. For example, if sharing integration user credentials, the maximum query cursors need to be considered. Whenever possible, the middleware should complete the full query before executing another query (in a serial fashion) or each application should use a designated integration user. Alternatively, the middleware may need to execute requests across multiple users in a “round robin” fashion.
Call limits—See Data Volumes sidebar for create, update, and query limits.
|
| Bulk API 2.0 | See Data Volumes sidebar for more information. |
| Platform Events |
Event notification limits—A maximum of 100,000 events can be published per hour for standard volume platform events. A maximum of 250,000 events can be published per hour for high-volume usage-based platform events. To monitor high-volume event usage, use REST API limits resource.
Event message size limits—The maximum event message size is 1 MB. Publishing an event using the Salesforce APIs counts against your standard API limits.
|
**Reliable Messaging**
Reliable messaging attempts to resolve the issue of guaranteeing the delivery of a message to a remote system where the individual components themselves might be unreliable. The Salesforce SOAP API and REST API are synchronous and don’t provide explicit support for any reliable messaging protocols, per se (for example, WS-ReliableMessaging).
We recommend that the remote system implement a reliable messaging system to ensure that error and timeout scenarios are successfully managed. Publishing of platform events from external systems relies on Salesforce APIs, so the same considerations for SOAP API and REST API apply.
**Middleware Capabilities**
This table highlights the desirable properties of a middleware system that participates in this pattern:
| Property | Mandatory | Desirable | Not Required |
| :-------------------------------------------------------------------------------- | :-------- | :------------------- | :----------- |
| Event handling | | X | |
| Protocol conversion | | X | |
| Translation and transformation | | X | |
| Queuing and buffering | X | | |
| Synchronous transport protocols | X | | |
| Asynchronous transport protocols | | | X |
| Mediation routing | | X | |
| Process choreography and service orchestration | | X | |
| Transactionality (encryption, signing, reliable delivery, transaction management) | X | | |
| Routing | | | X |
| Extract, transform, and load | | X (for bulk/batches) | |
| gRPC support (for Pub/Sub API) | | X | |
**Example**
A printing supplies and services company uses Salesforce as a front end to create and manage printer supplies and orders. Salesforce asset records representing printers are periodically updated with printing usage statistics (ink status, paper level) from the on-premises Printer Management System (PMS), which regularly monitors printers on client sites. Upon reaching a set threshold value (for example, low ink status or low/empty paper level of less than 30%), multiple apps/processes (variable) interested in the event are notified, email or Chatter alerts are sent, and an Order record is created. The PMS stores the Salesforce ID (Salesforce is the asset record master).
The following constraints apply:
- The PMS can participate in a contract-first integration, where Salesforce provides the contract and the PMS acts as a client (consumer) of the Salesforce service (defined via the Enterprise or Partner WSDL).
- There should be no custom development in Salesforce.
This example is best implemented using the Salesforce SOAP API or REST API to publish events, and declarative automation (Flow) in Salesforce. The primary reason to use platform events is the variable and non-finite number of subscribers; however, for simple updates to a finite list of records such as orders, then use SOAP or REST API to update the records.
In Salesforce:
- Define a platform event in Salesforce to contain the notification data coming from the PMS.
- Create a Flow that’s triggered by the printer event notification. The process updates the printer asset and creates an order (using an auto-launched Flow).
- Download the Enterprise or Partner WSDL and provide it to the remote system.
In the remote system:
- Create a client stub from the Enterprise or Partner WSDL.
- Authenticate to Salesforce (via OAuth web server or bearer token flow) using the integration user’s credentials.
- Upon printer status event, the PMS calls the API to create the printer status platform event (with printer usage statistics). The Salesforce event bus notifies Flow subscriber and all other subscribers.
When you use platform events, the event bus lets you replay events for 72 hours for high-volume platform events. Publishing those events using a middleware solution can help incorporate error handling on the publishing side. However, you can implement error handling on the subscribing side if you need higher reliability.
This example demonstrates the following:
- Implementation of a Salesforce synchronous API client (consumer).
- A callback to Salesforce to publish a platform event (aligned with previously covered request/reply platform event patterns).
## UI Update Based on Data Changes
**Context**
You use Salesforce to manage customer cases. A customer service rep is on the phone with a customer working on a case. The customer makes a payment, and the customer service rep needs to see a real-time update within the Salesforce application from the payment processing application, indicating that the customer has successfully paid the order’s outstanding amount.
**Problem**
When an event occurs in Salesforce, how can the user be notified in the Salesforce user interface without having to refresh their screen and potentially losing work?
**Forces**
There are various forces to consider when applying solutions based on this pattern:
- Does the data being acted on need to be stored in Salesforce?
- Can a custom user interface layer be built for viewing this data?
- Will the user have access for invoking the custom user interface?
**Solution**
The recommended solution to this integration problem is to use platform events which ensures near real time eventing in Salesforce. Platform Events provide a structured, flexible payload independent of any Salesforce object. They also ensure durable topics with a replay window of 72 hours. This window guarantees that events are available even if an offline consumer becomes available later. This solution is composed of the following components:
- Apex Trigger or Flows with a logic to publish a platform event on a topic
- A topic that allows you to publish an event from Apex Trigger or Flow
- Pub/Sub API (based on gRPC and HTTP/2) for efficient consumption of platform events
- A Lightning component
- A JavaScript library included as a static resource
**Sketch**
The following diagram illustrates how Pub/Sub API can be implemented to stream notifications to the Salesforce user interface. These notifications are triggered by record changes in Salesforce.
**UI Update in Salesforce Triggered by a Data Change**

**Results**
**Benefits**
The application of the solution related to this pattern has the following benefits:
- Eliminates the need for writing custom polling mechanisms
- Eliminates the need for a user-initiated feedback loop
**Unsupported Requirements**
The solution has the following limitations:
- Delivery of notifications isn’t guaranteed.
- Order of notifications isn’t guaranteed.
- Notifications aren’t generated from record changes made by Bulk API.
**Security Considerations**
Standard Salesforce org-level security is adhered to. It’s recommended that you use the HTTPS protocol to connect to the Streaming API. See [Security Considerations](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations)
**Sidebars**
The optimal solution involves creating a custom user interface in Salesforce. It’s imperative that you account for an appropriate user interface container that can be used for rendering the custom user interface. For more details, see [Pub/Sub API Developer Guide](https://developer.salesforce.com/docs/platform/pub-sub-api/overview).
**Example**
A telecommunications company uses Salesforce to manage customer cases. The customer service managers want to be notified when a case is successfully closed by one of their customer service reps.
Implementing the solution prescribed by this pattern, the customer should:
- Create an Apex Trigger that sends a platform event when a case is saved with a Status of “Closed” and Resolution of “Successful.”
- Create a custom user interface available to customer service managers. This user interface subscribes to the Pub/Sub API to consume platform events.
- Implement logic in the custom user interface that shows alerts generated by that manager’s customer service reps.
## Data Virtualization
**Context**
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. However, Salesforce isn’t the system that contains or processes orders. Orders are managed by an external (remote) system. But sales reps want to view and update real-time order information in Salesforce without having to learn or use the external system.
**Problem**
In Salesforce, how do you view, search, and modify data that’s stored outside of Salesforce, without moving the data from the external system into Salesforce?
**Forces**
There are various forces to consider when applying solutions based on this pattern:
- Do you want to build a declarative/point-and-click outbound integration or UI mashup in Salesforce?
- Do you have a large amount of data that you don’t want to copy into your Salesforce org?
- Do you need to access small amounts of remote system data at any one time?
- Do you need real-time access to the latest data?
- Do you store your data in the cloud or in a back-office system, but want to display or process that data in your Salesforce org?
- Do you have data residency concerns for storing certain types of data in Salesforce?
**Solution**
The following table contains various solutions to this integration problem.
| Solution | Fit | Comments |
| ---------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce Connect | Best | Use Salesforce Connect to access data from external sources, along with your Salesforce data. Pull data from systems such as SAP, Microsoft, Oracle, and other cloud based systems such as Snowflake in real time without making a copy of the data in Salesforce.
Salesforce Connect maps data tables in external systems to external objects in your org. External objects are similar to custom objects, except that they map to data located outside your Salesforce org. Salesforce Connect uses a live connection to external data to always keep external objects up-to-date. Accessing an external object fetches the data from the external system in real time.
Salesforce Connect allows you to:
Query data in an external system.
Create, update, and delete data in an external system.
Access external objects via list views, detail pages, record feeds, custom tabs, and page layouts.
Define relationships between external objects and standard or custom objects to integrate data from different sources.
Run reports on external data. (Note: the limitations of Reports & Dashboards in Salesforce still apply.)
View the data on the Salesforce mobile app.
To access data stored on an external system using Salesforce Connect, you can use one of the following adapters:
OData adapter — connects to data exposed by any OData producer. Salesforce Connect supports versions 4.01, 4.0, and 2.0.
AWS and Snowflake - connects to data stored in Athena, DynamoDB, or Snowflake. The adapters use those platforms’ APIs to expose the source data.
GraphQL - connects to data stored in AWS RDS using AWS AppSync to provide a GraphQL translation.
Cross-org adapter — connects to data that’s stored in another Salesforce org. The cross-org adapter uses the standard Salesforce Platform REST API. Unlike OData, the cross-org adapter directly connects to another org without needing an intermediary web service.
Custom adapter created via Apex — if the other adapters aren’t suitable for your needs, develop your own adapter with the Apex Connector Framework. This is a viable option for any system that exposes an HTTP/REST API.
|
| Data 360 and Zero Copy | Best | When a record is updated in external systems like ERP, the record updates can be synced to Data 360 either using available out of the box connectors or using APIs and pro-code tools like MuleSoft.
Records can also be referenced in Data 360 using zero copy mechanism (available with some platforms). Once data is available in Data 360, different out of the box integration mechanisms can be used for syncing the data to other Salesforce orgs. Data can be accessed by reference using Data Cloud One.
Data can be replicated too using activations and other APIs using out of the box connectors or with the help of pro-code tools like MuleSoft Anypoint platform.
Note: data in Data 360 cannot be edited. If this is a requirement, use Salesforce Connect. |
| Data 360, Data Cloud One, and Salesforce | Best | Harmonize data from different sources with Data 360 and Data Cloud One. Through the Customer 360 Data Model, identity resolution, data federation, and other features, Data 360 consolidates data from Salesforce and other external systems into a unified view of your customer. With Data Cloud One, users in other Salesforce orgs can safely access data shared virtually from Data 360.
Note: data in Data 360 cannot be edited. If this is a requirement, use Salesforce Connect. |
| Request and Reply | Suboptimal | Use Salesforce web service APIs to make ad-hoc data requests to access and update external system data. This solution includes the following approaches:
Use Salesforce SOAP API. A custom page or button initiates an Apex REST/SOAP callout in a synchronous manner. In Salesforce, you can consume a WSDL and generate a resulting proxy Apex class. This class provides the necessary logic to call the remote service. A user-initiated action on a page then calls an Apex controller action that executes this proxy Apex class to perform the remote call. The pages require customization of the Salesforce app.
Use Salesforce REST API. A custom page or button initiates an Apex HTTP callout (REST service) in a synchronous manner. In Salesforce, you can invoke HTTP services using standard GET, POST, PUT, and DELETE methods.
For more information on this solution, see Remote Process Invocation—Request and Reply. |
**Sketch**
The following diagram illustrates how you can use Salesforce Connect to pull data from an external system using an OData adapter.

In this scenario:
- The browser performs an AJAX call that in turn performs an action on the corresponding external object adapter.
- The adapter translates the action into an OData request and makes an HTTP GET request to the remote system via the Integration and Services layers.
- The remote system returns a JSON response to Salesforce via the Integration and Services layers.
- The response is translated from OData into an external object and presented back to the browser.
**Results**
The application of the solutions related to this pattern allows for user-interface initiated invocations in which the result of the transaction can be displayed to the end user.
**Calling Mechanisms**
The calling mechanism depends on the solution chosen to implement this pattern.
| Calling Mechanism | Description |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| External Objects | Salesforce Connect maps Salesforce external objects to data tables in external systems. Instead of copying the data into your org, Salesforce Connect accesses the data on demand and in real time. Even though the data is stored outside your org, Salesforce Connect provides seamless integration with the Salesforce Platform. External objects are available to Salesforce tools, such as global search, lookup relationships, record feeds, and the Salesforce mobile app. External objects are also available to Apex, SOSL, SOQL queries, Salesforce APIs, and deployment via the Metadata API, change sets, and packages. |
| Lightning Components | Used when the remote process is triggered as part of an end-to-end process involving the user interface, and the result must be displayed or updated in a Salesforce record. For example, a process that submits credit card payments to an external payment gateway and immediately returns payment results that are displayed to the user. Integration triggered from user interface events usually requires the creation of custom Lightning components. |
**Error Handling**
It’s important to include error handling as part of the overall solution. When an error occurs (exceptions or error codes are returned to the caller), the caller manages the error handling. The [Salesforce Connect Validator](https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EJHQ6UAP) is a free tool to run some common queries and notice error types and failure causes.
**Benefits**
Some of the benefits of using a Salesforce Connect solution are:
- This solution doesn't consume data storage in Salesforce.
- Users don't have to worry about regularly synchronizing data between the external system and Salesforce.
- A declarative setup that can be achieved quickly with OData, or a cross-org adapter, or using minimal code with a custom Apex adapter.
- Users can access external data with much of the same functionality as custom objects in the form of external objects.
- Ability to do a federated search in the connected external system using global search.
- Ability to run reports that access external data from cloud and on-premises sources. Refer to reporting considerations below.
**Salesforce Connect Considerations**
The Salesforce Connect solution has the following considerations:
- External objects behave like custom objects, but some features aren’t available for external objects. For more information, see [Salesforce Compatibility Considerations for Salesforce Connect](https://help.salesforce.com/articleView?id=platform_connect_considerations_compatibility.htm&type=5&language=en_US).
- External objects can impact report performance. For more information, see [Report Considerations for Salesforce Connect](https://help.salesforce.com/s/articleView?id=platform.platform_connect_considerations_reports.htm&type=5).
- For additional considerations for using Salesforce Connect adapters see [Considerations for Salesforce Connect—All Adapters](https://help.salesforce.com/s/articleView?id=platform.platform_connect_considerations.htm&type=5).
- If you’re considering using a cross-org adapter, see [Considerations for Salesforce Connect—Cross-Org Adapter](https://help.salesforce.com/s/articleView?id=platform.xorg_considerations.htm&type=5).
- If you’re considering using an OData adapter, see [Considerations for Salesforce Connect—OData 2.0 and 4.0 Adapters](https://help.salesforce.com/s/articleView?id=platform.odata_considerations.htm&type=5).
- If you’re considering using a custom Apex adapter, see [Considerations for Salesforce Connect—Custom Adapter](https://help.salesforce.com/s/articleView?id=platform.apex_adapter_considerations.htm&type=5).
**Security Considerations**
Solutions for this pattern should adhere to standard Salesforce org-level security. It’s recommended you use the HTTPS protocol to connect to any remote system. For more details, see [Security Considerations](/docs/architect/fundamentals/guide/integration-patterns.html#appendix-b-security-considerations)
If you’re using an OData connector, make sure that you understand the special behaviors, limitations, and recommendations for Cross-Site Request Forgery (CSRF) on OData external data sources. For more information, see [CSRF Considerations for Salesforce Connect — OData 2.0 and 4.0 Adapters](https://help.salesforce.com/s/articleView?id=platform.odata_considerations_csrf.htm&type=5).
**Sidebars**
None.
**Timeliness**
Timeliness is of significant importance in this pattern. Keep the following points in mind:
- The request is typically invoked from the user interface, so the process must not keep the user waiting.
- Depending on the availability of and the connection to the external system, it can take a long time to retrieve external data. Salesforce has a configurable 120-second maximum timeout value to wait for a response from the external system.
- Completion of the remote process should execute in a timely manner and complete within the Salesforce timeout limit and within user expectations.
**Data Volumes**
This pattern is used primarily for small volume, real-time activities, due to the small timeout values and maximum size of the request or response for the Apex call solution. Don’t use this pattern in batch processing activities in which the data payload is contained in the message.
**Endpoint Capability and Standards Support**
The capability and standard support for the endpoint depends on the solution that you choose.
| Solution | Endpoint Considerations |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce Connect | OData APIs — Use the Open Data Protocol to access data that’s stored outside Salesforce. The external data must be exposed via OData producers.
Other APIs — Use the Apex Connector Framework to develop your own custom adapter when the other available adapters aren’t suitable for your needs. A custom adapter can obtain data from any source. For example, some data can be retrieved from the internet via callouts, while other data can be manipulated or even generated programmatically.
Connect to Salesforce — Uses the Salesforce Platform REST API to access data that’s stored in other Salesforce orgs.
Connect via Middleware — The Salesforce Connect partner ecosystem has worked closely with Salesforce to make sure that their middleware gateways expose OData endpoints from their service so Salesforce can connect with them without writing additional code. |
| Request & Reply | Apex SOAP Callouts -
The endpoint must be able to receive a web service call via HTTP.
Apex HTTP Callouts -
The endpoint must be able to receive HTTP calls.
You can use Apex HTTP callouts to call RESTful services using the standard GET, POST, PUT, and DELETE methods |
**State Management**
When integrating systems, keys are important for on-going state tracking. For example, if a record gets created in the remote system, typically the record needs some sort of identifying key to support ongoing updates. There are two options for storing keys.
- Salesforce stores the primary or unique surrogate key for the remote record.
- The remote system stores the Salesforce unique record ID or some other unique surrogate key. There are specific considerations for handling integration keys in this synchronous pattern.
| Master System | Description |
| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------- |
| Salesforce | The remote system stores either the Salesforce record ID or some other unique surrogate key from the record. |
| Remote System | The call to the remote process returns the unique key from the application, and Salesforce stores that key value in a unique record field. |
**Complex Integrations**
In certain cases, the solution prescribed by this pattern can require the implementation of a complex integration scenario. These scenarios are often solved using middleware.
- Aggregation of calls and their results across calls to multiple systems
- Transformation of both inbound and outbound messages
- Maintaining transactional integrity across calls to multiple systems
- Other process orchestration activities between Salesforce and the external system
**Governing Limits**
Different limits apply for different adapters. For more details, see [General Limits for Salesforce Connect](https://help.salesforce.com/s/articleView?id=platform_connect_general_limits.htm&type=5).
**Middleware Capabilities**
The following table highlights the desirable properties of a middleware system that participates in this pattern.
| Property | Mandatory | Desirable | Not Required |
| :-------------------------------------------------------------------------------- | :-------- | :-------- | :----------- |
| Event handling | | X | |
| Protocol conversion | X | | |
| Translation and transformation | X | | |
| Queuing and buffering | X | | |
| Synchronous transport protocols | X | | |
| Asynchronous transport protocols | | X | |
| Mediation routing | | X | |
| Process choreography and service orchestration | | X | |
| Transactionality (encryption, signing, reliable delivery, transaction management) | X | | |
| Routing | | | X |
| Extract, transform, and load | | | X |
| Long polling | | | X |
| gRPC support (for Pub/Sub API) | | | X |
**External Object Relationships**
External objects support standard lookup relationships, which use the 18-character Salesforce record ID to associate related records. However, data that’s stored outside your Salesforce org often doesn’t contain those record IDs. Therefore, two special types of lookup relationships are available for external objects: external lookups and indirect lookups.
This table summarizes the types of relationships that are available to external objects.
| Relationship | Allowed Child Objects | Allowed Parent Objects | Parent Field for Matching Records |
| :-------------- | :------------------------- | :--------------------- | :--------------------------------------------------------------- |
| Lookup | Standard, Custom, External | Standard, Custom | The 18-character Salesforce record ID |
| External lookup | Standard, Custom, External | External | The External ID standard field |
| Indirect lookup | External | Standard, Custom | Select a custom field with the External ID and Unique attributes |
**High Data Volume Considerations for Salesforce Connect: OData 2.0 and 4.0 Adapters**
If your org hits rate limits when accessing external objects, consider selecting the High Data Volume option on the associated external data sources. Doing so bypasses most rate limits, but some special behaviors and limitations apply. For more information, see [High Data Volume Considerations for Salesforce Connect](https://help.salesforce.com/s/articleView?id=platform.odata_considerations_high_data_volume.htm&type=5).
**Client-Driven and Server-Driven Paging for Salesforce Connect: OData 2.0 and 4.0 Adapters**
It's common for Salesforce Connect queries of external data to have a large result set that's broken into smaller batches or pages. You decide whether to have the paging behavior controlled by the external system (server-driven) or by the OData 2.0 or 4.0 adapter for Salesforce Connect (client-driven). The Server Driven Pagination field on the external data source specifies whether to use client-driven or server-driven paging. If you enable server-driven paging on an external data source, Salesforce ignores the requested page sizes, including the default queryMore() batch size of 500 rows. The pages returned by the external system determine the batches, but each page can’t exceed 2,000 rows. However, the limits for the OData adapters for Salesforce Connect still apply.
**Example**
A manufacturing company uses Salesforce to manage customer cases. The customer service agents want to access the real-time order information from the back-office ERP system to get a 360 view of the customer without having to learn and manually run reports in ERP.
Implementing the solution prescribed by this pattern, you should:
- Configure your external data source with an OData endpoint. Your remote application may include native support for OData. For other applications, major integration vendors such as Dell Boomi, Informatica, Jitterbit, MuleSoft, and Progress Software have partnered with Salesforce on Salesforce Connect to build adapters.
- Point Salesforce Connect at the OData endpoint, either directly, or through a middleware solution.
- Sync your external database tables with external objects in Salesforce. When a user accesses a page with data from these external objects, Salesforce Connect makes real-time callouts to your back-end applications.
## Appendix A: Resources
**Developer Documentation**
- [_Salesforce Help: Give Integration Users API Only Access_](https://help.salesforce.com/s/articleView?id=platform.integration_user.htm&type=5)
- [_Pub/Sub API Overview_](https://developer.salesforce.com/docs/platform/pub-sub-api/overview)
- [_SOAP API Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm)
- [_REST API Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm)
- [_Streaming API Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm)
- [_Bulk API 2.0 and Bulk API Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm)
- [_Apex Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm)
- [_SOQL and SOSL Reference_](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm)
- [_Salesforce Developer Limits and Allocations Quick Reference_](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_overview.htm)
- [_Platform Events Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_intro.htm)
- [_Salesforce Connect (Help & Training)_](https://help.salesforce.com/s/articleView?id=platform.platform_connect_about.htm&type=5)
- [_Apex Developer Guide: Salesforce Connect_](https://help.salesforce.com/s/articleView?id=platform.platform_connect_about.htm&type=5)
- [Understanding Salesforce Connect](https://unofficialsf.com/understanding-salesforce-connect/)
- [_Platform Events Message Durability_](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/event-message-durability.html)
- [Named Credentials Developer Guide](https://developer.salesforce.com/docs/platform/named-credentials/overview)
- [Apex Developer Guide: Using Named Credentials](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm)
- [Named Credentials (Help & Training)](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm&type=5)
- [Understanding Named Credentials](https://unofficialsf.com/understanding-named-credentials/)
- [Private Connect (Help & Training)](https://help.salesforce.com/s/articleView?id=xcloud.private_connect_overview.htm&language=en_US&type=5)
- [Understanding Private Connect](https://unofficialsf.com/understanding-private-connect/)
**Trailhead**
- [_Large Data Volumes_](https://trailhead.salesforce.com/content/learn/modules/large-data-volumes)
- [_Platform Events Basics_](https://trailhead.salesforce.com/content/learn/modules/platform_events_basics)
- [_Change Data Capture Basics_](https://trailhead.salesforce.com/content/learn/modules/change-data-capture)
- [_Quick Start: Salesforce Connect_](https://trailhead.salesforce.com/content/learn/projects/quickstart-lightning-connect)
## Appendix B: Legacy Salesforce Integration Products
Salesforce is moving toward faster and event-driven architectures. Migrating away from legacy integration tools is now required to stay secure and scalable. Many older tools use outdated protocols like SOAP or long-polling (CometD), which can't keep up with the Pub/Sub API's efficient gRPC-based delivery or the automation power of Flow Builder. To prepare, start by auditing your existing integrations to find hardcoded dependencies. This is especially important as Salesforce begins retiring features like Salesforce-to-Salesforce (fully retired by Spring '27) and phasing out legacy authentication methods. When planning your migration, use a "Flow-first" approach for internal business logic and a "Pub/Sub-first" approach for external data streams. This will give you a flexible, decoupled architecture ready for the data demands of today's AI-powered platform.
The `login()` call in the Salesforce SOAP API is being retired. It is already unavailable in API v65.0 and above. New Salesforce orgs will have `login()` disabled by default, and existing orgs will need the new "Use Any API Auth" permission to continue using it. The hard deadline is Summer '27, when Salesforce will fully retire `login()` across all API versions (31.0 through 64.0).
| Product | Status | Suggested Alternative | Migration Strategy |
| ------------------------ | --------------------------------------------------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Outbound Messaging | Legacy (Supported) | Flow \+ Platform Events | Replace with Flow-triggered Platform Events for better retry logic and modern authentication. |
| Process Builder | [End of Support](https://help.salesforce.com/s/articleView?id=001096524&type=1) | Flow Builder | Use the "Migrate to Flow" tool to convert existing processes; refactor complex logic for performance. |
| Salesforce-to-Salesforce | [Retiring Spring ‘27](https://help.salesforce.com/s/articleView?id=005103355&type=1) | Salesforce Connect or Pub/Sub API | Transition to Salesforce Change data capture, Salesforce Connect or Pub/Sub API with MuleSoft |
| Streaming API | Legacy (Supported) | Pub/Sub API | Move to Pub/Sub API to leverage gRPC, which offers higher throughput and simplified subscription management. |
| SOAP API `login()` | [Legacy (Supported until June 2027)](https://help.salesforce.com/s/articleView?id=005132110&type=1) | OAuth 2.0 flows | Move to OAuth2.0 using External Client Apps. |
## Appendix C: Security Considerations
To be effective members of the enterprise portfolio, all applications must be created and integrated with relevant security mechanisms. Modern IT strategies employ a combination of on-premises and cloud-based services.
While integrating cloud-to-cloud services typically focuses on web services and associated authorization, connecting on-premises and cloud services often introduces increased complexity. This section describes security tools, techniques, and Salesforce-specific considerations.
**Reverse Proxy Server**
A reverse proxy is a server that sits in front of web servers and forwards client (e.g. web browser) requests to those web servers. Reverse proxies are typically implemented to help increase security, performance, and reliability.
It’s a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client as though they originated from the proxy server itself. Unlike a forward proxy, which is an intermediary for its associated clients to contact any server, a reverse proxy is an intermediary for its associated servers to be contacted by any client.
In Salesforce implementations, such a service is typically provided via an external gateway product. For example, open source options such as Apache HTTP, lighttpd, and nginx can be used. Commercial products include IBM WebSeal and Computer Associates SiteMinder. These products can be easily configured to proxy and manage all outbound Salesforce requests on behalf of the internal requester.
**Encryption**
Some enterprises require selected transactions or data fields to be encrypted between a combination of on-premises and cloud-based applications. If your organization must adhere to additional compliance requirements, you can implement alternatives, including:
- On-premises commercial encryption gateway services, including Salesforce’s own, CipherCloud, IBM DataPower, Computer Associates. For each solution, the encryption engine or gateway is invoked at the transaction boundary by sending and receiving an encrypted payload or when encrypting or decrypting specific data fields before the HTTP(S) request executes.
- Cloud-based options, such as Salesforce Shield Platform Encryption. Shield Platform Encryption gives your data a whole new layer of security while preserving critical platform functionality. The data you select is encrypted at rest using an advanced key derivation system. You can protect your data more securely than ever before. Refer to the Salesforce online help for more information.
**Specialized WS-\* Protocol Support**
To address the requirements of security protocols (such as WS-\*), we recommend these alternatives.
- Security/XML gateway—Inject WS-Security credentials (MuleSoft, IBM WebSeal or Datapower, Layer7, TIBCO, and so on) into the transaction stream itself. This approach requires no changes to application-level web services or web service invocations from Salesforce. You can also reuse this approach across the Salesforce installation. However, it requires additional design, configuration, testing, and maintenance to manage the appropriate WS-Security injection into the existing security gateway approach.
- Transport-level encryption—Encrypt the communication channel using two-way SSL and IP restrictions. While this approach doesn’t directly implement the WS-\* protocol by itself, it secures the communication channel between the on-premises applications and Salesforce without passing a username and password. It also doesn’t require changes to Salesforce-generated classes. However, some on-premises web services modifications might be required (at either the application itself or at the middleware/ESB layer).
- Salesforce custom development—Add WS-Security headers to the outbound SOAP request via the WSDL2Apex utility. This generates a Java-like Apex class from the WSDL file used to invoke the internal service. While this approach requires no changes to back-end web services or additional components in the DMZ, it does require:
- an increased build and test effort
- a relatively complex and manual process to hand-code the WS-Security attributes (including XML serialization within the Apex code)
- a higher long-term maintenance effort
**Note**: The last option isn’t recommended due to its complexity and the risk that such integrations need periodic reviews based on regular updates to Salesforce.
**Other Security Considerations**
- **Named Credentials:** Salesforce has revamped its authentication architecture by introducing a two-tier Named Credentials model that cleanly separates concerns between connectivity and identity. Use this whenever making callouts through Apex and avoid creating your own authentication protocol. This also ensures extensibility, and more security. External Credentials sit at the foundation of this model. They store the actual authentication details and support a rich set of protocols including OAuth 2.0 Client Credentials, JWT Bearer, and AWS Signature V4, while also defining how principals are mapped: either as a single Named Principal (shared across all users) or as Per-User Principals (where each user authenticates with their own identity). Named Credentials, in turn, act as the endpoint layer — they define the callout URL and reference an External Credential to handle the auth handshake, keeping endpoint configuration cleanly decoupled from credential management. To enable per-user authentication flows, administrators map Permission Sets to the appropriate External Credential principal, ensuring that only users with the right Permission Set assignment can invoke callouts under their own identity. This two-tier design not only simplifies secure callout configuration but also gives architects far greater flexibility and governance control over how integrations authenticate across Salesforce-connected systems. For more details, see the [Named Credentials documentation](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm&type=5).
- **OAuth 2.0:** OAuth 2.0 is an industry-standard authorization framework that allows a user to grant limited access to their protected resources to a third-party application without sharing their credentials (like passwords). Instead of a direct password exchange, the user approves an access token request, which the application then uses to access the user's data from a resource server. This process separates the client application from the user's identity and password, enhancing security by providing a temporary, scope-specific "key" for accessing resources. For more information, see the [OAuth 2.0 documentation](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_flows.htm&type=5). For endpoints with strict OAuth 2.1 compliance, a third tier of the architecture is available (External Auth Identity Provider) to manage the interaction with the IDP in a 2.1-compliant manner.
- **Private Connect:** When you integrate your Salesforce org with applications hosted on third-party cloud services, it’s essential to be able to send and receive HTTP/s traffic securely. With Private Connect, increase security on your Amazon Web Services (AWS) integrations by setting up a fully managed network connection between your Salesforce org and your AWS Virtual Private Cloud (VPC). Then, route your cross-cloud traffic through the connection instead of over the public internet to reduce exposure to outsider security threats. Private Connect is available in partnership with AWS via a feature called AWS PrivateLink. Private Connect is bi-directional: you can initiate both inbound and outbound traffic. With inbound connections, you can send traffic into Salesforce using the standard APIs. And with outbound connections, you can send traffic out of Salesforce via features like Apex callouts, External Services, and External Objects. For more information, see the [Private Connect](https://help.salesforce.com/s/articleView?id=xcloud.private_connect_overview.htm&type=5) documentation.
## Appendix D: Event Driven Architecture
The Salesforce Event Bus with Platform Events, Change Data Capture (CDC), and Pub/Sub API enables enterprises to create event driven style architectures (EDAs).
An EDA decouples event message consumers (subscribers) from event message producers (publishers), allowing for greater scale and flexibility. Specific patterns are covered in this document as part of the existing pattern structure that compare and contrast related alternatives or options. However, getting a holistic understanding of the event driven architecture, and how patterns interplay, can help you select the right pattern for your needs.
## About the Authors
Khalid Mohammed is a distinguished Architect leader within Salesforce's Professional Services. Since joining Salesforce in 2015, he has leveraged his extensive expertise in Enterprise Application and Architecture, honed through numerous customer transformations before his tenure at Salesforce. Khalid heads the Delivery Architecture Board and is also acknowledged as a Certified Technical Architect leader.
Gulal Kumar is a Software Engineering Architect at Salesforce, with a focus on data and integration architecture. With over 21 years of experience in integration and APIs, modernization programs, security, and AIML initiatives, he brings a wealth of expertise. Gulal has been committed to advancing business transformation initiatives, enhancing security and resiliency, promoting architecture excellence, and leading AIML initiatives across various domains.
Sushant Verma is a Technical Architect at Salesforce, specialising in solution architecture and end-to-end delivery of Salesforce platforms. With deep expertise in platform governance, application development, integration, and DevOps, he has led numerous customer transformation programs across industries. Sushant is committed to driving delivery excellence and scalable architectural outcomes.
# Leveraging MuleSoft and Informatica: “Better Together”
This document provides a framework for real-time application connectivity and data management using MuleSoft and Informatica.
## A Framework for Real-Time Application Connectivity and Data Management
## Overview
MuleSoft and Informatica provide foundational pillars for a modern, high-performance integration strategy. While both reside in the same ecosystem, they solve distinct architectural challenges. Leading enterprises deploy these platforms in tandem to create a comprehensive "Better Together" framework that meets the full spectrum of data and application needs.
The most agile organizations succeed by decoupling data management from application connectivity. MuleSoft and Informatica act as specialized partners. MuleSoft delivers secure, performant, interactive application experiences through a service-based architecture, while Informatica ensures data integrity, quality, and governance at massive scale. Architects leverage both to apply the right engine to the right integration pattern, optimizing for both performance and long-term scalability.
## Products in Scope
MuleSoft is Salesforce's leading integration platform. It enables organizations to connect applications, data, and devices across on-premises and cloud environments. MuleSoft gives IT the tools to unlock data across systems, develop scalable integration and automation frameworks, and create differentiated, connected experiences at speed.
Informatica is a leading enterprise data management and integration platform. It helps organizations collect, manage, integrate, and analyze data from diverse sources. It uses ETL (Extract, Transform, Load) processes to provide the connected, reliable data necessary to power modern analytics and autonomous AI agents.
## Takeaways
**Leverage MuleSoft and Informatica as specialized partners.** MuleSoft and Informatica are two foundational pillars of a modern integration strategy. Sophisticated enterprises require both to meet complex architectural needs. These platforms deliver maximum value when used side-by-side. This combined approach decouples application connectivity from data management, ensuring that architects choose the right platform and pattern for long-term scalability.
**MuleSoft leads on Application Connectivity patterns:**
* **Real-time API Mediation and Governance**: MuleSoft provides the foundation for an API-led connectivity approach. It manages and secures synchronous and asynchronous interactions though experience, process, and system APIs.
* **Event Handling and Orchestration**: MuleSoft consumes and publishes events across Salesforce and external queues. It orchestrates complex, multi-step business processes where control flow, latency, and transactional correctness are critical.
* **Transactional Reliability:** MuleSoft ensures data integrity within short-lived transactions (for example, creating a customer record across CRM and ERP systems) where failures require immediate rollback or specific error handling.
* **AI Agent and workflow automation:** MuleSoft Agent Fabric supports multiple pillars for the agentic enterprise–discovery, orchestration, governance, and observability–with products included in its MuleSoft Anypoint platform.
**Informatica leads on Data Management patterns.**
* **Large-scale Data Movement and Transformation**: Informatica optimizes Extract, Transform, Load (ETL) or Extract, Load, Transform (ELT) processes for massive datasets—the traditional domain of data warehousing and data lake ingestion.
* **Data Quality, Lineage, and Governance**: Informatica provides enterprise-grade capabilities for data quality and profiling. It tracks data lineage from source to consumption and enforces long-lived data governance policies across the enterprise.
* **Master Data Management (MDM)**: Informatica creates and maintains the "single source of truth" of key data entities (Customer, Product, Supplier, and others) by consolidating data from disparate systems.
**Integration Strategy**: When selecting either MuleSoft or Informatica, an enterprise must first assess the integration strategy required for the use case. They must assess if the project prioritizes data consistency or service exposure. The answer determines which platform provides the foundation of the integration capability framework.
**Platform Selection**: Architects must evaluate the primary requirement of the use case. Interactive processes composed from independent services require MuleSoft. Conversely, bulk data movement, transformation, and management require Informatica. Complex architectures may require both.
## MuleSoft and Informatica: Better Together
To succeed in the new agentic era, enterprises must address two critical requirements:
1. **Dynamic Connectivity:** This is where MuleSoft excels. It provides the real-time orchestration layer. It manages the stateful connection of applications, APIs, and agents to support business processes. MuleSoft enables the entire ecosystem to immediately respond to a business moment.
2. **Trusted Context (Reliable Data):** This is Informatica's strength. Informatica provides the data management layer. It executes high-scale ingestion and replication of data, while also providing the crucial trust layer–governing, mastering and ensuring the high-quality and reliability of data.
The following sections demonstrate how MuleSoft and Informatica work together across key foundational pillars–Integration, Data Management, and Agent Orchestration and Governance.
### Integration: Bridging Application and Data Silos
For every modern enterprise, successful operations rely on integrating applications and data planes. The application integration and data integration platforms are complementary, not interchangeable. Attempting to leverage one without the other creates operational blind spots and bottlenecks.
The shortcomings of siloed integration approaches are clear.
**1. Application Integration Without Robust Data Governance**
Connecting applications, or app integration, allows the enterprise to move processes and transactions quickly across systems. However, if this execution layer lacks a unified, governed, and trustworthy view of the underlying data, the resulting actions, no matter how fast, will be based on fragmented, inconsistent, or obsolete information.
Organizations can orchestrate processes quickly, but without trusted data, decisions remain high-risk. Inconsistent customer interactions, inventory management, and financial reporting stem from a lack of "single source of truth," leading to inefficiencies and regulatory exposure.
MuleSoft mitigates this risk by providing out-of-the-box compliance for highly regulated industries, carrying active certifications including FedRAMP, ISMAP, HITRUST, SOC 1/2/3, and ISO 27001. However, even when the application layer communicates securely, it may still share incoherent data.
**2. Data Integration and Management Without Agile Application Integration**
Prioritizing data integration and management platforms—especially through a powerful data warehouse or master data management (MDM) system—is essential for cleaning, standardizing, and unifying data. These platforms create a single source of truth: a reliable, holistic view of entities like customers, products, or vendors.
While the data is clean, consolidated, and trustworthy, the mechanisms to inject its derived intelligence back into live business processes and customer-facing applications are sluggish or non-existent. Without app integration, the enterprise cannot translate a single source of truth into real-time action. High-quality data sits in the background, unable to influence an in-the-moment sales decision, a personalized service interaction, or a critical supply chain adjustment. The intelligence exists, but the operational pipeline remains blocked.
**The Holistic Solution: MuleSoft and Informatica Together**
MuleSoft and Informatica provide an industry-leading, unified framework for data-driven business operations.
This architectural alignment ensures:
* **Real-Time Action**: MuleSoft provides the agile mechanism to expose this trusted data via secure APIs. Through API-led connectivity, it integrates Informatica’s single source of truth directly into critical business applications and processes. This allows the enterprise to act in real-time based on the foundation of the single source of truth provided by Informatica.
* **Trusted Context**: Informatica, as the leader in cloud data management, ensures the data flowing through the enterprise is clean, consistent, governed, and compliant. It creates trusted context by mastering data, enabling quality assurance, and facilitating enterprise data governance.
##### The "Data-to-Agent" Moment
This integration enables customers to own the data-to-agent moment. This is the ultimate goal: when an employee (agent) or an automated system must act, the system instantly provides the complete, trustworthy, and real-time context necessary for success. This powerful synergy transforms data from a mere historical asset into a dynamic, actionable intelligence stream, driving superior business outcomes and competitive advantage.
#### MuleSoft for Application Integration
MuleSoft provides an AI-powered, end-to-end integration lifecycle. With MuleSoft Vibes, Developers can use natural language prompts to design APIs, build integrations, and generate unit tests. The platform supports development in any IDE, including Cursor or VSCode, using local MCP servers to accelerate delivery.
The architecture centers on extensible connectivity: a universal bridge that connects AI agents, SaaS apps, legacy systems, and partners. This single platform makes sure that any asset can support the business in real time, regardless of where the asset lives.
Connectivity without oversight creates risk. That is why we allow teams to register, secure, and observe every asset and application. By providing a comprehensive AI toolset, we give IT the visibility and guardrails to manage the application lifecycle with total confidence.
MuleSoft also supports the broader ecosystem with enterprise B2B and EDI. This integration simplifies partner management while maintaining end-to-end compliance.
Ultimately, MuleSoft ensures that every part of the enterprise is not just connected, but governed and ready to act in real time.
#### Informatica for Data Integration
Business velocity requires a foundation of trust. Informatica ensures that the enterprise acts on trusted, high-quality data, avoiding the liability of fast, yet unreliable, insights.
The Informatica platform can transform raw data into enterprise-ready assets. Its low-code environment facilitates instant scaling without increasing headcount. With over 300 pre-built connectors supporting all integration styles—including ETL, ELT, and Reverse ETL—it can integrate, govern, and prepare virtually any existing data for AI-driven initiatives.
### The Trusted Data Management Foundation for AI
Informatica is the data management powerhouse, essential for AI success. It provides a complete suite of capabilities, from cataloging to governance, that transforms organizations from data-rich to insight-driven.
AI is only as effective as the data that feeds it, and for most organizations, this data is siloed, duplicated, and inconsistent. This represents a significant risk, as “dirty” data leads to untrustworthy AI output.
This is where Informatica MDM excels. Instead of merely connecting data, we unify it. It breaks down disconnected silos to create a 360-degree view of customers, products, and suppliers, establishing a single, trusted source of truth. This unified view allows teams to confidently make AI-driven decisions without debating data accuracy.
Informatica is crucial for both initiating AI and scaling a trusted AI foundation across the entire enterprise.
Best of all, Informatica has automated the heavy lifting. With CLAIRE GPT, the platform streamlines the match, merge, and governance processes. This delivers a single source of truth to customers at lightning speed while eliminating manual effort.
Achieving a single source of truth is the first step. As data flows into analytics, applications, and AI, a critical concern emerges for CDOs and CIOs: "Can we truly trust this data everywhere it is consumed?"
In the AI era, data governance and quality are essential. They must be automated and intrinsically built-in, a capability Informatica is designed to deliver. Informatica embeds a layer of trust, ensuring that data is accurate and compliant before it reaches a dashboard or an AI model.
Informatica tracks not only the data, but its lineage, precisely showing its origin and access history to establish confidence in its reliability. This certainty is required to operate at scale.
Ultimately, Informatica connects metadata with business context. When a customer launches an AI project, they aren't just moving quickly—they are moving with absolute certainty.
### Unlock the Agentic Enterprise
MuleSoft and Informatica offer complementary agent capabilities. MuleSoft Agent Fabric serves as the unified control plane, providing end-to-end governance, orchestration, and observability. Informatica’s data agents and MCP servers plug into this fabric, delivering trusted data access and governed data actions, such as feeding MDM data or catalog metadata to the ecosystem.
Together, they allow customers to scale their investments seamlessly. To operate this integrated ecosystem at enterprise scale, MuleSoft Agent Fabric provides a systematic, four-pillar framework:
1. **Discover:** Gain complete visibility into your agent ecosystem. The Agent Registry and built-in scanners automatically synchronize and catalog every A2A agent and MCP server—including Informatica assets and external agents from Amazon Bedrock or Google Vertex—ensuring instant discovery and reuse.
2. **Orchestrate:** Coordinate agents and APIs to execute complex workflows. The Agent Broker dynamically routes tasks to the correct agent or tool, eliminating manual handoffs and transforming scattered individual agents into a reliable, coordinated workforce.
3. **Govern:** Apply secure, policy-driven control to every interaction. Trusted Agent Identity and Flex Gateway enforce compliance and access controls across three levels: end-to-end interactions, model-layer LLM requests, and execution-layer actions.
4. **Observe:** Track agent reasoning, performance, and collaboration in real time. Agent Visualizer and centralized monitoring provide complete transparency, allowing IT teams to validate decisions, detect anomalies, and optimize agent outcomes.
The integration of MuleSoft’s control plane and Informatica’s data agents provides a unified framework for governed, real-time action. This synergy powers the agentic enterprise by anchoring agile orchestration in a foundation of trusted context.
## Learn More about MuleSoft and Informatica
To build a resilient agentic enterprise, organizations must move beyond treating data integration and application integration as isolated efforts. By leveraging Informatica to govern high-volume data assets and MuleSoft to orchestrate real-time application and agent workflows, enterprises establish a secure, scalable foundation.
Explore the dedicated resources for each platform to deepen your understanding. To learn more about real-time application connectivity, API-led integration, and the MuleSoft Agent Fabric for AI orchestration, explore the official [MuleSoft](https://www.salesforce.com/mulesoft/) product page. For comprehensive details on data management, governance, and Master Data Management MDM capabilities, visit the [Informatica](https://www.informatica.com/salesforce.html) resource hub. You’ll find detailed specifications on each platform’s features, which will help you map the right architecture to your specific environment.
# Introduction
In the evolving multi-agent landscape, agents are most effective when assigned specific, granular tasks. This necessitates a diverse network of reusable, specialized agents. The core challenge, however, is coordinating these numerous, heterogeneous agents, which can originate from various sources, to collaborate effectively toward common business objectives. Without a unified platform, this complexity leads to agent sprawl and a critical lack of governance.
These AI Agents are multiplying rapidly, embedded in SaaS platforms, developed in-house, or packaged with popular LLMs. This multiplication results in disconnected organizational silos. While an agent optimizes tasks within its native applications, it often lacks a holistic enterprise-view. This lack of visibility prevents agents from effectively orchestrating, securing, and governing actions across different domains and systems.
MuleSoft Agent Fabric addresses the challenge of managing "agent sprawl" and enabling the seamless orchestration of diverse agents, regardless of their origin. It establishes architectural best practices and provides the necessary tooling to create the Agent Network. An Agent Network refers to a coordinated collection of AI agents, tools, and resources that work together to execute complex, multi-step business processes.
## Components
MuleSoft Agent Fabric is a unified platform that gives every enterprise an easy way to discover, orchestrate, govern, and observe any agent regardless of where it's built.
**Discover:** Agent Registry provides a centralized catalog of all AI agents and tools across the organization. It enables discovery and reuse of internally built, SaaS-embedded, and external assets. By providing a single source of truth for all agentic assets, Agent Registry eliminates redundancy and ensures developers can leverage existing capabilities at scale.
**Orchestrate:** MuleSoft Agent Broker is an intelligent routing solution that dynamically matches tasks to the best fit agent or tool. Powered by an LLM of your choice, it coordinates across agents and tools to ensure that complex multi-step requests and business processes are executed with high reliability and traceable outcomes.
**Govern:** [MuleSoft Agent Governance](https://www.mulesoft.com/platform/ai/ai-agent-governance) utilizes Flex Gateway and its support for [Model Context Protocol (MCP)](https://www.mulesoft.com/platform/ai/model-context-protocol) and [Agent2Agent (A2A) protocol](https://www.mulesoft.com/platform/ai/a2a-support). With Flex Gateway, enterprises can enforce security and compliance policies to every agent-agent and agent-tool interaction.
**Observe:** Agent Visualizer provides real-time observability through a dynamic, interactive map of agent interactions. It traces decisions, monitors system health, thus enabling continuous optimization and reliable oversight of the entire agent ecosystem.
Agent Fabric champions a specification-first (YAML) approach where users define agent networks through a metadata descriptor (the "YAML file"). This YAML file is agnostic to MuleSoft and it decouples the definition of the agent network from its execution.
## Agent Network Specification (Metadata Descriptor)
Each agent network (YAML) defines a specific functional area with its agentic assets, including their operational rules and policies. The YAML is used to enable the four Agent Fabric pillars:
1. Discover: Populate the Agent Registry with existing Agentic Assets such as:
1. Agents deployed across various platforms (MuleSoft or others)
2. MCP servers
3. LLM providers
2. Orchestrate: Create Agent Brokers for orchestration
3. Govern: Apply policies on the assets for security and governance
4. Observe: Define and reuse connections to the defined assets. Also, observability and monitoring capabilities are available for agent networks.
### Authoring
The user journey starts in Anypoint Code Builder. Use the new command available via command palette called “MuleSoft: Create an Agent Network Project” to create a new project. This command creates a new project (the ‘Agent Network’) containing two files.
- **agent-network.yaml:** This file defines configuration for the multi-agent system, enabling orchestration of AI agents with external tools (via MCP) and agents (via A2A protocol). This format provides a declarative way to define agent capabilities, dependencies, and integrations.
- **exchange.json:** All agent network projects also have an exchange.json file. This file contains asset metadata available in Anypoint Exchange after your agent network assets are published.
The development of your Agent Network follows a standard Software Development Lifecycle (SDLC) involving four main stages:
1. **Environment setup:** Setup runtime environment and gateways
2. **Project creation and design**: Create Agent Network project specification
3. **Building and publication:** Build and publish assets to the Agent Registry
4. **Deployment:** Deploy or promote the agent network to a given environment
After you build the project and generate the required MuleSoft application and assets, make them available in Exchange. Within Anypoint Code Builder, trigger the build and publish process by using the **_“MuleSoft: Publish Agent Broker Project to Exchange”_** command available via command palette.
The publish step transforms each agentic asset in the YAML file into an A2A, MCP or LLM specification and publishes it to Exchange.
Additionally, the system **publishes** the YAML to Exchange by using a new agent-network asset type. You can **view** this asset in the Agent Registry UI and **search** for it via the Exchange API.
### Example
Refer to an [Agent Network file](https://docs.mulesoft.com/anypoint-code-builder/af-project-files) that defines an agent network for an enterprise. This agent network activates the network for order fulfillment across Salesforce, Stripe, another order fulfillment agent and inventory MCP server with a single, policy-governed experience.
- **Discover**
Publish existing agents and tools (such as Salesforce, Stripe, Order Fulfillment, and Inventory) as Exchange assets for reuse. Also the order fulfillment definition (YAML) which is versioned and shareable, enabling rapid adaptation for roles, regions, or subsidiaries without rebuilding flows.
- **Orchestrate**
An agent broker uses an LLM to decompose the order fulfillment process into a sequence of tasks, such as verifying customer details, allocating inventory, and calculating shipping costs. It then executes this workflow by calling MCP and A2A agents, ensuring human-in-the-loop approvals are requested whenever required.
- **Govern**
Anypoint Flex Gateway enforces authentication, least‑privilege access, and guardrails. API Manager policies ensure consistent controls across all calls and data exchanges.
- **Observe**
Monitoring and traces give end‑to‑end visibility into progress, failures, and latency. Visualization shows which agents interacted and where bottlenecks occurred.
- **Trust and Compliance**
Centralized credentials, audit trails, and policy inheritance support security, privacy, and regulatory requirements (PII handling, approvals, and separation of duties).
The diagram shows the different nodes of the Agent Network (Metadata) defined in the YAML.
## Agent Registry (Discover)
- **Purpose**: Exchange is the catalog for agents, tools, and other assets. Its primary goal is to solve "agent sprawl" by providing a single, governed catalog for the discovery, curation, and lifecycle management of heterogeneous agents. It enables developers to find and reuse agents, platform owners to maintain visibility, and orchestrators to discover capabilities.
- **Heterogeneous by Design**: Anypoint Exchange now supports three new assets \- Agents, MCPs, and LLMs. Exchange is designed to be a universal catalog, to register and manage any type of agent. It supports A2A-compliant Agents, MCP Servers, and LLM providers from any source, including third-party, Agentforce, and custom MuleSoft agents.
- **Core Metadata**: Every registered asset has a baseline set of immutable metadata, including a Unique Name and Version, Ownership and Publisher. Lifecycle states (development, staging, production, deprecated) are also tracked.
- **Discovery**:
- **Design-Time**: Developers can discover registered agents either through the existing Exchange UI or via natural language search with Vibes within the Anypoint Code Builder.
- **Tagging and Classification**: Assets can be classified by type (agent, MCP, LLM, broker) and domain (for example,HR, weather) by using a basic key-value tagging system, enabling dynamic linking, search, and selection policies.
- **Catalog**: The repository supports both private and internal catalog models for sharing agents within an organization.
- **Visualization**: Provides a visual tool to support network views, showing connections for single assets or the entire map of nodes and links across the organization, with filtering capabilities.
Brokers within an agent network can reference registered agents, MCP servers, and LLM providers stored in Anypoint Exchange. But if they’re not already registered, they can be declared in the metadata of Agent Network (YAML) and they get registered automatically. In the example, multiple agents, MCP servers, and LLM providers are declared and registered in Anypoint Exchange.
```
agents:
orders-agent:
label: Order Fulfilment Agent
metadata:
protocol: a2a
platform: OpenAI
salesforce-agent:
label: Salesforce Agent
metadata:
protocol: a2a
platform: OpenAI
stripe-agent:
label: Stripe Payment Agent
metadata:
protocol: a2a
platform: OpenAI
mcpServers:
inventory:
label: Inventory MCP
metadata:
transport:
kind: streamableHttp
path: /mcp
llmProviders:
open-ai:
label: OpenAI
description: OpenAI LLM Provider
metadata:
platform: OpenAI
```
## Agent Broker (Orchestrate)
An agent broker is an intelligent routing agent that coordinates task delegation across specialized agents in an enterprise. It’s defined by the agents and MCP servers that it uses to accomplish tasks.
A broker is a specialized agent that appears in Anypoint Exchange after publishing an agent network asset and reuse by other brokers.
Brokers are defined in the _brokers_ section of the YAML. The defined brokers are transparently “compiled” into an application, without requiring any prior knowledge about Mule. This generated application gets deployed to CloudHub 2.0 (CH2), and leverages the robust CH2 infrastructure.
This means the Agent Brokers benefit from CloudHub 2.0's established performance characteristics, including its logging and metrics capabilities. Operational aspects, such as "Cost to Operate" and "Monitoring/Alerting/Tooling," are the same as any other workload.
For scenarios requiring human intervention (Human-in-the-Loop), the state of each interaction is maintained by using MuleSoft Object Store, a distributed solution designed for effective state management in highly concurrent environments.
A broker definition is made of two sections: card and spec.
### Card
The card section follows the [Agent-to-Agent (A2A) specification](https://a2a-protocol.org/v0.2.5/specification/). Among other things, it describes the broker agent's contract, skills, and capabilities. The card url is automatically populated with the value ${ingressgw.url}/broker-name. Upon deployment, the ${ingressgw.url} placeholder is automatically replaced with the url of the Anypoint Flex Gateway that’s fronting the agent ingress requests.
### Specification
The specification section configures the “source code” of the broker. Here, the developer can specify the LLM to use, instructions, available tools, error handling, and most importantly, the various agents and MCP tools that are available to this broker.
**LLM Providers**
This section is part of the specification in each broker. This is a reference to one of the LLMs defined in the services section. We can choose whether to share one LLM across all the brokers, or if needed have different brokers use the LLM that better suits its tasks.
Brokers can point to LLM providers. We can choose models of these providers depending on our needs.
```
llmProviders:
open-ai:
label: OpenAI
description: OpenAI LLM Provider
metadata:
platform: OpenAI
```
**Instructions**
This section is optional, and you can use it to specify instructions particular to this broker agent. These instructions often focus on specific business-oriented concerns. For example, imagine a customer service agent that coordinates management for customer reported incidents:
```
instructions:
- |
You are an Incident Management Orchestrator Agent. Your primary responsibility is to coordinate the resolution of incidents reported by customers.
The process for incident management is:
1. Fetch Salesforce Case Details: Retrieve the latest critical case details for the given customer.
2. Fetch Entitlement Details: Obtain the customer's entitlement information.
3. Fetch On-Call Engineer: Identify the current on-call engineer for the incident.
4. Create Slack War Room and invite on-call engineer: Set up a Slack war room channel and invite the on-call engineer.
5. Summarize Actions: Provide a clear, human-readable summary of the steps performed, including information about the created slack channel and the on-call engineer assigned
```
Notice that there’s no need to provide explicit instructions—such as **'split the prompt into tasks' or 'select the best tool'**—as the broker handles that on its own. These instructions are only necessary when describing specific business processes.
**Tools Configuration**
Tools provide agents with external capabilities. Whenever a broker needs to access an external system (that is not another agent, for example, an existing API or a SaaS service) it reaches out to an MCP (Model Context Protocol) server:
```
tools:
- mcp:
server: collaboration-mcp # MCP server reference
allowed: # Allowlist specific tools
- create_channel
- invite_user
```
The MCP server is referenced by the name of the exchange asset. The connectivity details for it are specified in the services section.
By default, the broker has access to all the tools available in the MCP server. Per our observation, the most modern LLMs can only handle around 20 \- 25 tools per context before starting to generate inaccuracies (or lose context). For this reason, it’s generally a good practice to limit the available tools to the bare minimum needed. You can apply that filtering through the allowed lists.
**Agent Links**
This section is the most important part of the entire definition. The links section enables inter-agent communication and orchestration. That means that this broker relies on the agents linked here to execute the appropriate actions to complete the user’s goal.
```
links:
- agent:
ref:
name: orders-agent
- agent:
ref:
name: salesforce-agent
- agent:
ref:
name: stripe-agent
```
In effect, this section defines an agent-network for collaboration.
## Flex Gateway (Govern)
Agent Governance is a critical pillar for the Agent Fabric, foundational to building a trusted agent network and ensuring security and compliance.
For governance, a total of two Flex Gateways (1 ingress and 1 egress) are required within your private space.
Governance establishes the necessary structures, controls, and evidence to safely scale the entire Agentic Development Lifecycle (ADLC). Specifically, governance implements key processes such as agent certification, cataloging, lifecycle decisions, and the enforcement of runtime policies.
- **Cataloging:**
- Exchange: Supports recording of agent purposes, owners, environments, and data and classification boundaries. It also registers capabilities, tools, resources, prompts, and external dependencies with versions.
- **Versioning and Lifecycle:**
- Document and manage semantic versioning of agents, tools, and assets during the complete Agent Development Lifecycle.
- Versioning helps manage agent deprecation timelines and supports dual-run (where possible) ensuring smooth migrations.
- **Policy Enforcement**:
- Agentic AI architecture expands the attack surface (conversations interface, prompts, and new protocols like MCP). Any compromise to any components can lead to cascading effects to multiple systems providing components like protocol, prompt, API, or tool.
- Securing enterprise agentic AI deployments demands a specialized approach, as these autonomous and unpredictable environments inherently broaden the attack surface through agent-to-agent interactions. While existing security tools for static systems are essential, they’re no longer sufficient on their own. Enterprises must proactively plan and implement four specific security solutions, each directly addressing a critical business risk associated with agentic AI.
- Flex Gateway: All A2A and MCP traffic is routed through Flex Gateway, even if the target system is unsecured, to ensure that policies are applied on every endpoint. This routing is crucial for securing agent communications and integrating with Authorization Servers.
- Policy Bundles: Users can define and apply bundles of predefined policies to workflows before execution, enforcing a consistent set of security and operational policies.
- Types of policies: The platform supports various inbound and outbound policies, including:
- A2A Policies: Agent Card, PII Detector, Prompt Decorator, Schema Validation.
- MCP Policies: Attribute-Based Access Control, Schema Validation, MCP Support.
- LLM/AI Policies: AI Prompt Decorator, AI Prompt Guard (filtering harmful content), AI Prompt Template (applying predefined templates), AI Basic Token Rate Limiting.
- Telemetry Policies: A2A and MCP Telemetry to extend Open Telemetry solutions for log data collection and export.
- **Logging**: Thanks to auto-tracing, logs across the Agent Network are available to track every agent interaction, explaining behaviors and building trust.
The example depicts a policy for message logging, which is configured by using the agent network metadata. Orderfullfillment broker refers to an existing agent called Salesforce agent and the policy for the messaging is configured by using the metadata. Note that Agent Fabric automatically configures all the policies mentioned under the “spec” section on Flex Gateway. You don’t require extra steps.
```
salesforce-agent-connection:
kind: agent
ref:
name: salesforce-agent
spec:
url: ${salesforce-agent.cardUrl}
policies:
- ref:
name: message-logging
namespace: 68ef9520-24e9-4cf2-b2f5-620025690913
configuration:
loggingConfiguration:
- itemName: "Payload"
itemData:
message: "#[payload]"
firstSection: true
secondSection: true
level: "INFO"
- itemName: "Headers"
itemData:
message: "#[attributes.headers]"
firstSection: true
secondSection: true
level: "INFO"
```
## Agent Visualizer (Observe)
Given the non-deterministic nature and complexity of LLM agents and multi-agent deployments, observability, and monitoring are critical.
- **Basic Logs and Traces**: Reasoning and tool execution tracing are provided through logs. Logs and traces from workflow executions are viewable post-execution in Runtime Manager.
- **Metrics**: In the initial phase, the platform publishes a2a_total_calls and mcp_total_calls as counters with labels (such as, path, status, method, tool) to determine total, successful, and failed calls. These metrics are published from policy code by using Envoy's (Flex Gateway) native stats interface, preferably via existing policies like mcp_support_policy and a2a_agent_card_policy.
- **Enhanced Observability (Future)**: Plans include using Open Telemetry for distributed tracing in future versions. More advanced observability includes:
- **Detailed Request Tracing**: Gaining end-to-end visibility into requests, encompassing prompts, planner processes, invoked actions, and interactions with sub-agents.
- **Agent Health Monitoring**: Monitoring agent uptime, response latency, throughput, error rates, and underlying resource utilization (CPU, memory, network, GPU).
- **Multi-agent Coordination Monitoring**: Capturing success and failure rates of agent-to-agent interactions, detecting circular invocation patterns (loops), and tracking per-agent metrics like task completion and invocation count.
- **Cost Tracking**: Tracking token usage and associated costs for each LLM call, ideally per agent, with dashboards and alerts.
- **Cognitive Tracing**: Capturing and displaying a detailed trace of an agent's session, including internal thought processes and all tool calls, serving as an immutable audit trail.
- **Agent Session Playback**: A UI that allows visually "replaying" an agent's cognitive trace step-by-step for deep debugging.
- **DAG Visualization**: Providing a Directed Acyclic Graph (DAG) visualization of the agent workflow execution for complex multi-agent interactions.
Agent Visualizer is used to identify the parts of your agent network and see how they work together.
- Distinguish node types (agents and MCP servers).
- View the edges to see declared and runtime interactions.
- Use layers to focus views on specific environments
- Open details cards to inspect metadata and metrics for nodes and access logs and traces
- Review governance indicators such as Flex Gateway protection and applied policies.
Find details about the components of Agent Visualizer [here](https://docs.mulesoft.com/agent-visualizer/agent-visualizer-components).
## Agent Fabric: Four Pillars Together
With these four pillars together, MuleSoft Agent Fabric extends the security and control to any agent with built-in governance. It empowers agents to act anywhere by leveraging new protocols like A2A (Agent to Agent) and MCP (Model Context Protocol) to build and extend the business processes. We connect everything \- applications, data, and systems \- to empower and govern agents as they act across the entire business. Intelligent tooling supports the creation and extension of business processes or APIs by using AI natively, or by bringing third party AI tools.
Using all four pillars together isn’t required, but recommended. You can choose pillars independently as needed. For instance, you can leverage Agent Fabric for registry and governance, without using the orchestration layer. Similarly, you can use the broker to orchestrate agents that are governed through another platform.
The diagram shows how all the four components interact with each other:
1. Publish the agentic assets to Anypoint Exchange for discovery and reuse after you define the agent network (brokers, agents, MCP servers) in the agent network YAML in Anypoint Code Builder.
2. Deploy the agentic assets to CloudHub 2.0 (managed in Runtime Manager).
3. Enforce policies on incoming traffic to the network with an ingress Flex Gateway, which sits in front of broker and API endpoints.
4. Enforce policies, manage connections, and emit telemetry data with an egress Flex Gateway. This gateway sits on outbound paths from brokers and agents to external services.
5. Collect logs, metrics, and traces from Flex Gateway and runtimes in Anypoint Monitoring.
## Agent Orchestration Design Patterns
It’s tempting to make every specialized agent immediately accessible in a flat, unrestricted architecture, with a single orchestrator capable of tackling any task by having access to every AI asset available. However, this approach quickly proves detrimental to the overall system's efficiency and reliability. Much like the principle applied to an excess of individual tools, many agent options introduce significant noise and complexity for the central **broker agent** (or orchestrator). This increased complexity directly leads to a noticeable drop in both the accuracy of the broker's decision-making ( selecting the right agent for the job) and the determinism of the system's response (predictable, consistent outcomes for similar queries). The broker agent effectively suffers from option paralysis, leading to slower, and less reliable routing.
Instead of a flat structure, we strongly advocate for a **multi-level hierarchical approach** to structuring the Agent Network. This organizational principle offers numerous critical advantages. First, it inherently favors **traceability and management**. A hierarchical structure mirrors established organizational best practices, making it easier to audit the flow of a request, debug issues by pinpointing the layer of failure, and manage the deployment and retirement of specific agents or sub-networks.
Secondly, and crucially in the context of large language models (LLMs) which power these agents, a hierarchy helps dramatically with **keeping context sizes in check**. By segmenting the agent landscape, the broker agent at any given layer only considers the limited set of agents or sub-brokers directly beneath it. This structure prevents the primary orchestrator from loading the description, capabilities, and historical context of _every agent_ into its working memory, **avoiding** the risk of quickly **exceeding** the LLM's context window limits, and **incurring** prohibitive costs and latency.
The agent network can be implemented in multiple ways. Two of them are:
1. Conway’s Law \- Intuitive way to map it to the real-world hierarchical structure.
2. Domain Driven Design \- More focused on business domains
## Option 1: Mapping with Real-World Hierarchical Structure
In a hierarchical organization, communication flows vertically \- from managers to subordinates \- and decisions are often centralized. According to Conway’s Law:
- The systems or software architectures built by such organizations tend to be layered and hierarchical as well.
- Each team tends to design subsystems that reflect its own boundaries and authorities.
- The interfaces between systems mirror the communication channels between the departments.
The Agent Network can also be intuitively mapped to the **real-world hierarchical structure of a large enterprise** following Conway's Law.
- **The Conceptual Model:** Just as a corporation has distinct divisions, departments, and layers of management (for example, C-suite, VPs, Directors, Managers), an agent network operating within a specific domain can be modeled as a parallel organizational chart.
- **The Nodes and Leaves:** In this hierarchy:
- **The Leaves** of the tree structure are the **Specialist Agents** or **MCPs**. They’re the functional units that perform the actual work (for example, a "Database Query Agent," a "Customer Authentication Agent," a "Sentiment Analysis Agent"). They represent the individual contributors or working units of the organization.
- **All Other Nodes** in the hierarchy, including the root and intermediate layers, are **Broker Agents** (or Sub-Orchestrators). These agents don’t perform the final task but are responsible for routing, delegation, aggregation, and conflict resolution within their specific domain or layer. A high-level broker delegates a task to a "Sales Domain Broker," which in turn delegates to an "Opportunity Management Broker," which performs the task via an "Opportunity Status Update Agent" (the leaf).
This structure makes sure that complexity is managed locally, context is contained, and the system scales predictably and reliably. You can introduce new specialist agents into specific, appropriate branches of the organizational tree.
Consider the analogy of an org-chart for digital labor. Each YAML file represents each of the internal organizations (Employee Success, Security, Finance, and so on). Within each organization (agent-network) you may have a hierarchical structure through which actors collaborate, jobs are split into tasks and assigned. In the preceding diagram, communication flows from top to bottom. And the leaves aren’t restricted for consumption only by a set of broker agents.
## Option 2: Domain Driven Design and Agentic AI Implementation
Modeling agent networks based on the human organizational chart carries the risk of requiring frequent re-architecting, particularly in companies that undergo frequent re-organizations. An alternative approach is to organize agents by functional domain. This grouping may require crossing traditional human organizational boundaries. For example, new employee onboarding involves IT operations for hardware and user provisioning, while a sales motion requires both operations and marketing.
## About the Authors
Nikhil Aggarwal is a Principal Architect at Salesforce, where he leads architecture for MuleSoft and Salesforce Automation Clouds. Nikhil brings over 18 years of experience delivering large-scale products and is passionate about scalable architecture, intuitive developer experiences, and building high-performing teams. Prior to Salesforce, he led multiple initiatives in Microsoft Power Platform, Dataverse, and Office 365 from concept to launch. His work continues to shape how modern enterprises connect systems, automate workflows, and unlock business value in the AI-first era.
Mariano Gonzalez joined MuleSoft in its early days back in 2011, specializing in mission-critical distributed systems, integration, PaaS, and cloud computing. Today, Mariano's focus is on advancing AI platforms, with particular attention to governance, orchestration, discovery, and observability. With over 20 years in the IT industry, Mariano has served as a software architect and team leader, designing and delivering BPM, ERP, and integration solutions across the agriculture, energy, government, IT, telecom, and content management sectors.
Pedro Colunga is a Software Engineer Architect at Salesforce, specializing in API and Metadata Architecture. With a focus on the full platform lifecycle, Pedro plays a key role in shaping how organizations interact with system intelligence, semantics, and metadata-driven solutions. Pedro's 20-year career, which includes entrepreneurial experience, spans companies such as Fuego, BEA Systems, Oracle, and TekGenesis, a company later acquired by MuleSoft, where he has consistently driven platform-wise architecture, providing deep expertise in areas like BPM, RAD, and Integrations.
Gulal Kumar is a Software Engineering Architect at Salesforce, with a focus on data and integration architecture. With over 20 years of experience in integration and APIs, modernization programs, security, and AIML initiatives, he brings a wealth of expertise. Gulal has been committed to advancing business transformation initiatives, enhancing security and resiliency, promoting architecture excellence, and leading AIML initiatives across various domains.
Every day, [hundreds of thousands of enterprises and millions of users](https://www.salesforce.com/customer-stories/) operate their business in the cloud using applications powered by the Salesforce Platform. Why is the platform so successful? Why can you trust it to support your business? What unique benefits does the platform provide for businesses like yours?
This technical brief explains how the Salesforce Platform delivers reliable, scalable, and easy-to-customize end-user experiences using its unique software architecture for cloud computing. After reading this brief, you’ll better understand the underlying technology that makes the Salesforce Platform a compelling choice for your business applications.
# Platform Overview
The Salesforce Platform is the preeminent example of a successful cloud computing platform and related ecosystem of applications. Since the turn of the millennium, the platform has been the enabling foundation for:
- Many popular [business-purpose applications](http://www.salesforce.com/products/) for common use cases such as sales and customer service
- [Industry-specific applications](https://www.salesforce.com/solutions/industries/) for more specialized use cases such as finance and healthcare
- Millions of [custom applications and application extensions](https://www.salesforce.com/products/platform/overview/) for unique use cases
In large part, the Salesforce Platform is so successful and popular because its unique software architecture supports applications that are easy to build, use, customize, and extend with exceptional [performance and reliability](http://trust.salesforce.com/trust/). The heart of the platform’s software architecture is its multitenant, metadata-driven design.
The Salesforce Platform’s software architecture is:
- _Multitenant_ — It isolates and concurrently supports the varying requirements of many _tenants_ (organizations, business units, and so on).
- _Metadata-driven_ — It lets every tenant easily and quickly customize their apps and user experiences using _metadata_, data that describes elements such as the user interface (UI) and business logic.
When you create a new application object or write some code using the Salesforce Platform, the platform does not create an actual table in a database or compile any code. Instead, the platform simply stores some metadata that it can then use at runtime to dynamically materialize virtual application components. The platform ensures that every tenant’s metadata is private and easy to update without any locking or downtime required so that every tenant can build and customize apps in isolation. The Salesforce Platform uses the same metadata to provide custom APIs, _RESTful and web services (SOAP-based)_ interfaces you can use to integrate your applications with other applications and automated processes.
Ready-made solutions are also available in [AppExchange](https://appexchange.salesforce.com/), the platform’s expansive app marketplace. Built by a vast ecosystem of trusted partners and independent software vendors (ISVs), an AppExchange package is metadata from a third-party that describes free or paid-for application extensions and entire applications that you can use to meet specific business requirements.
To support this highly customizable and extensible architecture, a single instance of the Salesforce Platform uses:
- A single shared _multitenant database_ with a single schema that stores tenant-specific metadata and data.
- A _multitenant kernel_ (application runtime) that reads metadata and data to dynamically provide tenant-specific applications, business logic, and APIs for each tenant’s users at runtime.
This clear separation of the Salesforce-managed kernel from tenant-managed metadata makes it possible for Salesforce, tenants, and ISVs to independently evolve their portions of the system without interference.
To build on this overview, subsequent sections of this article provide more detail about the unique capabilities of the platform that stem from key aspects of its design, including:
- The Platform Data Layer
- Platform Application Development
- Internal Platform Processing
- Platform Infrastructure
## The Platform Data Layer
Together, the Salesforce Platform’s application runtime and innovative data layer safely isolate tenant-specific data, schema customizations, and business logic. At a high level, the schema supports a variety of use cases:
- When you create or customize an application, the platform stores related metadata in shared database tables that maintain metadata for all tenants.
- When you use an application to read or write data, the platform stores your data in shared database tables that maintain data for all tenants.
- Behind the scenes, the platform also maintains internal metadata in a number of tables that the kernel uses to optimize request latency at runtime.
But how can a single shared database and schema keep every tenant’s data private? Every tenant on the platform is known as an _organization_, or _org_ for short. And every org-specific record in shared database tables has an _OrgID_. When the kernel accesses the database, it uses this unique identifier to ensure that each org’s activities are private.
### Metadata
Org-specific objects (think tables in traditional relational database parlance), fields, stored procedures, database triggers, and more are all virtual constructs described by metadata that the platform stores in a few database tables known as the _Universal Data Dictionary (UDD)_.
- _MT_Objects_ is a database table that stores metadata about the objects that you define for an application, including a unique identifier for an object (ObjID), your org (OrgID), and the name you give for the object (ObjName).
- The _MT_Fields_ system table stores metadata about the fields (columns) that you declare for each object, including a unique identifier for a field (FieldID), your org (OrgID), the object that contains the field (ObjID), the name of the field (FieldName), the field’s data type, a Boolean value to indicate if the field requires indexing (IsIndexed), and the position of the field in the object relative to other fields (FieldNum).
Because metadata is a key ingredient, the platform must optimize access to metadata; otherwise, frequent metadata access would prevent the service from scaling. With this potential bottleneck in mind, the platform uses massive and sophisticated _metadata caches_ to maintain the most recently used metadata in memory, avoid performance-sapping disk I/O and code recompilations, and improve application response times.
### Data
The _MT_Data_ system table stores the application-accessible data that maps to all org-specific tables and their fields, as defined by metadata in MT_Objects and MT_Fields. Each row includes identifying fields, such as a global unique identifier (GUID), the org that owns the row (OrgID), and the encompassing object identifier (ObjID). Each row in the MT_Data table also has a Name field that stores a “natural name” for corresponding records; for example, an Account record might use “Account Name,” a Case record might use “Case Number,” and so on.
Value0 ... ValueN _flex columns_, also known as slots, store application data that maps to the tables and fields declared in MT_Objects and MT_Fields, respectively. All flex columns use a variable-length string data type so that they can store any structured type of application data (strings, numbers, dates, and so on). As the following figure illustrates, no two fields of the same object can map to the same slot in MT_Data for storage; however, a single slot can manage the information of multiple fields, as long as each field stems from a different object.
MT_Fields can use any one of a number of standard structured data types such as text, number, date, and date/time, as well as special-use, *rich-structured data types* such as picklist (enumerated field), auto-number (auto-incremented, system-generated sequence number), formula (read-only derived value), master-detail relationship (foreign key), checkbox (Boolean), email, URL, and others. MT_Fields can also be required (not null) and have custom validation rules (for example, one field must be greater than another field), both of which the platform enforces.
When you declare or modify an object, the platform manages a row of metadata in MT_Objects that defines the object. Likewise, for each field, the platform manages a row in MT_Fields, including metadata that maps the field to a specific flex column in MT_Data for the storage of corresponding field data. Because the platform manages object and field definitions as metadata rather than actual database structures, the system can tolerate online multitenant application schema maintenance activities without blocking the concurrent activity of other orgs and users. By comparison, online table redefinition for traditional relational database systems typically requires temporary locks and often laborious, complicated processes and scheduled application downtime.
As the simplified representation of MT_Data in the previous figure shows, flex columns are of a universal data type (variable-length string), which enables the platform to share a single flex column among multiple fields that use various structured data types (strings, numbers, dates, and so on).
The platform stores all flex column data using a _canonical format_, and uses underlying database system data type conversion functions (for example, TO_NUMBER, TO_DATE, TO_CHAR) as necessary when applications read data from and write data to flex columns.
MT*Data also contains columns not shown in the previous figure. For example, there are four columns to manage auditing data, including which user created a row and when that row was created, and which user last modified a row and when that row was last modified. MT_Data also contains an \_IsDeleted* column that the platform uses to indicate when a row has been deleted.
The platform also supports the declaration of fields as _character large objects (CLOBs)_ to permit the storage of long text fields of up to 32,000 characters. For each row in MT*Data that has a CLOB, the platform stores the CLOB out of line in a table called \_MT_Clob*, which the system can join with corresponding rows in MT_Data as necessary.
**Note:** The platform also stores CLOBs in an indexed form outside of the database for fast text searches. See [Searches](/docs/architect/fundamentals/guide/platform-multitenant-architecture#searches) for more information about the platform’s text search engine.
### Indexes
The platform automatically indexes various types of fields to deliver scalable performance.
Traditional database systems rely on native database indexes to quickly locate specific rows in a database table that have fields matching a specific condition. However, it is not practical to create native database indexes for the flex columns of MT*Data because the platform uses a single flex column to store the data of many fields with varying structured data types. Instead, the platform manages an index of MT_Data by synchronously copying field data marked for indexing to an appropriate column in an \_MT_Indexes* pivot table.
MT_Indexes contains strongly typed, indexed columns such as StringValue, NumValue, and DateValue that the platform uses to locate field data of the corresponding data type. For example, the platform would copy a string value in an MT_Data flex column to the StringValue field in MT_Indexes, a date value to the DateValue field, and so on. The underlying indexes of MT_Indexes are standard, non-unique database indexes. When an internal system query includes a search parameter that references a structured field in an object, the platform’s custom query optimizer uses MT_Indexes to help optimize associated data access operations.
_Note:_ The platform can handle searches across multiple languages because the system uses a _case-folding algorithm_ that converts string values to a universal, case-insensitive format. The StringValue column of the MT_Indexes table stores string values in this format. At runtime, the query optimizer automatically builds data access operations so that the optimized SQL statement filters on the corresponding case-folded StringValue, which in turn corresponds to the literal provided in the search request.
The platform lets you indicate when a field in an object must contain unique values (case-sensitive or case-insensitive). Considering the arrangement of MT_Data and shared usage of the Value columns for field data, it is not practical to create unique database indexes for the object. (This situation is similar to the one discussed in the previous section for non-unique indexes.)
To support uniqueness for custom fields, the platform uses the MT_Unique_Indexes pivot table; this table is very similar to the MT_Indexes table, except that the underlying native database indexes of MT_Unique_Indexes enforce uniqueness. When an application attempts to insert a duplicate value into a field that requires uniqueness, or an administrator attempts to enforce uniqueness on an existing field that contains duplicate values, the platform returns an appropriate error message to the application.
In rare circumstances, the platform’s external search engine (explained in [Searches](/docs/architect/fundamentals/guide/platform-multitenant-architecture#searches)) can become overloaded or otherwise unavailable, and may not be able to respond to a search request in a timely manner. Rather than returning a disappointing error to the end user, the platform falls back to a secondary search mechanism to furnish reasonable search results.
A _fall-back search_ is implemented as a direct database query with search conditions that reference the Name field of target records. To optimize global object searches (searches that span tables) without having to execute potentially expensive union queries, the platform maintains a _MT_Fallback_Indexes_ pivot table that records the Name of all records. Updates to MT_Fallback_Indexes happen synchronously as transactions modify records so that fall-back searches always have access to the most current database information.
The _MT_Name_Denorm_ table is a lean data table that stores the ObjID and Name of each record in MT_Data. When an application needs to provide a list of records involved in a parent/child relationship, the platform uses the MT_Name_Denorm table to execute a relatively simple query that retrieves the Name of each referenced record for display in the app, for example as part of a hyperlink.
### Relationships
The platform provides _relationship_ data types that an org can use to declare relationships (referential integrity) among tables. When you declare an object’s field with a relationship type, the platform maps the field to a Value field in MT_Data, and then uses this field to store the ObjID of a related object.
To optimize join operations, the platform maintains an _MT_Relationships_ pivot table. This system table has two underlying database unique composite indexes that allow for efficient object traversals in either direction, as necessary.
### Field History
With just a few mouse clicks, the platform provides history tracking for any field. When an org enables auditing for a specific field, the system asynchronously records information about the changes made to the field (old and new values, change date, and so on) using an internal pivot table as an audit trail.
### Data Partitioning
All the platform data, metadata, and pivot table structures, including underlying database indexes, are physically partitioned by OrgID using native database partitioning mechanisms. Data partitioning is a proven technique that database systems provide to physically divide large logical data structures into smaller, more manageable pieces. Partitioning can also help to improve the performance, scalability, and availability of a large database system, such as a multitenant environment. By definition, every platform query targets a specific org’s information, so the query optimizer need only consider accessing data partitions that contain an org’s data, rather than an entire table or index. This common optimization is sometimes referred to as “partition pruning.”
## Platform Application Development
This section covers how app developers can create a schema’s underlying metadata and then build apps that manage data. That metadata and data is stored in the platform data layer described in the previous section.
### Browser-Based, No-Code, and Low-Code Application Development
Developers can declaratively build server-side application components using the platform’s browser-based development environment, commonly referred to as the platform _Setup_ screens. Setup’s point-and-click UI supports all facets of the application schema building process, such as the creation of an application’s data model (including objects and their fields as well as relationships), security and sharing model (including users, profiles, and role hierarchies), user interface (including screen layouts, data entry forms, and reports), declarative logic (workflows), and programmatic logic (stored procedures and triggers). For example, Salesforce Flow makes it easy to automate a wide range of use cases. Setup’s Flow Builder UI, shown below, lets you graphically design and implement workflows that interact with users, or launch automatically based on a schedule or when triggered by an event.
The Setup screens make it easy for anyone to develop and customize applications with no (or very little) code. For example:
- Platform-native UIs are easy to build without any code. Behind the scenes, a native app UI supports all the usual data access operations, including queries, inserts, updates, and deletes. Each data manipulation operation performed by native platform applications can modify one object at a time and automatically commit each change in a separate transaction.
- When defining a text field for an object that contains sensitive data, you can easily configure the field so that the platform encrypts the corresponding data and, optionally, uses an input mask to hide screen information from prying eyes.
- A declarative _validation rule_ is a simple way for an org to enforce a domain integrity rule without any programming. For example, you might declare a validation rule that makes sure that a LineItem object’s Quantity field is always greater than zero.
- A _formula field_ is a declarative feature of the platform that makes it easy to add a calculated field to an object. For example, you might add a field to the LineItem object to calculate a LineTotal value.
- A _roll-up summary field_ is a cross-object field that makes it easy to aggregate child field information in a parent object. For example, you might create an OrderTotal summary field in the SalesOrder object based on the LineTotal field of the LineItem object.
**Note:** Internally, the platform implements formula and roll-up summary fields using native database features and efficiently recalculates values synchronously as part of ongoing transactions.
### APIs
The platform provides several open, [standards-based APIs](https://developer.salesforce.com/docs/apis) that developers can use to build apps. Both _RESTful and web services (SOAP-based) APIs_ provide access to the platform’s many features. Using these various APIs, an application can:
- Manipulate metadata that describes an application schema
- Create, read, update, and delete (CRUD) business data
- Bulk-load or query a large number of records asynchronously
- Expose a near real-time stream of data in a secure and scalable way
### Query Languages
Apps can use the _Salesforce Object Query Language (SOQL)_ to construct simple but powerful database queries. Similar to the SELECT command in the Structured Query Language (SQL), SOQL enables you to specify the source object, a list of fields to retrieve, and conditions for selecting rows in the source object. For example, the following SOQL query returns the value of the Id and Name field for all Account records with a Name equal to the string 'Acme'.
`SELECT Id, Name FROM Account WHERE Name = 'Acme'`
The platform also includes a full-text, multilingual search engine that automatically indexes all text-related fields. Apps can make use of this pre-integrated search engine by using the _Salesforce Object Search Language (SOSL)_ to perform text searches. Unlike SOQL, which can only query one object at a time, SOSL enables you to search text, email, and phone fields for multiple objects simultaneously. For example, the following SOSL statement searches for records in the Lead and Contact objects that contain the string 'Joe Smith' in the name field and returns the name and phone number field from each record found.
`FIND {"Joe Smith"} IN Name Fields RETURNING lead(name, phone), contact(name, phone)`
### Apex and Pro-Code Application Development
_Apex_, which is similar to Java in many respects, is a powerful development language that developers can use to centralize procedural logic in their application schema. Apex code can declare program variables and constants, execute traditional flow control statements (if-else, loops, and so on), perform data manipulation operations (insert, update, upsert, delete), and perform transaction control operations (setSavepoint, rollback).
You can store Apex programs in the platform using two different forms: as a named Apex class with methods (akin to stored procedures in traditional database parlance) that applications execute when necessary, or as a _database trigger_ that automatically executes before or after a specific database manipulation event occurs. In either form, the platform compiles Apex code and stores it as metadata in the UDD. The first time that an org executes an Apex program, the platform’s runtime interpreter loads the compiled version of the program into an MRU (most recently used) cache for that org. Thereafter, when any user from the same org needs to use the same routine, the platform can save memory and avoid the overhead of recompiling the program again by sharing the ready-to-run program that is already in memory.
With the addition of a simple keyword here and there, developers can use Apex to support many unique application requirements. For example, developers can expose a method as a custom RESTful or SOAP-based API call, make it asynchronously schedulable, or configure it to process a large operation in batches.
Apex is much more than “just another procedural language.” It’s an integral platform component that helps the system deliver reliable multitenancy. For example, the platform automatically validates all embedded SOQL and SOSL statements within a class to prevent code that would otherwise fail at runtime. The platform then maintains corresponding object dependency information for valid classes and uses it to prevent changes to metadata that would otherwise break dependent code.
Many standard Apex classes and system static methods provide simple interfaces to underlying system features. For example, the system static DML methods such as insert, update, and delete have a simple Boolean parameter that developers can use to indicate the desired bulk processing option (all or nothing, or partial save); these methods also return a result object that the calling routine can read to determine which records were unsuccessfully processed and why. Other examples of the direct ties between Apex and platform features include the built-in email classes and XmlStream classes.
## Internal Platform Processing
In large part, the platform performs and scales well because Salesforce built it with two important principles in mind:
- Provide efficient, high-scale foundational platform capabilities.
- Help developers do everything as efficiently as possible.
The platform incorporates these principles into the unique processing architectures of the platform, including:
- Queries
- Searches
- Bulk operations
- Schema modification
- Multitenant isolation
- The recycle bin
### Queries
Most modern database systems determine optimal query execution plans by employing a cost-based query optimizer that considers relevant statistics about target table and index data. However, conventional, cost-based optimizer statistics are designed for single-tenant applications and fail to account for the data access characteristics of any given user executing a query in a multitenant environment. For example, a given query that targets an object with a large volume of data would most likely execute more efficiently using different execution plans for users with high visibility (a manager that can see all rows) versus users with low visibility (sales people that can only see rows related to themselves).
To provide sufficient statistics for determining optimal query execution plans in a multitenant system, the platform maintains a complete set of _optimizer statistics_ (tenant-, group-, and user-level) for every org’s objects. Statistics reflect the number of rows that a particular query can potentially access, carefully considering overall org-specific object statistics (for example, the total number of rows owned by the org as a whole), as well as more granular statistics (for example, the number of rows that a specific privilege group or end user can potentially access).
The platform also maintains other types of statistics that prove helpful with particular queries. For example, the platform maintains statistics for all custom indexes to reveal the total number of non-null and unique values in the corresponding field, and histograms for picklist fields that reveal the cardinality of each list value.
When existing statistics are not in place or are not considered helpful, the platform’s optimizer has a few different strategies it uses to help build reasonably optimal queries. For example, when a query filters on the Name field of an object, the optimizer can use the MT_Fallback_Indexes table to efficiently find requested rows. In other scenarios, the optimizer will dynamically generate missing statistics at runtime.
Used in tandem with optimizer statistics, the platform’s optimizer also relies on internal security-related tables (Groups, Members, GroupBlowout, and CustomShare) that maintain information about the security domains of an org’s users, including a given user’s group memberships and custom access rights for objects and rows. Such information is invaluable in determining the selectivity of query filters on a per-user basis. See the [Platform Developer Basics Trailhead](https://developer.salesforce.com/page/Architecting_Force.com_Apps_A_Design_Primer) for more information about the platform’s embedded security model.
The flow diagram in the following figure illustrates what happens when the platform processes a request for data that is in one of the large heap tables such as MT_Data. The request might originate from any number of sources, such as an API call or stored procedure. First, the platform executes “pre-queries” that consider the multitenant-aware statistics. Then, based on the results returned by the pre-queries, the service builds an optimal underlying database query for execution in the specific setting.
As the following table shows, the platform can execute the same query four different ways, depending on the user that submits the query and the selectivity of the query’s filter conditions.
Pre-Query Selectivity Measurements
Write final database access query, forcing...
User
Filter
Low
Low
... nested loops join, drive using view of rows that user can see
Low
High
... use of index related to filter
High
Low
... ordered hash join, drive using MT_DATA
High
High
... use of index related filter
### Searches
Users expect an interactive search capability to scan all or a selected scope of an application’s database and return ranked results with sub-second response times. To provide this capability for platform applications, the platform uses a _search engine_ that is separate from its transaction engine. When you update records, the transaction engine updates the core database and also forwards related data to the search engine for indexing. When you search for records, the search engine uses its indexes to process the query quickly and returns ranked results with links to related database records.
As applications update data in text fields (CLOBs, Name, and so on), a pool of background processes called indexing servers are responsible for asynchronously updating corresponding indexes, which the search engine maintains outside the core transaction engine. To optimize the indexing process, the platform synchronously copies modified chunks of text data to an internal “to-be-indexed” table as transactions commit, thus providing a relatively small data source that minimizes the amount of data that indexing servers must read from disk. The search engine automatically maintains separate indexes for each org.
Depending on the current load and utilization of indexing servers, text index updates may lag behind actual transactions. To avoid unexpected search results originating from stale indexes, the platform also maintains an MRU cache of recently updated rows that the system considers when materializing full-text search results. The platform maintains MRU caches on a per-user and per-org basis to efficiently support possible search scopes.
The platform’s search engine optimizes the ranking of records within search results using several methods. For example, the system considers the security domain of the user performing a search and puts more weight in the rows that the current user can access. The system can also consider the modification history of a particular row, and rank more actively updated rows ahead of those that are relatively static. The user can choose to weight search results as desired, for example, placing more emphasis on recently modified rows.
### Bulk Operations
Transaction-intensive applications generate less overhead and perform much better when they combine and execute repetitive operations in bulk. For example, contrast two ways an application might load many new rows. An inefficient approach would be to use a routine with a loop that inserts individual rows, making one API call after another for each row insert. A much more efficient approach would be to create an array of rows and have the routine insert all of them with a single API call.
Efficient bulk processing with the platform is simple for developers because it is baked into API calls. Internally, the platform also bulk processes all internal steps related to an explicit bulk operation.
The platform’s bulk processing engine automatically accounts for isolated faults encountered during any step along the way. When a bulk operation starts in partial save mode, the engine identifies a known start state and then attempts to execute each step in the process (bulk validate field data, bulk fire pre-triggers, bulk save records, and so on). If the engine detects errors during any step, the engine rolls back offending operations and all side effects, removes the rows that are responsible for the faults, and continues, attempting to bulk process the remaining subset of rows. This process iterates through each successive stage until the engine can commit a subset of rows without any errors. The application can examine a return object to identify which rows failed and what exceptions they raised.
**Note:** At your discretion, an all-or-nothing mode is available for bulk operations. Also, the execution of triggers during a bulk operation is subject to internal governors that restrict the amount of work.
### Schema Modifications
Certain types of modifications to the definition of an object require more than simple UDD metadata updates. In such cases, the platform uses efficient mechanisms that help reduce the overall performance impact on the cloud database service at large.
For example, consider what happens behind the scenes when you modify a column’s data type from picklist to text. The platform first allocates a new slot for the column’s data, bulk-copies the picklist labels associated with current values, and then updates the column’s metadata so that it points to the new slot. While all of this happens, access to data is normal and applications continue to function without any noticeable impact.
As another example, consider what happens when you add a roll-up summary field to an object. In this case, the platform asynchronously calculates initial summaries in the background using an efficient bulk operation. While the background calculation is happening, users who view the new field receive an indication that the platform is currently calculating the field’s value.
### Multitenant Isolation and Protection
To prevent malicious or unintentional monopolization of shared, multitenant system resources, the platform has an extensive set of governors and resource limits associated with platform code execution. For example, the platform closely monitors the execution of a code script and limits how much CPU time it can use, how much memory it can consume, how many queries and DML statements it can execute, how many math calculations it can perform, how many outbound web services calls it can make, and much more. Individual queries that the platform’s optimizer regards as too expensive to execute throw a runtime exception to the caller. Although such limits might sound somewhat restrictive, they are necessary to protect the overall scalability and performance of the shared database system for all concerned applications. In the long term, these measures help to promote better coding techniques among developers and create a better experience for everyone that uses the platform. For example, a developer who initially tries to code a loop that inefficiently updates a thousand rows one row at a time will receive runtime exceptions due to resource limits and then begin using the platform’s efficient bulk processing API calls.
To further avoid potential system problems introduced by poorly written applications, the deployment of a new production application is a process that is strictly managed. Before an org can transition a new application from development to production status, Salesforce requires unit tests that validate the functionality of the application’s platform code routines. Submitted unit tests must cover no less than 75 percent of the application’s source code.
Salesforce executes submitted unit tests in the platform’s sandbox development environment to determine if the application code will adversely affect the performance and scalability of the multitenant population at large. The results of an individual unit test indicate basic information, such as the total number of lines executed, as well as specific information about the code that wasn’t executed by the test.
Once an application’s code is certified for production by Salesforce, the deployment process for the application consists of a single transaction that copies all the application’s metadata into a production platform instance and reruns the corresponding unit tests. If any part of the process fails, the platform simply rolls back the transaction and returns exceptions to help troubleshoot the problem.
**Note:** Salesforce reruns the unit tests for every application with each development release of the platform to proactively learn whether new system features and enhancements break any existing applications.
After a production application is live, the platform’s built-in performance profiler automatically analyzes it and provides associated feedback to administrators. Performance analysis reports include information about slow queries, data manipulations, and subroutines that you can review and use to tune application functionality. The system also logs and returns information about runtime exceptions to administrators to help them debug their applications.
### Deletes, Undeletes, and the Recycle Bin
When an app deletes a record from an object, the platform simply marks the row for deletion by modifying the row’s IsDeleted field in MT*Data. This action effectively places the row in what is known as the \_Recycle Bin*. the platform lets you restore selected rows from the Recycle Bin for up to 15 days before permanently removing them from MT_Data. The platform limits the total number of records it maintains for an org based on the storage limits for that org.
When an operation deletes a parent record involved in a master-detail relationship, the platform automatically deletes all related child records, provided that doing so would not break any referential integrity rules in place. For example, when you delete a SalesOrder, the platform automatically cascades the delete to dependent LineItems. Should you subsequently restore a parent record from the Recycle Bin, the system automatically restores all child records as well.
In contrast, when you delete a referenced parent record involved in a lookup relationship, the platform automatically sets all dependent keys to null. If you subsequently restore the parent record, the platform automatically restores the previously nulled lookup relationships, except for the relationships that were reassigned between the delete and restore operations.
The Recycle Bin also stores dropped fields and their data until an org permanently deletes them or a set number of days has elapsed, whichever happens first. Until that time, the entire field and all its data is available for restoration.
## Platform Infrastructure
_Agility_ is key for enterprises to be successful in our modern world. The Salesforce Platform’s underlying layers help your business applications quickly adapt to new challenges so you can continue to focus on your business rather than infrastructure.
### Hyperforce
_Infrastructure_ (for example, foundational services and computing resources) is hidden, underlying technology that supports upper layers in the Salesforce Platform. _Hyperforce_ is the Salesforce Platform infrastructure, built on 100% renewable energy and net-zero, that solves key customer challenges including compliance, trust, and scalability
### Compliance
Enterprises that operate in multiple geographical locations need to comply with new, evolving, and varying regulations for data management. Because Salesforce is deploying Hyperforce in an expanding number of countries, currently based on AWS region availability, platform applications and users can run their sensitive workloads in ways that meet strict data storage or data protection standards. For example, with _Salesforce’s European Union (EU) Operating Zone_ powered by Hyperforce, EU businesses can easily keep their data in the EU.
### Trust
Security, reliability, and availability are non-functional requirements that every business application must consider to deliver on the promise of trust to their end users. With Hyperforce, the Salesforce Platform lets enterprises deliver trusted business applications easily.
- _Security_ — Hyperforce has native end-to-end encryption of customer data at-rest and in-transit. Hyperforce’s Zero Trust Architecture enforces a strict identity verification process that ensures there is no implicit access to resources. And Hyperforce uses the _principle of least privilege_, ensuring operations are approved for just the right amount of time with the right amount of access.
- _Reliability_ — Every instance of Hyperforce uses multiple cloud availability zones and modernized approaches that speed incidence response to deliver a highly available and resilient platform.
- _Availability_ — Hyperforce’s modern CI/CD pipelines and blue/green application releases minimize application maintenance periods to just one minute a year.
## Summary
As the foundation for apps like Sales Cloud and Service Cloud, Salesforce is a proven application development platform on which individual enterprises and service providers have built millions of business applications for varying use cases, including supply chain management, billing, accounting, commerce, compliance tracking, human resource management, and claims processing. The platform’s unique, multitenant, metadata-driven architecture is engineered specifically for the cloud, and reliably and securely supports mission-critical, internet-scale applications. Using standards-based APIs and native development tools, platform developers can easily build all components of a modern web or mobile application, including the application’s data model (including objects and relationships), business logic (including workflows and validations), integrations with other applications, and more.
Since its inception, the platform has been optimized by Salesforce’s engineers for multitenancy, with features that let platform applications scale to meet changing business demands. Integral system features — such as the bulk data-processing API, Apex, a full-text search engine, and a unique query optimizer — help make dependent applications highly efficient and scalable with little or no effort from developers.
Salesforce’s managed approach for the deployment of production applications ensures excellent performance, scalability, and reliability for all applications that rely on the platform. Salesforce continually monitors and gathers operational information from platform applications to help drive incremental improvements and new system features that immediately benefit existing and new applications.
## About the Authors
Steve Bobrowski is a successful entrepreneur and technology leader who has worked for many leading enterprise software companies, including various roles across Salesforce since 2008. Today, Steve works in Salesforce’s Office of the CTO to help with the company’s technology architecture strategies.
Tom Leddy is an Architect Evangelist at Salesforce. He supports the global Salesforce Architect Community by helping to create resources, tools & guidance that help enable architects to do their best work. Connect with Tom on [Twitter](https://twitter.com/tomruns_262).
# Introduction
The Salesforce sharing model is an essential element in your organization’s ability to provide secure application data access. Therefore, it’s crucial to architect your sharing model correctly to meet your current and future data access requirements. In this document, we’ll review data accessibility components, sharing model use cases, and real customer sharing solutions, and we’ll provide some troubleshooting guidelines.
## Intended Audience and Prerequisites
This document is intended for advanced system administrators and architects. To understand the concepts, you must have a working knowledge of the Salesforce security and sharing model. Prerequisites to this guide are:
- [Salesforce Help: Sharing Settings](https://help.salesforce.com/s/articleView?id=sf.managing_the_sharing_model.htm)
- [Trailhead Module: Data Security](https://trailhead.salesforce.com/en/content/learn/modules/data_security)
- [Designing Record Access for Enterprise Scale](https://developer.salesforce.com/docs/atlas.en-us.draes.meta/draes/draes_preface.htm)
- [Salesforce Well-Architected - Trust](/docs/architect/well-architected/guide/trust.html)
### Data Access Not Covered
This guide focuses on the main features used to control record-level access to standard and custom objects. Topics not covered in this guide include:
- Folder access
- Content access
- Chatter access
- Knowledge Base access
- Ideas, Questions/Answers access
- Mobile data accessibility
## Types of Data Access
Record-level security lets you give users access to some object records, but not others. As with most applications, data access begins with a user. The application must know who the user is before it provides access. For Salesforce, there are different types of users and, sometimes, the level of access is different by type. Instead of reviewing every attribute of every license type, we’ll focus here on the interesting attributes that have significant impact on data access. Record ownership and full access are synonymous and interchangeable and provide the user with the highest level of access to a record.
### Users and Licenses
**_High-Volume Users_**
High-volume users (including users with the Customer Community, High Volume Customer Portal, and Authenticated Website license types) don't utilize the sharing model, because their license types don't support roles. These licenses have their own sharing model that works by foreign key match between the user (holding the license) and the data on Account and Contact lookups. Admins can create sharing sets or share groups to grant high-volume users access to records.
**_Chatter Free and Chatter External Licenses_**
The Chatter Free and Chatter External licenses don't follow the standard sharing model. These licenses don't have access to CRM records (standard or custom objects) and Content functionality, and don't support roles, therefore, there is no sharing.
For the remainder of this document, we are assuming a Salesforce user type utilizing a full sharing model. See [User Licenses](https://help.salesforce.com/apex/HTViewHelpDoc?id=users_understanding_license_types.htm) for more information about each available license type.
### Components

**_Profiles and Permission Sets_**
Profiles and permission sets provide object-level security by determining what types of data users see and whether they can edit, create, or delete records. For each object, the “View All” and “Modify All” permissions ignore sharing rules and settings, allowing administrators to quickly grant access to records associated with a given object across the organization. These permissions are often preferable alternatives to the “View All Data” and “Modify All Data” administrative permissions, which allow users to view or modify all apps and data.
Profiles and permission sets also control field-level security, which determines the fields within every object that users can access. For example, an object can have 20 fields, but field-level security can be set up to prevent the users from seeing five of the 20 fields.
We strongly recommend that you use permission sets and permission set groups instead of profiles to manage your users’ object permissions. Because you can reuse smaller permission set building blocks, you can avoid creating dozens or even hundreds of profiles for each user and job function.
**_Record Ownership and Queues_**
Every record must be owned by a single user or a queue. The owner has access to the record, based on the Object Settings for the owner’s profile. For example, if the owner’s profile has Create and Read permission on an object, but not Edit or Delete permission, the owner can create a record for the object and see the new record. However, the owner won't be able to edit or delete the record. Users higher in a hierarchy (role or territory) inherit the same data access as their subordinates for standard objects. If the subordinate has read-only access, so will the users above them in the role hierarchy. This access applies to records owned by users, as well as records shared with them.
Queues help you prioritize, distribute, and assign records to teams who share workloads. Queue members and users higher in the role hierarchy can access queues from list views and take ownership of records in a queue.
If a single user owns more than 10,000 records, as a best practice:
- The user record of the owner should not hold a role in the role hierarchy.
- If the owner's user record must hold a role, put the role at the top of the hierarchy in its own branch of the role hierarchy.
See [See Salesforce Well-Architected - Reliability](/docs/architect/well-architected/guide/reliability.html) for more information.
**_Organization-Wide Defaults_**
Organization-wide sharing settings specify the default level of access that users have to each others’ records. You use organization-wide sharing settings to lock your data to the most restrictive level. Use the other record-level security and sharing tools to selectively give access to other users. For example, users have object-level permissions to read and edit opportunities, and the organization-wide sharing setting is Read-Only. By default, those users can read all opportunity records, but can’t edit any unless they own the record or are granted other permissions.
Organization-wide default settings can be changed from one setting to another (Private to Controlled by Parent, then back to Private). However, these changes require sharing recalculation and depending on volume could result in long processing times.
For custom objects only, you can configure the Grant Access Using Hierarchies setting. If unchecked (default is checked), users higher in the role hierarchy are prevented from inheriting access. This setting is found in the organization-wide default settings.
**_Role Hierarchy_**
A role hierarchy represents a level of data access that a user or group of users needs. The role hierarchy ensures that managers always have access to the same data as their employees, regardless of the organization-wide default settings. Role hierarchies don't have to match your organization chart exactly. Instead, each role in the hierarchy should represent a level of data access that a user or group of users needs.
In Salesforce orgs created in Spring ’21 or later, you can create up to 5,000 roles. In orgs created before Spring ’21, you can create up to 500 roles and can contact Salesforce Customer Support to increase this limit. As a best practice, keep the number of internal roles to 25,000 and the number of external roles to 100,000.
As a best practice, keep the role hierarchy to no more than 10 levels of branches in the hierarchy.
When a user's role changes, any relevant sharing rules are evaluated to correct access as necessary. Peers within the same role don't guarantee them access to each other's data.
Modeling the role hierarchy begins with understanding how the organization is structured. This is usually built from understanding a manager’s scope, starting from the top. The CEO oversees the entire company. The CEO usually has direct reports that can then be segmented by Business Unit (Sales or Support) or geographical region (EMEA, APAC). That person then has direct reports that could be further segmented, and so on. Although this sounds very much like an HR organizational chart, when modeling data access, focus on data accessibility with a consideration to HR reporting.
Overlays are always the tricky part of the hierarchy. If they're in their own branch, they'll require either sharing rules, teams, or territory management to gain needed access. If they are folded into the hierarchy, there might be reporting implications.
It's important to spend the time setting up the role hierarchy because it's one of the foundational aspects of the sharing model.
| Role Hierarchy Use Cases |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Management access – the ability for managers to be able to see and do whatever their subordinates can see and do. |
| Management reporting – the ability for reporting to roll up in a hierarchical fashion so that anyone higher in the hierarchy sees more data than those below them. |
| Segregation between organizational branches – different business units don’t need to see each other’s data; having a hierarchy in which you can define separate branches allows you to segregate visibility within business units, while still rolling visibility up to the executive levels above those units. |
| Segregation within a role – in many organizations/applications, people who all play the same role should not necessarily see each other’s data. Having hierarchical roles allows you to define a “leaf” node in which all data is essentially private, and still roll that data up to a parent role that can see all. |
**_Public Groups_**
A public group is a collection of individual users, roles, territories, and so on, that all have a function in common. Public groups can consist of:
- Users
- Customer Portal Users
- Partner Users
- Roles
- Roles and Internal Subordinates
- Roles, Internal, and Portal Subordinates
- Portal Roles
- Portal Roles and Subordinates
- Territories
- Territories and Subordinates
- Other public groups (nesting)
Groups can be nested (Group A nested into Group B), but don't nest more than five levels. Nesting has an impact on group maintenance and performance due to group membership calculation. As a best practice, keep the total number of public groups for an organization to 100,000.
| Public Group Use Cases |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| When you need to provide access to an arbitrary group of people, you create a public group to collect them, and then use other sharing tools to give the group the necessary access. Group membership alone doesn't provide data access. |
| Groups can also be nested inside each other, therefore, allowing a nested group to gain the same access as the group in which it is contained. This allows the creation of smaller, ad-hoc hierarchies that don’t necessarily interact with the role or territory hierarchies. If Group A is a member of Group B, then the members of Group A will have access to data shared to Group B at the same access level as the members of Group B. |
| Groups also have the ability to protect data shared in the group from being made accessible to people in the role hierarchy above the group members. This (and dealing with the access of record owners and their management hierarchy) allows the creation of groups in which very highly confidential information can be shared—the data will be accessible ONLY to group members, and nobody else in the organization. This is accomplished by using the Grant Access Using Hierarchies setting. |
**_Owner-Based Sharing Rules_**
Owner-based sharing rules allow for exceptions to organization-wide default settings and the role hierarchy that give additional users access to records they don’t own. Owner-based sharing rules are based on the record owner only.
Contact owner-based sharing rules don't apply to private contacts, or contacts that aren’t associated with an account.
The limit of total sharing rules per object is 300.
| Owner-Based Sharing Rule Use Cases |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Role-based matrix management or overlay situations: a person in Service must be able to see some Sales data, but they live in different branches of the hierarchy, so you can create a rule that shares data between roles on different branches. |
| To provide data access to peers who hold the same role or territory. |
| To provide data access to other groupings of users (public groups, portal. roles, territories). The members of the groupings who own the records can be shared with the members of other groupings. |
**_Criteria-Based Sharing Rules_**
Criteria-based sharing rules provide access to records based on the record’s field values (criteria). If the criteria are met (one or many field values), then a share record is created for the rule. Record ownership is not a consideration.
The limit of criteria-based and guest user sharing rules per object is 50.
| Criteria-Based Sharing Rule Use Case |
| -------------------------------------------------------------------------------------- |
| To provide data access to users or groups based on the value of a field on the record. |
**_Guest User Sharing Rules_**
A guest user sharing rule is a special type of criteria-based sharing rule used to grant record access to unauthenticated guest users. The limit of criteria-based and guest user sharing rules per object is 50.
> **Warning:** The guest user sharing rule type grants access to guest users without login credentials. By creating a guest user sharing rule, you're allowing immediate and unlimited access to all records matching the sharing rule's criteria to anyone. To secure your Salesforce data and give your guest users access to what they need, consider all the use cases and implications of creating this type of sharing rule. Implement security controls that you think are appropriate for the sensitivity of your data. Salesforce is not responsible for any exposure of your data to unauthenticated users based on this change from default settings.
| Guest User Sharing Rule Use Case |
| ------------------------------------------------------ |
| To provide data access to unauthenticated guest users. |
**_Manual Sharing_**
Sometimes it’s impossible to define a consistent group of users who need access to a particular set of records. Record owners or other users with adequate privileges, such as system admins, can use manual sharing to give read and edit permissions to users who don’t have access any other way. Manual sharing isn’t automated like organization-wide sharing settings, role hierarchies, or sharing rules. But it gives record owners the flexibility to share records with users that must see them.
Manual sharing is removed when the record owner changes or when the sharing access granted doesn't grant additional access beyond the object's organization-wide sharing default access level. This also applies to manual shares created programmatically.
Manual share records are defined as share records with the row cause set to manual share.
All share records (standard and custom objects) with a row cause set to _manual share_ can be edited and deleted by the **_Share_** button on the object's page layout, even if the share record was created programmatically.
| Manual Sharing Use Case |
| ------------------------------------------------------------------------------------------------------------------------------------- |
| To provide the user with the ability to give access (read only or read/write) to the current record to other users, groups, or roles. |
**_Teams_**
A team is a group of users that work together on an account, sales opportunity, or case. Record owners can build a team for each record that they own. The record owner adds team members and specifies the access level each team member has to the record. Some team members can have read-only access, while others have read/write.
Only owners, people higher in the hierarchy, and administrators can add team members and provide more access to the member. A team member with read/write access can add another member who already has access to the record with which the team is associated. The team member can't provide them additional access.
Creating a team member in the app creates two records: a team record and an associated share record. If you create team members programmatically, you have to manage both the team record and associated share record. There is only one team per record (Account, Opportunity, or Case). If multiple teams are needed, depending on your specific needs, consider territory management or programmatic sharing
| Team Use Cases |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| To provide the user with the ability to give access (read-only or read/write) to a single group of users (the team). |
| If teams are managed externally, say through an external commission or territory management system, then integration can be used to manage the account team. There are cases when territory management in an external system can align to a team solution within Salesforce. |
| Multiple owners of an account can be managed by the account team. |
| A single group of users (team) require either read-only or read/write access to an opportunity record. (Opportunity Team) |
**_Territory Hierarchy_**
When using Enterprise Territory Management, you set up a territory hierarchy that shows a model’s territory structure and serves as its main interaction point. If Enterprise Territory Management is enabled, you must manage both the role hierarchy and territory hierarchy. For more information, see [Enterprise Territory Management](https://help.salesforce.com/articleView?id=sf.tm2_intro.htm) in Salesforce Help.
**_Apex Managed Sharing_**
Apex managed sharing (also known as programmatic sharing) allows you to use code to build sophisticated and dynamic sharing settings when a data access requirement can't be met by any other means.
If you create a share record programmatically, and the out-of-box row cause (_manual share_) is used, then you can maintain this share record with the **_Share_** button in the app. The share record is subject to all rules with the manual share row cause such as deletion upon owner transfer.
You can also create your own Apex sharing reasons for custom objects to track why a record with a user or group of users and simplify the coding required to make updates and deletions of sharing records.
For more information, review [Sharing a Record Using Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm) before you consider using programmatic sharing.
| Apex Managed Sharing Use Cases |
| ------------------------------------------------------------------------------------------------------------------------------------------------- |
| No other method of sharing (declarative) meets the data access needs. |
| There is an existing, external system of truth for user access assignments which will continue to drive access and be integrated with Salesforce. |
| Poor performance by using native sharing components. (Usually applies to very large data volumes) |
| Team functionality on custom objects. |
**_Restriction Rules_**
In your data access configuration, you may want to prevent users from seeing records that can contain sensitive data or simply aren’t essential to their work. You can use restriction rules to allow users to access only records meeting the criteria that you specify. When a restriction rule is applied to a user, the records that the user is granted access to via org-wide defaults, sharing rules, and other sharing mechanisms are filtered by criteria that you specify. Restriction rules work in the opposite manner as the sharing components discussed in this topic; instead of opening up access to users, they further restrict it.
Restriction rules are available for custom objects, external objects, contracts, events, tasks, time sheets, and time sheet entries. You can create up to two active restriction rules per object in Enterprise and Developer editions and up to five active restriction rules per object in Performance and Unlimited editions. Restriction rules are applied to the following Salesforce features:
- List views
- Lookups
- Related lists
- Reports
- Search
- SOQL
- SOSL
| Restriction Rule Use Cases |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| You want certain users to see only a specific set of records. |
| To simplify controlling access to records with sensitive or confidential information. |
| To make access to contracts, tasks, and event truly private, as this can be difficult to achieve using organization-wide defaults. |
**_Implicit Sharing_**
Implicit sharing is automatic. You can neither turn it off, nor turn it on—it is native to the application. In other words, implicit sharing isn't a configurable setting; however, it's important for any architect to understand. Parent implicit sharing is providing access to parent records (account only) when a user has access to children opportunities, cases, or contacts for that account. Salesforce has a data access policy that states if a user can see a contact (or opportunity, case, or order), then the user implicitly sees the associated account. Child implicit sharing is providing access to an account’s child records to the account owner. This access is defined at the owner’s role in the role hierarchy. Child implicit sharing only applies to contact, opportunity, and case objects (children of the account). The access levels that can be provided are View, Edit, and No access for each of the children objects when the role is created. By setting to View, the account owner can implicitly see the associated object records (contact, opportunity, or case). By setting to Edit, the account owner can implicitly modify the associated object (contact, opportunity or case).
Implicit sharing doesn't apply to custom objects.
## Customer Implementation Scenarios
There isn't a sharing model that fits all Salesforce orgs. Every org has different requirements and challenges when trying to architect the best sharing model. It's crucial to use the most appropriate data access components to fit the sharing requirements of the org. The following scenarios are common challenges when trying to architect a sharing model.
### Team Assignment Managed Externally via Customer Master System
| **Requirements or Challenges** | **Solution** |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Two in a box: a sales manager of one geographic coverage area also wants access to another geographic coverage area in order to assist. | Owner-based sharing rule: An owner-based sharing rule works here because these are edge cases and not the norm. It is also acceptable if the owner-based sharing rule provides more access than is truly necessary because this is a manager – a trusted individual. |
| Country-based operations users need access to all country sales data. | Owner-based sharing rule: A very common use of a sharing rule is when a different department (other than sales) needs access to sales data. |
| At least 80% of the time, there is a “core 4” team on an account (Account Executive, Inside Sales Rep, Sales Consultant, Technical Sales Rep). The system of record for the account team assignment is external. There is always only one team to an account. | Teams: Since there is always only one team per account, even if there are many different members with different roles, the account team functionality satisfies this requirement. |
| Managers of the team must have the same access as their subordinates. | Role hierarchy: The role hierarchy solves this requirement by allowing managers to have access to the data of their subordinates. |
| The assigned account team must not be modifiable. | Teams: This requirement is not actually accomplished with the account team functionality. However, it also shouldn’t prevent you from still using account teams. There are multiple ways of locking down the teams, however. For this case, removing the account team page layout is used. |
| There must be “buddy” functionality so that when someone is sick or on vacation, someone without standard access to an account or opportunity can be accessed and covered during the time off. | Teams: A “buddy” can simply be a role on the team that accomplishes this requirement. However, the challenge comes from the previous requirement where Teams must not be modifiable. The only solution is to have a set group of people who can modify teams to create the buddy role when necessary. |
| When a deal requires a custom solution, additional people (who are not necessarily in the sales organization) must have access to the deal. | Teams: A pretty standard usage of the Opportunity Team accomplished by manually adding a new member to the Opportunity Team (via related list). Can also be accomplished via a trigger if you always know who should be added. In this case, it is opportunity by opportunity. |
### Out-of-Box Territory Management
| **Requirements or Challenges** | **Solution** |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Two different opportunity teams from two distinct business units (Retails Sales and Remarketing) need access to the same account record. They must share contacts and be aware of all activities on the account. These two business units have their own hierarchy and rollups. | Territory management: The best way to think of this requirement is having two branches of a hierarchy that may be structured differently. What justifies territory management is that there are two levels of these two different branches (both levels with members = the opportunity team for that business unit) who need access to the account. Although you could have accomplished this requirement with a Teaming concept, that was too granular. The sales segmentation was not at an account level but in a hierarchy. |
| There is a separate group of business developers who are assigned and need access to specific accounts for a specific opportunity team (a territory). The business developers are shared resources for the opportunity teams, which mean each business developer may be assigned to one or more accounts for one or more opportunity teams. | Territory management: Because this is a group of users (or a team), and each business development team could be different by account, and since territory management was needed for another reason, then the likely best approach is to build out sub-territories or separate branches that represent these business development teams. |
| There are non-commission based sales supporting roles who need access to accounts on a one-off basis. | Teams: The key portion of the requirement is “one-off basis.” This means it is done on an account by account basis so account teams provide that natively. |
| The credit department needs access to all accounts for a given business unit. | Owner-based sharing rule: This is a situation where across the board, for a given business unit, a group of users must see everything. This requirement could be accomplished with a sharing rule for a role the group belongs to, a branch of the role hierarchy the group belongs to (role and subordinates), or even a public group.Territory management: You could also accomplish this requirement by modeling the credit department as a territory with the same logic for the given business unit. |
| Managers must have the same access as their subordinates. | Role hierarchy: The role hierarchy solves this requirement by allowing managers to have access to the data of their subordinates. |
## Considerations
### Enterprise Territory Management Implementation Considerations
- What Happens to the Role Hierarchy?
- Nothing happens to the role hierarchy if you’re also using a territory hierarchy. However, if you're using both territory-based forecasting and role-based forecasting together, you must manage two hierarchies. In this case, we recommend that you use the role hierarchy to model the HR reporting structure, then use the territory hierarchy to model the actual sales hierarchy. The territory hierarchy is best for modeling a matrix reporting structure, where someone can report to multiple managers.
If you're not using territory-based forecasting and role-based forecasting together, it's possible to use only the territory hierarchy as the sales hierarchy. In this scenario, it's best to simplify, or flatten, the hierarchy as much as possible.
We don't recommend making the role hierarchy and territory hierarchy identical because it causes unnecessary sharing activity.
- Can You Still Use Teams?
- Yes. However, if you can satisfy your access requirements within the territory hierarchy (like overlays), it’s better to do it there than to use teams. You’re already maintaining multiple hierarchies (role and territory), so in trying to keep things as simple as possible, only implement teams if no other existing sharing component will satisfy the requirement.
### Other Considerations
- Realignment and Reassignment
- There are two types of changes that occur – the membership of roles, teams, or territories, and the structure of the hierarchy. Membership changes can typically occur daily, even hourly. Hierarchy structural (realignments) changes generally occur less often (quarterly, semi-annually, or annually) and can be resource expensive. What must be considered are the volume of changes and the number of cascading changes that each change will cause. As a rule of thumb, have structural changes occur no more than quarterly and all changes of high volume (bulk or mass changes) be well planned, tested, and coordinated.
- Large Data Volumes
- Whether you’re modeling for the initial rollout or planning a realignment change, you must make some serious consideration to the volume of data. There are thresholds where performance can become a factor, so testing out your changes in a sandbox is highly recommended before production. This testing will also give you a baseline for how long the change will take.
If you have more than two million accounts, and have implemented teams or Enterprise Territory Management, you especially must pay attention to performance. These are complex sharing model components that can make for a huge volume of share records and hence, long running transactions.
- Defer Sharing Calculations
- If you have an object that utilizes sharing and has a large volume of records (such as more than two million accounts), and you must make a bulk change (such as a quarterly realignment requiring a hierarchy change), then there’s a feature that Salesforce Customer Support can enable to defer automatic sharing calculations. Natively, every individual change to the role hierarchy, territory hierarchy, groups, sharing rules, user roles, team membership, or ownership of records can initiate automatic sharing calculations. When a bulk change is made, it causes a number of automatic sharing recalculations to begin. By suspending these recalculations temporarily, you are able to make the change and then have sharing calculations happen all at once. This method is typically more efficient and better performing for bulk changes.
- Data and Ownership Skews
- Data skews are defined as a few parent records with many children records. These skews can really hurt you when a few accounts have many contacts, opportunities, or cases. The ratio where we start seeing performance degradation is 1:10,000. As a best practice, keep the ratio as close to that as possible (lower is preferred).
Ownership skews are similar to data skews, except we’re referring to a single user, role, or group owning many records for an object. As with data skews, these can also cause long running transactions, causing a performance degradation when change occurs. The recommended ratio of owner to number of records is also 1:10,000.
If a single user owns more than 10,000 records, as a best practice:
- The user record of the owner should not hold a role in the role hierarchy.
- If the owner's user record must hold a role, put the role at the top of the hierarchy in its own branch of the role hierarchy.
- Account Hierarchies' Impact on Data Access
- A lot of people make a bad assumption when they implement an account hierarchy. They assume the users who can access a parent account can also access the children accounts. The simple fact of only having a parent/child relationship between two records doesn’t drive access. Although the role hierarchy and the territory hierarchy do work in this way, the account hierarchy doesn’t.
## Troubleshooting
Once you have completed your sharing model architecture, you will likely be challenged with why a user can or can't see a record. Typically, you won’t hear when users can see something they shouldn’t, but if necessary, there is a way to see every user who has access to a record and why.
The more difficult challenge, and probably more common, is why a user can't see a record. The security layers that you have architected determine where you start. If you know the sharing model well, then you will probably know what component should have provided the access and can start there. But if you are less familiar with the sharing model, start with the role hierarchy and peel back each layer to determine which one should provide the access. Here is a troubleshooting flow.
1. Verify that the user has permissions to access the object.
2. Identify the user's role who can't see the record and note it.
3. Identify the owner of the record's role and note it.
4. Review the role hierarchy and verify that these two roles are in two different branches (they should be).
5. Now you must review the sharing rules for the object and make sure that there is no rule that grants the user access. If needed, look in public groups as well. Maybe the user was left out of a group where there is a sharing rule, or it makes sense to create a new sharing rule to grant the user access? This choice depends on the architecture you are trying to maintain, and applies to both owner-based sharing rules and criteria-based sharing rules.
6. If you're using teams, should this user be on the team for that record? How are teams maintained and how did the miss occur?
7. If manual sharing is used, the user may have lost access because the record owner changed. Manual shares are dropped when ownership changes. The manual share could also have been removed using the **Share** button.
8. If you're using Enterprise Territory Management, is the user missing from one of the territories? Where is the membership of territories maintained and how did the miss occur? Or, maybe the record didn't get assigned to the territory where the user is a member.
9. If you're creating programmatic shares and there are criteria for creating the share in code, review the code to understand why this user was omitted.
## Overview
Enterprise data architectures rarely live in one system. Salesforce manages customer engagement, pipeline, and service interactions. Analytical platforms like Snowflake house historical transactions, financial records, usage data, and operational metrics. Traditionally, bridging these two worlds meant building and maintaining ETL pipelines\: scheduled jobs that extract data from the source, transform it, and load copies into Salesforce. As a result of these pipelines, the data arrives delayed, governance policies multiply across systems, and pipelines demand ongoing operational care.
Salesforce Data Virtualization offers a different model. Instead of moving data into Salesforce, it enables Salesforce to query data directly at its source, at runtime, with no replication. Users see live external data through standard Salesforce interfaces. The data never leaves its authoritative home. This document explains how the pattern works, when to use it, and how to get started, using Snowflake as a concrete worked example.
## What is Data Virtualization?
Salesforce Data Virtualization is an integration architecture pattern that enables Salesforce to query data directly from external systems at runtime, without copying or replicating that data into Salesforce storage. Instead of moving data in, the platform sends the query out.
As a result, Salesforce users interact with external data through familiar Salesforce interfaces (like page layouts, related lists, reports, or flows) while the data remains in its authoritative source system. Governance, access control, and data residency stay where they belong.
This pattern is built on a single architectural principle\: data remains at the source. Computation moves to the data.
## Why It Matters
Most enterprise Salesforce deployments integrate with external data platforms (like data warehouses, operational databases, or analytical stores) through replication pipelines. Pipelines extract, transform, and load data into Salesforce on a schedule. This approach works, but replication introduces structural trade-offs\:
* Replicated data is always delayed. Pipelines introduce lag and stale data drives poor decisions.
* Every copy of data expands compliance scope. Sensitive data (like personally identifiable information, financial records, or health data) in multiple systems requires maintaining multiple governance policies.
* Pipelines require ongoing operational investment, monitoring, failure handling, schema drift management, and reprocessing logic.
Data Virtualization addresses these trade-offs directly. It removes the pipeline entirely for read-heavy use cases, keeps data in its authoritative location, and gives Salesforce users a real-time, governed view of external data without the replication overhead.
## Products in Scope
Salesforce Connect is the platform capability that enables Data Virtualization within Salesforce. It provides the adapter framework that translates SOQL queries into the query language of an external system, manages authenticated callouts, and maps result sets back to Salesforce field types. It powers External Objects, the Salesforce metadata construct that surfaces external data as queryable, platform-native entities without replicating data into Salesforce storage. External Objects behave like standard Salesforce objects — visible in page layouts, related lists, and reports, and accessible via SOQL and standard APIs — but hold no data. External Objects are a schema projection over the source system.
## Core Concepts
### External Objects
External Objects are the primary mechanism through which Data Virtualization surfaces external data inside Salesforce. They behave like standard Salesforce objects\: queryable via SOQL, visible in page layouts and related lists, and accessible through standard Salesforce APIs. The key difference is that no data is stored in Salesforce. The External Object is a schema projection\: a definition of what the external data looks like, not a copy of the data itself.
When a user loads a page or runs a report that references an External Object, Salesforce executes a live query against the external system and returns only the result set for that interaction.
### Query Pushdown
When Salesforce executes a SOQL query against an External Object, it translates filters (WHERE clauses), sort orders (ORDER BY), and limits (LIMIT) into the equivalent SQL and sends them to the external system. The external system executes the query on its own compute engine and returns only the filtered result set. Work happens where the data lives, and only the answer travels back to Salesforce.
### Dual Governance
Data Virtualization enforces two independent security layers simultaneously. The external system applies its own access controls at query execution time, including row-level security, column masking, and role-based access. Salesforce applies its own security model on top\: profiles, permission sets, field-level security, and sharing rules. Both layers are active on every query. Neither replaces the other.
## The Zero-Copy Distinction
Architects frequently describe Data Virtualization as a "zero-copy" pattern. Zero-copy means no persistent replication into Salesforce storage. There is no ETL pipeline writing records into Salesforce objects. There is no scheduled sync creating a local copy. The External Object holds no rows.
Zero-copy does not mean zero data transmission. Every time a user queries an External Object, a result set travels from the external system to Salesforce over the network. For large result sets or high query frequency, data egress costs and network latency are real factors for architects to design for. This is not a limitation to hide\: it is a design constraint to account for.
Consider these architectural differences if your use case requires high volumes, frequent access, or low latency.
## Data Virtualization with Snowflake\: A Worked Example
Snowflake is one of the most common external systems connected to Salesforce via Data Virtualization. It serves as a concrete example of how the pattern works from end to end.
In this configuration, Salesforce connects to Snowflake using Salesforce Connect with the SQL Adapter for Snowflake. Snowflake tables and views are surfaced as External Objects in Salesforce. When a user queries an External Object, Salesforce translates the SOQL into SQL and submits it to the Snowflake Statements API via an authenticated HTTPS callout. Snowflake executes the query on its virtual warehouse, applies its own row-level security and column masking, and returns only the result set. No data is written to Salesforce storage at any point.

### Authentication Model
Salesforce Connect uses a delegated OAuth 2.0 model to authenticate with Snowflake. The key components are\:
* **Auth Provider\:** Manages the OAuth handshake with Snowflake. Handles token requests and maps the returned token to the Salesforce credential.
* **External Credential\:** Holds the OAuth access and refresh tokens securely in the Salesforce encrypted credential store and injects them into outbound callouts.
* **Named Credential\:** Defines the Snowflake endpoint URL and references the External Credential.
* **Snowflake Security Integration\:** Registers Salesforce as a trusted OAuth client in Snowflake. Defines the allowed redirect URI, OAuth flows, and token TTL.
These components form a dependency chain\: External Data Source references the Named Credential, which references the External Credential, which references the Auth Provider. Understanding this chain is essential when troubleshooting connectivity or access failures.
### Identity Model\: Named Principal vs. Per-User Principal
Salesforce supports two identity delegation models when authenticating with Snowflake\:
* **Named Principal\:** One shared service account authenticates all Salesforce users against Snowflake. This is simpler to configure, but doesn't have per-user auditability or fine-grained Snowflake access control.
* **Per-User Principal\:** Each Salesforce user authenticates with their own OAuth token. This enables Snowflake row-level security and full per-user audit trails, with a trade-off of higher token management overhead (per-user OAuth flows, refresh, revocation).
**Decision guidance\:** Use Per-User Principal for regulated data or Personally Identifiable Information (PII). Use Named Principal when Salesforce sharing rules provide sufficient access control and simplicity is the priority.
### Key Platform Constraints
These Salesforce governor limits directly shape solution design when using External Objects with Snowflake\:
* **Callout limit\:** 100 per Apex transaction. Pages or flows with multiple External Object queries can reach this limit quickly.
* **Callout timeout\:** 120 seconds maximum. Long-running Snowflake queries cause a runtime exception.
* **SOQL row limit\:** 50,000 rows. Paginate large result sets.
* **Async constraints\:** Batch Apex and most async contexts restrict callouts. Keep External Object access within synchronous transaction boundaries. For asynchronous use cases that query External Objects, consider Continuation callouts for user-initiated async interactions, or architect the flow to perform external data access in a synchronous transaction and hand off results asynchronously.
**Design guidance\:** Don't query External Objects inside loops. Push WHERE clause filters to Snowflake to reduce result size and callout frequency.
### Observability
Every query that Salesforce sends to Snowflake is logged in Snowflake Query History with full execution metadata\: latency, rows scanned, warehouse used, and the executing identity. This history provides end-to-end auditability from Salesforce user action to Snowflake execution and is the primary diagnostic tool for performance tuning and access validation.
## When to Use Data Virtualization
Data Virtualization is well-suited to use cases where real-time access, governance, and reduced replication overhead outweigh the constraints of a federated, query-time access model.
**Use it when\:**
* **Read-heavy analytical access is the primary requirement.** If users need to query and display external data in Salesforce UIs, reports, or flows without writing back, Data Virtualization eliminates pipeline overhead for read-only scenarios.
* **Data freshness is critical.** Where stale replicated data creates business risk (such as out-of-date financial balances, inventory levels, or compliance status), the federated model guarantees that every query reflects live data.
* **Governance and data residency requirements are strict.** When regulatory or contractual constraints prohibit copying sensitive data into Salesforce, virtualization keeps data in its authoritative location while making it accessible within Salesforce. Only one system holds the data.
* **Dual-layer access control is required.** When both the external system's native access controls and the Salesforce security model apply simultaneously, the federated model enforces both without data duplication.
* **The external system is already the authoritative system of record.** If the data is already clean, governed, and queryable in the source system, virtualizing it avoids redundant transformation, storage cost, and divergence risk.
**Avoid it when\:**
* **Low-latency writes are required.** External Objects are read-only. Write-back use cases require a different integration pattern.
* **Complex multi-object joins are needed.** SOQL across multiple External Objects doesn't support joins. Pre-materialize joined data as a single view in the source system.
* **Salesforce AI or Agentforce features require native data.** Currently, Einstein and Agentforce features (including grounding for Einstein Copilot, predictive scoring, and Agentforce actions) operate on native Salesforce objects. These features don't support External Objects as a grounding or activation data source. If AI activation is in scope for this data, **Salesforce Data 360 is the recommended complementary solution.**
* **High-frequency, high-volume access patterns.** External Objects are designed for on-demand access. Workloads that fire hundreds of queries per minute exhaust governor limits and degrade performance.
## Use Cases\: The Pattern in Practice
The following use cases illustrate how Salesforce Data Virtualization applies across common enterprise scenarios. Each example uses Snowflake as the external system, but the underlying pattern applies to any SQL-compatible data source supported by Salesforce Connect.
### Use Case 1\: Customer Support Metrics from an External Data Warehouse
**Challenge\:** Support teams needed unified reports combining Salesforce Case data with ticket volume, resolution time, and escalation metrics stored in Snowflake. Building and maintaining a replication pipeline for this data introduced lag and added operational overhead for a read-only reporting use case.
**Solution\:** The team exposed Snowflake views containing ticket metrics as External Objects in Salesforce. The team configured Salesforce Reports to join native Case objects with the external ticket data.
**Result\:**
* Reports always reflect live Snowflake data. No pipeline lag.
* Governance of sensitive support metrics remains in Snowflake.
* No ETL pipeline to build, monitor, or maintain.
### Use Case 2\: Real-Time Credit Status for Sales Reps
**Challenge\:** A finance team maintained authoritative credit limit and balance data in Snowflake. Replicating these values into Salesforce via reverse ETL introduced replication lag, causing sales reps to commit to deals based on stale credit information. The compliance team also flagged the risk of holding sensitive financial data in Salesforce storage.
**Solution\:** The team virtualized the Snowflake finance view as an External Object and surfaced it on the Account page layout. Sales reps now see live credit status as part of their standard Account view in Salesforce.
**Result\:**
* Real-time credit data on every Account page. No lag.
* Reverse ETL pipeline eliminated for financial data.
* Sensitive financial data never copied into Salesforce storage. Compliance scope stays in Snowflake.
### Use Case 3\: Cross-Org Operational Reporting During M\&A
**Challenge\:** During a merger, the acquiring company needed to give Salesforce users visibility into operational data from 6 high-volume Snowflake datasets covering transactions, billing, and usage. Replicating terabytes of data into Salesforce was not viable on the merger timeline, and building custom ETL pipelines for each dataset would have required significant engineering investment.
**Solution\:** The team configured External Objects for all 6 Snowflake datasets using Salesforce Connect with a least-privilege integration role. No custom code required. Queries execute directly in Snowflake, and all activity is logged in Snowflake Query History for compliance reporting.
**Result\:**
* Fully declarative configuration. No custom code or pipelines required.
* Data freshness guaranteed. Every query reflects live Snowflake data at execution time.
* Full audit trail in Snowflake Query History for regulatory and compliance reporting.
## Design Considerations and Failure Modes
Data Virtualization introduces a distinct operational profile. Design for these failure scenarios\:
* **OAuth token expiry\:** Tokens have a finite time to live (TTL). Expired tokens cause callout failures. Monitor for 401 Unauthorized responses and implement refresh logic.
* **Warehouse cold-start (Snowflake-specific)\:** Auto-suspended warehouses add 5–30 seconds on the first query. For user-facing use cases with latency requirements, pre-warm with a scheduled lightweight query during business hours.
* **Role mismatch\:** A misconfigured role in the external system can return zero rows silently rather than an error. Validate role-to-object privileges in the external system independently of Salesforce.
* **Result set overflow\:** Oversized payloads exceed API limits. Always apply LIMIT clauses and expose filtered views rather than raw tables.
* **External system outage\:** No fallback or cache exists. Wrap callouts in try/catch and surface informative error states in the UI. For mission-critical data, consider a tiered approach\: virtualize for real-time access, and maintain a lightweight replicated fallback for the most critical fields to guarantee availability during source system outages.
## Well-Architected Alignment
Salesforce Data Virtualization aligns with the following pillars of the Salesforce Well-Architected Framework.
* **Trust\:** The delegated OAuth 2.0 model and least-privilege role guidance align with Trust. Dual-layer access control (source system + Salesforce) enforces defense in depth.
* **Reliability (fault tolerance)\:** The failure modes section addresses reliability directly\: token expiry, cold-start, role misconfiguration, result set overflow, and outage handling each represent a distinct failure class with a documented resolution path.
* **Reliability (scalability)\:** Query pushdown, warehouse sizing guidance, and callout limit awareness optimize execution efficiency within Salesforce governor constraints, a reliability concern for solutions operating at scale.
* **Operational Excellence\:** Snowflake Query History as the primary observability tool supports operational excellence\: architects make a deliberate, traceable choice to use platform-native tooling for end-to-end auditability and performance diagnostics rather than building custom logging infrastructure.
## Architect's Quick Start
This section gives architects and designers a structured starting point for building the Data Virtualization pattern in a sandbox environment. It's not a complete implementation guide — treat it as a validated sequence of decisions and configuration steps to orient your first proof of concept.
### Before You Begin
Confirm the following before starting any configuration work\:
* **License entitlement\:** Salesforce Connect isn't included in all Salesforce editions. The SQL Adapter for Snowflake requires a separate add-on license beyond base Salesforce Connect entitlement. Verify both in your org before proceeding.
* **Sandbox first\:** Complete all phases in a sandbox environment before promoting your configuration to production.
* **Snowflake access\:** Confirm that you have permission to create a Security Integration in Snowflake and access to the target database, schema, and objects.
* **Adapter version\:** Confirm that the SQL Adapter for Snowflake is available in your org edition and that your Snowflake account URL doesn't contain underscores (replace with hyphens if it does. This is a Salesforce platform constraint for callout hostname resolution).
Setting up Data Virtualization with an external SQL system like Snowflake is a declarative, configuration-driven process – no custom code required. The setup follows three sequential phases\: establishing identity and trust, configuring the data surface, and exposing data to end users.
### Phase 1\: Identity and Trust Configuration
This phase establishes a secure, delegated OAuth 2.0 trust chain between Salesforce and the external system. Complete this phase before starting any data surface configuration.
1. **Create an Auth Provider in Salesforce.** Use the OpenID Connect type. Use placeholder values at this stage — return to complete it after retrieving values from the external system. After you save, Salesforce generates a Callback URL. Retain this value.
2. **Register Salesforce as an OAuth client in the external system.** In Snowflake, this means creating a Security Integration (OAuth, Confidential Client type). Provide the Salesforce Callback URL as the redirect URI. Retrieve the Client ID, Client Secret, Authorization URL, and Token URL from the integration after creation.
3. **Complete the Auth Provider configuration.** Return to the Salesforce Auth Provider and populate it with the values retrieved from the external system\: Consumer Key, Consumer Secret, Authorization URL, and Token URL.
4. **Create the External Credential.** Set Protocol to OAuth 2.0, link it to the Auth Provider, and add a Principal (Named or Per-User, based on your identity model decision). This object manages the OAuth token lifecycle.
5. **Create the Named Credential.** Set the endpoint to the external system's API URL (e.g., `https://.snowflakecomputing.com/api/v2/statements/`) and link it to the External Credential.
6. **Grant profile access to the External Credential.** Without this step, users can't invoke federated queries even if all other configuration is correct.
7. **Initiate the OAuth flow to complete authentication.** Trigger the OAuth handshake from Salesforce. The platform redirects to the external system login, validates credentials, and stores the resulting tokens securely in the External Credential. This step binds user context to a valid token. All federated queries fail until this step is complete.
### Phase 2\: Data Surface Configuration
This phase connects Salesforce to the external data schema and creates the External Object definitions that users and the platform query.
1. **Create the External Data Source.** Select the appropriate adapter (e.g., SQL Adapter for Snowflake), point it to the target database and schema, and link it to the Named Credential you created in Phase 1.
2. **Validate the connection.** Use the built-in validation on the External Data Source. A successful result confirms the OAuth trust chain is complete and the external system is reachable.
3. **Sync metadata.** Initiate a metadata sync from the External Data Source. Salesforce introspects the target schema and generates External Object definitions, mapping external columns to Salesforce field types.
4. **Select and expose the required tables or views.** Choose which external tables or views to surface as External Objects. As a best practice, expose curated views rather than raw tables. Views allow pre-filtering of columns, row-level restrictions, and tighter control over what the Salesforce layer can access.
### Phase 3\: UI and Access Configuration
This phase makes External Objects visible and usable to end users within the Salesforce Lightning experience.
1. **Create tabs for External Objects.** Tabs make External Objects directly navigable within Lightning Apps.
2. **Add External Objects to page layouts.** Surface relevant external data alongside native Salesforce records (for example, add a Snowflake finance view to the Account page layout).
3. **Add to related lists.** Include External Objects in related lists to give users a unified view of native and external data in context.
4. **Validate end-to-end query federation.** Load a page or run a query that references an External Object. Then inspect the external system's query history (for example, Snowflake Query History) to confirm that the query executed at the source. Verify that the correct role, warehouse, and identity ran the query.
After all three phases are complete, Salesforce users can interact with live external data through standard Salesforce interfaces, with no awareness that the data originates outside Salesforce.
## Conclusion
Salesforce Data Virtualization replaces replication-based integration with query-time federation. Data stays in its authoritative source; Salesforce users interact with it through standard platform interfaces. There is no pipeline to build, no copy to govern, and no lag to manage.
This pattern is the right choice when read-heavy access, real-time data freshness, strict governance, and dual-layer access control are the primary drivers. It is the wrong choice when writes are required, when AI or automation features depend on native Salesforce objects, or when access patterns are too high-frequency for governor limits to accommodate.
Snowflake illustrates the pattern well\: a governed, query-time federated connection established declaratively with no custom code, observable end-to-end through Snowflake Query History, and enforceable through both the Snowflake native access controls and the full Salesforce security model.
Before committing to this architecture, validate license entitlement, assess governor limit exposure against your expected access patterns, and confirm OAuth readiness in a sandbox environment. The pattern rewards thoughtful upfront design\: get the identity model, credential chain, and view strategy right, and the operational footprint is minimal.
## About the Author
**Yugandhar Bora** is a Software Engineering Architect at Salesforce, specializing in data architecture within the Data & Intelligence Applications platform. He leads Enterprise Architecture Review Board (EARB) initiatives focused on data governance and unified data models, while contributing to automated platform provisioning solutions.
# Overview
Modern Salesforce architectures are increasingly powered by asynchronous processing; not as a convenience, but as a strategic requirement for scale. In recent years, we've seen more and more companies contending with surging data volumes, complex integrations that involve multiple touchpoints, and the rise of autonomous systems running 24/7/365. All of these things push architects towards designing systems that are asynchronous-first.
Asynchronous processing on Salesforce often means designing around governor limits and complexity. Those limits act as guardrails and architectural constraints that help produce bulk-safe, scalable systems. While no platform limits directly serve to manage complexity, [design patterns](https://refactoring.guru/design-patterns) can help mitigate risk on that front. Internally, Salesforce often pushes the platform’s boundaries to forward‑test new features and automate complex business processes. We built a Step-Based Asynchronous Processing Framework for running asynchronous jobs with an arbitrary number of steps. Each step can run, retry, and restart independently with shared governance controls and full operational visibility through centralized logging. This document outlines its key architectural components: Queueable Apex and Finalizers, Scheduled Flow, Apex Cursors, Invocable Actions, and integrations with Slack. Together, these components provide a modular, scalable, and observable architecture suited for evolving enterprise needs.
## Key Takeaways
- Modern Salesforce architectures should embrace an asynchronous-first approach to achieve scale, resiliency, and operational transparency.
- Breaking complex work into independently executable steps enables predictable performance, safer retries, checkpointing, rollback, and modular evolution without re-engineering core workflows.
- The framework provides a scalable alternative to monolithic and aging batch jobs, chained async calls, and deeply nested flows, and is built for high-volume workloads that must scale horizontally inside Salesforce without off-platform orchestration.
- Deterministic and observable execution ensures progress tracking, SLA monitoring, failure diagnostics, and audit-level transparency through centralized logging and governance.
- Designed for enterprise-grade rigor, including unified governance, compliance, and distributed state control across long-running business processes.
## Platform Best Practices
Before reviewing the requirements, here are some dos and don’ts for when to use a framework like this. Above all, consider which system is the single source of truth. If your Salesforce org relies minimally on external data but needs to scale from hundreds to millions of records, consider a step‑based async framework.
**Do** use this framework if:
- Most (or all) of the information to act upon already exists in your CRM.
- The upfront or ongoing cost of maintaining an Extract Transform Load (ETL) job to harmonize external data is too high.
- You need to defer processing a large number of Salesforce records on a set schedule.
- You can break down the processing into discrete steps. For example, you can create a hierarchical or tree‑based set of records, particularly if data volume fans out down the hierarchy or tree.
**Don’t** use this framework if:
- Creating or updating records requires immediate recalculation.
- Integration is challenging because external systems host primary data for record updates. (Consider pushing updated data to Salesforce with the Bulk API.)
With those practices in mind, let's review our requirements and start building.
## Breaking Down the Requirements
Consider the problem statement:
> Given a job that needs to run daily, check if certain records meet pre-established criteria for further processing. If they do, kick off those processing jobs. Processing records might mean pulling data from multiple external systems to perform calculations. Steps in jobs should notify people via Slack that processed records are ready for review. Steps should also escalate notifications to managers and higher-ups in the role hierarchy based on a configurable delay after the first round of notifications.
This problem involves several different steps, some of which can happen independently of each other. There are many ways to split up the work. Here’s one grouping:
- The scheduler.
- The step interface and concrete implementations that process records (regardless of the type of processing).
- The processor that organizes steps.
- The Apex Invocable called by the scheduler.
- The notification piece. We use the [Apex Slack SDK](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/overview.html).
- There’s some complexity hidden in the phrase “configurable delay.” We'll review this complexity later on in this article.
Here’s an opinionated diagram for the built‑out framework:
Now, break down that diagram and start building the pieces.
## Scheduling with Scheduled Flow
Scheduled Flow offers several advantages as a scheduling mechanism:
- Scheduled Flows can be packaged and deployed as metadata. This isn't true for jobs scheduled via Apex (or via the Scheduled Jobs page).
- The Wait element is critical for frameworks that require callouts. By using it in Flow, callouts aren’t necessary in the Invocable portion of the framework.
- Scheduling granularity meets the requirements: the minimum interval for Scheduled Flows is daily. If you need a higher frequency (for example, hourly), reconsider Scheduled Flow for this requirement.
Another consideration when configuring the Scheduled Flow is environment gating. Before invoking the Apex action, add a Decision element that evaluates the `{!$Api.Enterprise_Server_URL_100}` variable. This ensures the job runs only in the intended environments, such as UAT and Production. This pattern is important because sandboxes are frequently refreshed or newly created during the SDLC, and without an explicit environment check, a Scheduled Flow could unintentionally execute in environments where the framework is not meant to run. Using the `contains` operator in the Decision element makes the setup resilient to future sandbox creations or URL changes.
Finally, consider how the framework should capture failures. Always add a fault path when Flow calls any Action; for example, you can wire faults to [Nebula Logger’s](https://www.nebulalogger.com/) "Add Log Entry" action. Nebula Logger writes logs to custom objects, so customers should be aware that log data consumes org storage — by default, logs are stored for 14 days within an org, and then cleaned up; this retention period is configurable. Nebula Logger also uses Platform Events to publish logs, so log entries are saved independently from the main data-processing transaction — this ensures failures are captured even if the primary Flow or Apex action rolls back. Customers should evaluate expected log volume and retention requirements when considering the addition of a logging framework.
Here's what the Flow looks like:
Let's move on to the first pieces of Apex code with the scheduling requirement now satisfied.
## Creating a Step Interface
Define a `Step` interface:
```java
public interface Step {
void execute();
void finalize();
String getName();
Boolean shouldRestart();
}
```
For this article, the `step` interface is shown as an outer class for clarity. The framework itself is flexible — teams can organize the interface and its implementations using any Apex packaging pattern they prefer, as long as all Step classes reference the same interface.
There are a few things to note about the methods defined within our interface:
- `execute`, though argument‑less at the moment, improves when we pass a `State` class (or interface) to orchestrate data between steps when order matters.
- `getName` could return a `System.Type` value instead of a `String`. The goal is to give the orchestration layer a way to log step names without exposing other properties.
Here’s the first concrete implementation to show how these pieces fit together. With one exception later, we recommend using Queueable Apex to implement asynchronous processing within Apex; Batch Apex is typically unnecessary (and `@future` methods are discouraged). Queueable Apex starts quickly and, with Apex Cursors, has many advantages over Batch Apex.
### An Apex Cursor-Like Implementation
[Apex Cursors](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_cursors.htm) offer a modern alternative to the traditional Batch Apex model. Similar to Batch processing, a Cursor implementation can fetch records in chunks (up to 2,000 per batch). However, Cursors allow multiple fetches within a single transaction, enabling significantly higher throughput for large-volume operations.
When adopting Cursors as part of this framework, teams should be aware of current testing and mockability limitations. Cursor behavior in tests may differ from production behavior, so it’s important to design test strategies that avoid relying on Cursor internals and instead validate orchestration logic at the boundaries. As the platform evolves, these areas will continue to improve, but the core guidance remains: Cursors provide higher performance and reduced orchestration overhead compared to Batch Apex for many use cases.
To define a clear boundary between the system-provided Cursor and your own code, we recommend creating a Cursor‑like representation when implementing the `Step` interface. Consider this code:
```java
public inherited sharing abstract class CursorStep implements Step {
private static final Integer MAX_CHUNK_SIZE = 2000;
protected Cursor cursor;
private Integer chunkSize = System.Limits.getLimitDMLRows();
private Integer position = 0;
protected abstract Cursor getCursor();
protected abstract void innerExecute(List records);
public abstract String getName();
public virtual CursorStep withChunkSize(Integer chunkSize) {
this.chunkSize = chunkSize;
return this;
}
public void execute() {
this.cursor = this.cursor ?? this.getCursor();
this.cursor.setFetchesPerTransaction(this.getFetchesPerTransaction());
List records = new List();
if (this.shouldAdvance()) {
records = this.cursor.fetch(this.position, this.chunkSize);
this.position += this.chunkSize;
}
this.innerExecute(records);
}
public virtual void finalize() {
Logger.info('finished cursor step for ' + this.getName());
}
public virtual Boolean shouldRestart() {
return this.position < this.cursor.getNumRecords();
}
protected virtual Integer getFetchesPerTransaction() {
Integer maxRecordsPerFetchCall = 2000;
if (this.chunkSize < maxRecordsPerFetchCall) {
return this.chunkSize;
}
// Integer division rounds down
// which is perfect for our use-case
return this.chunkSize / maxRecordsPerFetchCall;
}
protected virtual Boolean shouldAdvance() {
return true;
}
}
```
Notice the `Cursor` class. Apex cursors are instances of `Database.Cursor`, but our `Cursor` implementation gives us flexibility around the shortcomings of Cursors. Here’s the implementation:
```java
public virtual without sharing class Cursor {
private static final Integer MAX_FETCHES_PER_TRANSACTION = Limits.getLimitFetchCallsOnApexCursor();
@TestVisible
private static Integer maxRecordsPerFetchCall = 2000;
private Integer cursorNumRecords;
private Integer fetchesPerTransaction = MAX_FETCHES_PER_TRANSACTION;
private final Database.Cursor cursor;
public Cursor(
String finalQuery,
Map bindVars,
System.AccessLevel accessLevel
) {
try {
this.cursor = Database.getCursorWithBinds(finalQuery, bindVars, accessLevel);
} catch (FatalCursorException e) {
Logger.newEntry(
System.LoggingLevel.WARN,
'Error creating cursor. This can happen if there' +
' are no records returned by the query: ' + e.getMessage()
);
}
}
public Cursor setFetchesPerTransaction(Integer possibleFetchesPerTransaction) {
// Handle accidental round downs from Integer division
if (possibleFetchesPerTransaction == 0) {
return this;
}
if (possibleFetchesPerTransaction > MAX_FETCHES_PER_TRANSACTION) {
Logger.newEntry(
System.LoggingLevel.DEBUG,
'Fetches per transaction: ' +
possibleFetchesPerTransaction +
' exceeded platform max fetches per transaction: ' +
MAX_FETCHES_PER_TRANSACTION +
', defaulting to platform max'
);
possibleFetchesPerTransaction = MAX_FETCHES_PER_TRANSACTION;
}
this.fetchesPerTransaction = possibleFetchesPerTransaction;
return this;
}
@SuppressWarnings('PMD.EmptyStatementBlock')
protected Cursor() {
}
public virtual List fetch(Integer start, Integer advanceBy) {
if (this.getNumRecords() == 0) {
Logger.newEntry(
System.LoggingLevel.DEBUG,
'Bypassing fetch call, no records to fetch'
);
return new List();
}
Integer localStart = start;
List results = new List();
while (
Limits.getFetchCallsOnApexCursor() < this.fetchesPerTransaction &&
results.size() < this.getNumRecords() &&
localStart < start + advanceBy
) {
Integer actualAdvanceBy = this.getAdvanceBy(localStart, advanceBy);
results.addAll(this.cursor?.fetch(localStart, actualAdvanceBy) ?? new List());
localStart += actualAdvanceBy;
}
return results;
}
public virtual Integer getNumRecords() {
this.cursorNumRecords = this.cursorNumRecords ?? this.cursor?.getNumRecords() ?? 0;
return this.cursorNumRecords;
}
protected Integer getAdvanceBy(Integer start, Integer advanceBy) {
Integer possibleFetchSize = Math.min(advanceBy, this.getNumRecords() - start);
if (possibleFetchSize > maxRecordsPerFetchCall) {
Logger.newEntry(
System.LoggingLevel.DEBUG,
'Fetch size: ' +
possibleFetchSize +
' exceeded platform max fetch size of ' +
maxRecordsPerFetchCall +
', defaulting to max fetch size'
);
possibleFetchSize = maxRecordsPerFetchCall;
} else if (possibleFetchSize < 0) {
possibleFetchSize = 0;
}
return possibleFetchSize;
}
}
```
For the rest of this article, we omit the `sharing` declarations when referring to Apex classes. In practice, ensure top‑level classes explicitly use with or without sharing to conform to your object model and permissions.
Also note that our `Cursor` implementation delegates to the platform `Database.Cursor`, with added benefits discussed next.
First, here are the corresponding tests:
```java
@IsTest
private class CursorTest {
@IsTest
static void itCapsAdvanceByArgument() {
String accountName = 'helloWorld!';
insert new Account(Name = accountName);
String query = 'SELECT Name FROM Account WHERE Name = :bindVar0';
Map bindVars = new Map{ 'bindVar0' => accountName };
Cursor instance = new Cursor(query, bindVars, System.AccessLevel.SYSTEM_MODE);
Assert.areEqual(1, instance.getNumRecords());
Assert.areEqual(accountName, instance.fetch(0, 1000).get(0).get('Name'));
Assert.areEqual(1, System.Limits.getApexCursorRows());
}
@IsTest
static void itCapsMaxRecordsPerFetchCall() {
Cursor.maxRecordsPerFetchCall = 20;
Integer oneMoreThanMaxFetch = Cursor.maxRecordsPerFetchCall + 1;
List accounts = new List();
for (Integer i = 0; i < oneMoreThanMaxFetch; i++) {
accounts.add(new Account(Name = 'Fetch ' + i));
}
insert accounts;
Exception ex;
List results;
Cursor instance = new Cursor(
'SELECT Id FROM Account',
new Map(),
System.AccessLevel.SYSTEM_MODE
);
try {
results = instance.fetch(0, oneMoreThanMaxFetch);
} catch (System.InvalidParameterValueException e) {
ex = e;
}
Assert.areEqual(null, ex?.getMessage());
Assert.areEqual(2, Limits.getFetchCallsOnApexCursor());
Assert.areEqual(oneMoreThanMaxFetch, results.size());
}
@IsTest
static void itFetchesMultipleTimesPerTransactionWhenMoreThanMaxFetch() {
Cursor.maxRecordsPerFetchCall = 20;
List accounts = new List();
Set expectedFetchNames = new Set();
for (Integer i = 0; i < Cursor.maxRecordsPerFetchCall + 1; i++) {
String accountName = 'Fetch' + i;
expectedFetchNames.add(accountName);
accounts.add(new Account(Name = accountName));
}
insert accounts;
Integer oneMoreThanMaxFetch = Cursor.maxRecordsPerFetchCall + 1;
Cursor instance = new Cursor(
'SELECT Name FROM Account',
new Map(),
System.AccessLevel.SYSTEM_MODE
);
List results = instance.setFetchesPerTransaction(2).fetch(0, oneMoreThanMaxFetch);
Assert.areEqual(Cursor.maxRecordsPerFetchCall + 1, results.size());
Assert.areEqual(2, Limits.getFetchCallsOnApexCursor());
Set actuallyFetchedNames = new Set();
for (Account account : (List) results) {
actuallyFetchedNames.add(account.Name);
}
Assert.areEqual(expectedFetchNames, actuallyFetchedNames);
}
@IsTest
static void itFetchesMultipleTimesPerTransaction() {
Cursor.maxRecordsPerFetchCall = 1;
insert new List{ new Account(Name = 'One'), new Account(Name = 'Two') };
Cursor instance = new Cursor(
'SELECT Id FROM Account',
new Map(),
System.AccessLevel.SYSTEM_MODE
)
.setFetchesPerTransaction(2);
List results = instance.fetch(0, 2);
Assert.areEqual(2, instance.getNumRecords());
Assert.areEqual(2, results.size());
results = instance.fetch(2, 1);
Assert.areEqual(0, results.size());
}
@IsTest
static void fetchesCorrectAmountOfRecords() {
List accounts = new List();
for (Integer i = 0; i < 10; i++) {
accounts.add(new Account(Name = 'Fetch ' + i));
}
insert accounts;
Cursor instance = new Cursor(
'SELECT Id FROM Account',
new Map(),
System.AccessLevel.SYSTEM_MODE
)
.setFetchesPerTransaction(10);
List results = instance.fetch(0, 2);
Assert.areEqual(2, results.size(), '' + results);
Assert.areEqual(1, Limits.getFetchCallsOnApexCursor());
}
@IsTest
static void doesNotExceedPlatformMaxFetch() {
List accounts = new List();
for (Integer i = 0; i < 101; i++) {
accounts.add(new Account(Name = 'Fetch ' + i));
}
insert accounts;
Test.startTest();
Cursor instance = new Cursor(
'SELECT Id FROM Account',
new Map(),
System.AccessLevel.SYSTEM_MODE
)
.setFetchesPerTransaction(100);
Integer counter = 0;
List results;
while (counter <= 100) {
results = instance.fetch(counter, counter + 1);
counter++;
}
Test.stopTest();
Assert.areEqual(101, counter);
Assert.areEqual(0, results.size());
}
}
```
By making `Cursor` virtual, concrete `CursorStep` implementations can operate without a `Database.Cursor` when they don’t need to iterate a large record set — similar to returning a `System.Iterable` instead of a `Database.QueryLocator` in Batch Apex. Here’s an example:
```java
public abstract class CursorLikeImplementation extends CursorStep {
private final Cursor cursorLike;
public CursorLikeImplementation(List previouslyRetrievedRecords) {
this.cursorLike = new CursorLike(previouslyRetrievedRecords);
}
public override String getName() {
return CursorLikeImplementation.class.getName();
}
public override Cursor getCursor() {
return this.cursorLike;
}
private class CursorLike extends Cursor {
private final List records;
public CursorLike(List records) {
super();
this.records = records;
}
public override List fetch(Integer position, Integer chunkSize) {
// clone, to keep the underlying list type
List clonedRecords = this.records.clone();
clonedRecords.clear();
for (Integer i = position; i < this.getAdvanceBy(position, chunkSize); i++) {
clonedRecords.add(this.records[i]);
}
return clonedRecords;
}
public override Integer getNumRecords() {
return this.records.size();
}
}
}
```
Note that because this class is also abstract, it leaves the concrete implementation of `innerExecute` to subclasses.
There’s also an alternative to the `CursorLike` inner subclass. If you know concrete versions of a step like this won’t burn through other governor limits, you can return `this.records` from `CursorLike.fetch` and override the parent `CursorStep.shouldRestart()` to return false. That allows you to iterate over a list bounded only by the Apex heap limit of 12 MB per async transaction.
### Other Possible Step‑Based Implementations
Our Cursor-based implementation gives us plenty of flexibility when paginating over large quantities of data. The `Step` interface, meanwhile, gives us the flexibility to describe and encapsulate steps of all sorts.
Consider a Flow-based step:
```java
public virtual class FlowStep implements Step {
private final Invocable.Action specificFlow;
private Boolean shouldRestart = false;
public FlowStep(String specificFlowName, Map inputs) {
this.specificFlow = Invocable.Action.createCustomAction('flow', specificFlowName);
this.specificFlow.setInvocations(new List