Sync PostgreSQL rows to FTPS with email alerts

Recipe ToolsMarketingDatabaseData ParserUtilitiesFile TransferProductivitySales Enablement

What it does

When the clock triggers every 5 minutes, this automation queries PostgreSQL for rows in the public.eaiesb table and uploads them to an FTPS server. If an error occurs, someone receives an alert email; otherwise, a confirmation email is sent.

Who it's for

Data and analytics teams who need to move database records to secure file storage on a schedule.

How teams use this

Move database exports to secure storage

Export rows from PostgreSQL every 5 minutes and upload them to FTPS so backups are current and secure. The team gets email confirmation or error alerts each cycle.

Archive records for compliance

Run the same query and file upload flow but target a compliance archive FTPS folder instead. The automation logic stays the same and only the destination changes.

Filter exports by date range

Add a condition to the PostgreSQL query so only rows created in the last 5 minutes are selected and uploaded to FTPS. This reduces file size and keeps storage lean.

How it works

  1. Run every 5 minutes. The automation starts on a 5-minute interval to check for new data in PostgreSQL and sync it to the FTPS server.
  2. Query the eaiesb table. Select rows from the public.eaiesb table in PostgreSQL to retrieve the data that needs to be synced to FTPS.
  3. Parse the JSON data. Parse the JSON document from PostgreSQL so it can be formatted and prepared for upload to the FTPS server.
  4. Upload file to FTPS. Upload the parsed file to the FTPS server. If an error occurs, Gmail sends an alert; if successful, a confirmation email is sent.