Skip to main content
Die online Trailblazer Community ist jetzt schreibgeschützt. In Kürze wird sich die Trailblazer Community für weitere Aktivitäten in Slack treffen. Häufig gestellte Fragen lesen | Hilfe erhalten

Integrate SageMaker AI with Salesforce Data 360

Learning Objectives

After completing this unit, you’ll be able to:

  • Identify the two main integration approaches.
  • Describe how Data 360 integration works.
  • Explain the OAuth authentication process for Data 360.
  • Distinguish between streaming and batch prediction patterns.
  • Recognize how predictions are used across Salesforce.

Two Paths to Integration

Salesforce gives you two main paths to integrate SageMaker AI models. For the first path, you use Data 360 (formerly Data Cloud) with Model Builder, part of AI Models (formerly Einstein Studio) in Data 360. This is the Salesforce native bring-your-own-model solution. For the second path, you use External Services with API Gateway, an approach that works without Data 360. Each path has its advantages, and the best fit depends on your organization's needs.

This unit focuses on the first approach: Data 360 with Model Builder. This is what Salesforce recommends for most organizations. Unit 2 covers the External Services approach.

When to Use This Approach

Data 360 with Model Builder works best when:

  • Your organization has Data 360 or plans to get it.
  • You need predictions in multiple Salesforce clouds and apps.
  • Governance and unified customer views matter to you.
  • You want less custom code to write.
  • You're building multiple machine learning (ML) use cases that can share the setup.

This is what Salesforce recommends for most organizations. It provides the deepest integration, requires the least custom development, and aligns with the Salesforce Platform direction.

What You Need for the Integration

For the Data 360 integration with SageMaker AI, you need:

  • A Data 360 license
  • Model Builder access (in AI Models, formerly Einstein 1 Studio)
  • An AWS account with Amazon SageMaker AI permissions
  • The ability to set up OAuth

How Data 360 Integration Works

Let’s explore how this integration works.

The Data 360 and SageMaker AI integration creates a bidirectional flow. Data moves from Salesforce to AWS for model training. Predictions move from AWS back to Salesforce for business decisions. This eliminates the need to export data manually or maintain duplicate copies.

SageMaker Canvas includes a Data Wrangler connector for Salesforce Data 360. (Note that AWS might still reference the former name “Data Cloud” for this connector.) This connector authenticates using OAuth and accesses data directly. Data scientists can explore, transform, and prepare data without copying it to S3 first. They train models using current Salesforce data. Then they deploy those models to SageMaker endpoints. Model Builder registers these endpoints and routes predictions back into Data 360.

Here are the main integration steps.

Step 1: Connect Data Wrangler (in Canvas) to Data 360

Data Wrangler (accessed through SageMaker Canvas) connects to Data 360 using OAuth authentication. This integration needs to be set up in advance. More on that later. Once configured, Data 360 shows up as a data source in Data Wrangler. Then data scientists can explore, transform, and prepare data without copying it to S3.

Step 2: Train Models Using Data 360 Data and Deploy to SageMaker Endpoint

Data scientists train models in SageMaker AI using the prepared data. They might use SageMaker Canvas, built-in algorithms like XGBoost, or custom frameworks. Because models learn from current Data 360 data, there are no stale export issues. Once training completes, the trained models get deployed to SageMaker endpoints. You can set them up for real-time or batch predictions based on your needs.

Step 3: Register the Endpoint in Model Builder to Invoke Inference

Admins register the SageMaker endpoint in Model Builder. They set up mappings between Data 360 fields and what the model expects as input. They also choose the prediction scheduling pattern (either streaming for real-time updates or batch for scheduled runs). Once configured, predictions start flowing into Data 360.

From there, predictions are accessible everywhere in Salesforce. You can use them in Apex code, flow automation, Agent Actions, Analytics dashboards, and custom Lightning components.

Remember that the Data 360 and SageMaker AI integration works in both directions. Data and predictions flow back and forth. This bidirectional flow has two components.

  • Outbound: SageMaker Data Wrangler connects straight to Data 360 in Canvas. This eliminates data duplication and ensures models get trained on current data.
  • Inbound: Once you deploy models to SageMaker endpoints, Model Builder connects those endpoints back to Data 360. Predictions flow into Data 360. From there, they're available across your entire Salesforce Platform.

This creates a closed loop: Data 360 gives training data to SageMaker AI. SageMaker AI sends predictions back to Data 360. Those predictions then drive business decisions in Salesforce.

For more information, see the Salesforce developer blog on connecting Data 360 to SageMaker.

Set Up OAuth Authentication

OAuth is an authorization framework that lets one application access resources in another without ever handling the user's password. Instead of sharing credentials, Salesforce issues tokens that grant specific access and can be revoked at any time. For Salesforce Data 360, you set up OAuth through AWS Secrets Manager.

The Setup Process

Here's the high-level process. In Salesforce Data 360, you create a new app connection and specify the SageMaker Canvas application URL as the callback URL. Then you copy the consumer key, consumer secret, authorization URL, and token URL from Salesforce.

Then you move to AWS. You create a secret in AWS Secrets Manager. This secret stores your Salesforce credentials, and it includes the client ID, client secret, authorization URL, and token URL. You link this secret to your SageMaker domain or user profile.

Once configured, Data Wrangler can connect to Data 360. Access tokens refresh automatically, so you don't manage them day to day.

Importing Data

After OAuth is set up, Data 360 appears as a data source in Data Wrangler. You can query data directly, apply transformations, and prepare datasets for training. Data Wrangler stores imported data in the default SageMaker S3 bucket. This happens automatically. The bucket should be secured following AWS best practices. You can additionally encrypt data using AWS KMS keys.

Common Challenges

If you encounter issues, check the following.

  • Make sure your Identity and Access Management (IAM) role has the required permissions.
  • Verify that OAuth credentials are correct in Secrets Manager.
  • Check that the callback URL matches exactly.

Choose Your Prediction Pattern

After your model is deployed to a SageMaker endpoint, you need to decide how predictions flow into Data 360. Model Builder offers two main patterns: streaming and batch. Let’s take a look at each.

Streaming Predictions

Streaming predictions happen in real-time. As records change in Salesforce, predictions update immediately. This pattern uses Change Data Capture or Platform Events to detect changes. When a change occurs, Model Builder calls the SageMaker endpoint. The prediction flows back into Data 360 right away.

Use streaming when predictions need to be current. For example, when a sales rep views a lead, they need to see the latest score.

The trade-off? More endpoint invocations. Every change triggers a prediction. This increases costs, but it ensures predictions are always fresh.

Batch Predictions

Batch predictions happen on a schedule. Model Builder collects records that need scoring and sends them to SageMaker in batches. Predictions flow back and update Data 360.

Use batch when real-time updates aren't critical. If overnight or scheduled scoring is acceptable, you can minimize endpoint invocations with it.

You can also combine patterns. High-priority records might use streaming. Lower-priority records might use batch. Different use cases can use different patterns.

Using Predictions in Salesforce

Once predictions are in Data 360, you can use them throughout Salesforce. Here are the main ways.

  • Flow automation: Flow Builder is the Salesforce no-code automation tool for building workflows that act on predictions. For example, when a lead score exceeds a threshold, assign it to a sales rep. When a churn prediction is high, create a retention task.
  • Apex code: Apex is a Salesforce programming language. Developers can write custom logic that queries Data 360 through Apex and incorporates predictions into complex business rules.
  • Analytics and dashboards: Predictions are available to your analytics tools, including Tableau Next, which is built on Data 360. You can build dashboards that show prediction distributions, track how predictions change over time, and analyze prediction accuracy. This helps you understand model performance, identify trends, and communicate insights to stakeholders.
  • Agent actions and Agentforce: Predictions can be triggered on demand by service agents, and Agentforce autonomous agents can invoke predictions as actions in multi-step reasoning workflows—both through the Data 360 path and through External Services.

Integration Benefits

The Data 360 integration gives you several advantages.

  • Unified customer view: Predictions get stored in Data 360 alongside customer demographics, transaction history, support interactions, and marketing engagement. This gives you complete context for making decisions.
  • Real-time data access: SageMaker Data Wrangler accesses current data directly from Data 360. When customer behavior changes, those changes are immediately available for model training and retraining.
  • Platform-wide predictions: Once predictions are in Data 360, they're available everywhere in Salesforce.
  • Built-in governance: Data 360 governance features make sure that predictions follow the same security and compliance rules as other customer data.
  • Less development work: Model Builder handles authentication, data formatting, and prediction storage for you. Because you don't need to write custom code, integration cuts down development time and ongoing maintenance.

Wrap Up

In this unit, you learned about Data 360 integration with SageMaker AI. You explored how to set up OAuth authentication, streaming versus batch prediction patterns, and how to use predictions across Salesforce.

In the next unit, explore the alternative approach: External Services with API Gateway. This approach is best suited for organizations without Data 360 or those needing specific API control.

Resources

Teilen Sie Ihr Trailhead-Feedback über die Salesforce-Hilfe.

Wir würden uns sehr freuen, von Ihren Erfahrungen mit Trailhead zu hören: Sie können jetzt jederzeit über die Salesforce-Hilfe auf das neue Feedback-Formular zugreifen.

Weitere Infos Weiter zu "Feedback teilen"