Skip to main content

Set Up a Simple Flow

Learning Objectives

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

  • Set up a simple flow.
  • Configure a schedule and filter for your flow.
  • Confirm AppFlow is connected in Salesforce Setup.

The following walks you through setting up a simple flow between AWS and Salesforce. As it is a paid service and your data may vary, we won’t have you set up a flow using a Trailhead Playground or Developer org. Rather, we offer these steps as guidelines for the integration. This also familiarizes you with the process so you can set up automation and get data flowing in different directions later on.

Let's first look at the use case of a simple flow—a flow that sends data from Salesforce to AWS on a set schedule. You start in the AWS Management Console.

You use the AWS Management Console to configure your AppFlow integration.

  1. Sign in to AWS and enter AWS Management Console.
  2. Enter AppFlow in the Find Services field then click Amazon AppFlow.
  3. Click Create flow.
  4. In the Flow details section, give the flow a name and enter a description.
    In this example, the Flow name is “SalesforceToAmazonS3Demo” (1), and the description is “Copy opportunity records from Salesforce into an Amazon S3 bucket.” (2). It’s best to be clear and concise so your colleagues know exactly what the flow is about.Specify flow details screen with the Flow name and description filled out as described in the steps.
  5. Then click Next.

Connect Salesforce

  1. Select Salesforce from the Source name dropdown.
  2. Choose a Salesforce connection from the dropdown. If no connection exists, either select Create new connection, or Create new connection with AWS PrivateLink if you are using Salesforce Private Connect.
  3. Click Connect.
  4. In the popup window, choose either your production or sandbox org.
  5. Enter a name in the Connection name field. In this example, Production is selected and the Connection name is "MySalesforceProdConnection".Connect to Salesforce window with details filled out as described in the steps
  6. Click Continue.
  7. You’re taken to a Salesforce authorization page. Depending on your settings in Salesforce:
    1. You may only need to allow access. If that’s the case, check that you’re connecting via the correct Salesforce user name, then click Allow.
    2. If you’re asked to enter your Salesforce credentials, enter the appropriate credentials, sign in, and click Allow.
  8. Next, you have to select if you want to fetch specific Salesforce Objects, or if you want to subscribe to Salesforce Events (Change Data Capture and Platform Events) to Amazon S3. You can choose from all objects, including custom ones.
  9. In the destination, select Amazon S3.
  10. From the dropdown, choose an S3 bucket in the same AWS region where you’re creating this flow. If you don’t have an S3 bucket, here are the steps to create one.
  11. Configure flow screen with Salesforce selected as the source, MySalesforceProdConnection as the selected connection, and the Salesforce object dropdown open  Under Additional Settings, you can also choose advanced settings to configure different data formats, like JSON, CSV, or Parquet, file naming, and aggregation preferences.

Configure Your Flow

Next, you choose when to run the flow. The on-demand option lets you run the flow as soon as you save your configuration. The other option is to schedule your flow. In this example, Run flow on schedule (1) is selected. The flow is set to repeat every 1 minute (2), it’s configured to only transfer new data (3). 

You can choose from different Salesforce Date fields like Create Date or Last Modified Date to identify changes.

Flow trigger screen with configurations as mentioned

After you’ve configured the flow the way you want it, click Next.

Map the Fields

It’s time to map fields between Salesforce and Amazon S3. AppFlow allows you to either map fields manually (1) or upload CSV files with mapped fields.  

In the Map data fields section, select the fields of the Salesforce object that you want to transfer. You can also choose to map all fields in one click. In this example (2), the following fields are selected.

  • Account ID
  • Deleted
  • Master Record ID
  • Account Type
  • Parent Account ID
  • Billing Street

Map data fields screen with the source fields listed in the bullets selected

During this step, you can also add formula to the fields—you can mask characters or truncate fields. You can also combine two fields to create a new destination field. 

Click Next when you’re ready to proceed.

Validations

In the Validations section, you can add specific validations per field to drive specific actions. For example, you can select the Account Type field and apply a condition such as if the Account Type is missing our null, ignore that record. Configuration of Validations is optional.

Filter Your Data

Next, you have the option to filter data. For example, on the created date field, you can filter in records that were created before or after a certain date. 

Add filters screen with the Created Date field name selected, is before Condition, and Criteria set to 2020/04/01

Click Next when you’re ready to proceed.

Review Your Flow

The final step is to review and create your flow. Review the flow configuration and click Create flow. That’s it. Your flow is ready to run. 

Click Activate Flow if you set up the flow to run on the defined schedule, or Run Flow if you set up the flow to run on-demand. 

Ensure Your Flow Is Connected

Back in Salesforce, double-check to see if AppFlow is connected.

  1. Log in to Salesforce.
  2. Click Setup and select Setup.
  3. Enter connected app in Quick Find and select Manage Connected Apps.
  4. Verify Amazon AppFlow Embedded Login App is on your list of connected apps. Once you completed the authentication step, this connected app was automatically enabled in Salesforce.

One more check.

  1. Enter connected app in Quick Find if you're not there already, and select Connected Apps OAuth Usage.
  2. AppFlow Embedded Login App should be listed and should have Refresh token is valid until revoked under Manage App Policies. You can edit the policy to reflect this if you need to.
Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities