Skip to content

SFTP CSV → validate → database, rejects emailed

Reads the CSV back off SFTP and takes it a row at a time: good rows are loaded into a table, a bad one is emailed to somebody instead of being dropped on the floor. The row-at-a-time part is the foreach — validate judges whatever payload it is handed, so validating an array would pass or fail the whole file at once.

The pipeline

This is the actual graph the template creates — 6 steps; dashed lines are the failure/invalid paths.

Connects to

  • SFTP
  • PostgreSQL
  • Email

How you know it worked

Five rows land in demo.file_customers, and exactly one — the row whose email is 'not-an-email' — arrives in MailHog as a CSV attachment. Nothing is lost either way, which is the whole point of routing rejects rather than failing the run.

Try this template

Used in: Banking & finance, Healthcare & laboratories, Telecom & utilities

Stop moving data by hand.

Start free with three projects, or talk to us about running it across your organisation.