Recipe: email a daily file from SFTP

Goal: every morning, fetch /outbound/report.csv from your SFTP server and email it to your team as an attachment. For files up to 10 MB.

Template: Email a daily file from your SFTP server (category Files and SFTP). Steps: 2. Needs: the login of your server and an email sender. No store permission at all.

Create it

  1. Open Secrets and create SFTP_HOST, SFTP_USER and SFTP_PASSWORD. See Secrets.
  2. Set up a sender under Email senders. See Send email and email senders.
  3. In Browse templates, search for daily file and select Use template on Email a daily file from your SFTP server.

How it is built

Part Setting
Trigger On a schedule, cron 0 6 * * *
Variable notify_email, the address that gets the email
Save the file into Files (File transfer) Protocol SFTP, Host {{ secrets.SFTP_HOST }}, Username {{ secrets.SFTP_USER }}, Password {{ secrets.SFTP_PASSWORD }}, What to do Download a file, File on the server /outbound/report.csv, Where the file goes Into Files, File key reports/daily-report.csv
Email the file (Send email) To {{ vars.notify_email }}, one attachment of the kind File from Files

The attachment's file key is read from the first step, so the two always agree:

{{ steps.download.output.key }}

Its File name carries the date:

report-{{ 'now' | date: '%Y-%m-%d' }}.csv

Subject and text use the date and the file's size:

Daily report of {{ 'now' | date: '%Y-%m-%d' }}

The daily report is attached ({{ steps.download.output.bytes }} bytes).

Make it yours

  1. Select Variables in the toolbar and set notify_email. Several addresses are separated by commas.
  2. Select the trigger and set the time and your Time zone. See Schedules.
  3. Select the first step and change File on the server to your file. For FTP or FTPS, change the Protocol. If you log in with a key, save the PEM key as a secret and reference it under Private key.
  4. Test as a preview. The download runs for real, so a wrong login or path shows at once. The file is not kept and no email is sent.
  5. Save and Turn on.

A file name that changes every day

If the server writes report-2026-09-20.csv, build the path with Liquid:

/outbound/report-{{ 'now' | date: '%Y-%m-%d' }}.csv

If you do not know the name, list the folder first: File transfer with List a folder and a File name pattern such as report-*.csv, then a Repeat for each over the list, with the download and the email inside and {{ loop.item.path }} as the file. The template Collect new files from your SFTP server and archive them there shows the listing and the move to an archive folder, so a file is not handled twice.

When the file is not there

A missing file fails the step at once, the run ends as Failed and you get the failure alert: a useful sign that the other side did not deliver. A server that cannot be reached is tried again automatically first. See Automatic retries.

Limits

  • All attachments of one email together: 10 MB.
  • The largest file in Files depends on your plan, from 5 MB to 50 MB.
  • The server must be reachable from the internet. If it only allows certain IP addresses, contact Support.

The same pattern, other sources

A file that was built by a Files step, for example a CSV of today's orders, or downloaded from an https link with Download file, is attached the same way: by its file key. See Files, SFTP and downloads.