Sync loyalty rewards from SFTP to Snowflake

File TransferDatabaseMarketingRecipe ToolsWorkato

What it does

When a new or updated file lands in a directory on the SFTP server, this automation downloads it and uploads it to Snowflake. It bulk loads the data into a staging table and merges customer details with loyalty information using a custom SQL query.

Who it's for

Data and analytics teams who need to sync loyalty reward data from SFTP into Snowflake for customer analysis.

How teams use this

Automate daily loyalty data refresh

Load updated loyalty rewards from SFTP into Snowflake each day without manual intervention. The team gets fresh customer loyalty data ready for reporting and analysis.

Enrich customer records with CLV metrics

Include customer lifetime value calculations in the merge query so loyalty data combines with CLV information. This requires adding CLV table joins to the SQL statement.

Route high-value customers to retention team

Filter the merged data to identify top-tier loyalty members and send their records to a separate table for the retention team. Only customers meeting loyalty thresholds are included.

Alert on sync failures

Send an email notification when the bulk load or merge fails so the data team can investigate. The automation stops and does not retry on error.

How it works

  1. Detect new or updated file. Monitor a directory on the SFTP server for new or updated files containing customer loyalty data.
  2. Download the loyalty file. Download the file from the SFTP server so its contents can be processed and loaded into Snowflake for staging.
  3. Upload to Snowflake internal stage. Upload the downloaded file to an internal stage in Snowflake to prepare it for bulk loading into the loyalty staging table.
  4. Bulk load data to staging table. Load the file data from the internal stage into the loyalty staging table in Snowflake using bulk load operations.
  5. Merge customer and loyalty data. Run a custom SQL query in Snowflake to merge customer details with loyalty information, combining data from multiple tables for analysis.