Create Salesforce records in batches from Amazon S3 CSV

Developer ToolMarketingRecipe ToolsCRM

What it does

When a new CSV file arrives in Amazon S3, this automation reads each row and filters for records matching your criteria. It batches the matching rows and creates them in Salesforce so large imports complete efficiently.

Who it's for

Sales operations teams who import customer data from S3 into Salesforce without manual uploads.

Apps used

How teams use this

Import customer data from S3 weekly

Upload a CSV to S3 each week and let this automation filter and batch-load records into Salesforce. No manual data entry or Salesforce uploads needed.

Exclude California records from sync

The automation skips any row where state equals CA, so only out-of-state customers are created in Salesforce. This keeps regional data separate without extra steps.

Add a filter for company size

Extend the condition to also check company size, so only mid-market and enterprise records are batched into Salesforce. Add a second condition to filter by that field.

Notify a Slack channel on completion

Include a Slack step after the platform event so the sales ops team gets a message when the batch import finishes in Salesforce. Only the notification step is new.

How it works

  1. Detect a new CSV file. Monitor Amazon S3 for a new CSV file. When one arrives, the automation reads the file and prepares to process each row.
  2. Filter rows by state. Loop through each row in the CSV file. Keep only rows where the state field does not equal CA so out-of-state records are processed in Salesforce.
  3. Batch and create records. Group the filtered rows into batches and create them as User snapshots in Salesforce. Batching speeds up the import and reduces API calls to Salesforce.
  4. Publish a platform event. Send a Salesforce platform event to notify downstream systems that the batch import is complete and ready for next steps.