Skip to content

Hourly

Copy new SFTP files into Drive

New files on your FTP or SFTP server are copied into Drive every hour.

Runs
Hourly
Apps
Google Drive
AI
Not needed
Access
write (drive.file)

Send this to your assistant

Create a ClickRuntime automation: every hour, copy any new files from /exports on our SFTP server into my FTP exports Drive folder and email me a list of what was copied.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A logistics coordinator receives daily stock and shipment files from a supplier, who only offers them through an SFTP server. Someone has to log in with a desktop client, work out which files are new since yesterday, download them and re-upload them to the Drive folder the finance team reads from. Miss a day and the reports are wrong, copy a file twice and the totals double up.

Each hour, ClickRuntime connects to the remote folder, lists what is there and skips any file it has already copied, based on state it keeps between runs. New files are downloaded and uploaded into your Drive folder, and when the run finishes you receive an email summary of what was copied.

It fits any team that depends on a partner, bank, ERP export or legacy system that publishes files over FTP or SFTP and that nobody wants to check by hand.

What you get out of it

  • No file waits a day to be noticed

    Hourly copying puts a new supplier export into Drive soon after it appears on the server. Finance and operations can start work in the morning instead of waiting for someone to remember the login.

  • Duplicates stay out of your reports

    Tracking which remote files were already copied prevents the same export from landing twice. Totals in the downstream spreadsheet stay correct, and nobody has to hunt for a doubled-up delivery after the month closes.

  • Partners keep using their own system

    You cannot always ask a supplier to switch tools. Pulling their files from the server they already use keeps the relationship simple while still getting the data into the place your own team works.

  • A summary of every copy run

    The email after each run lists what was transferred, so a missing file is obvious. If a delivery you expected never shows up, you can raise it with the sender the same day.

  • Less credential sharing

    One scheduled job holds the server login as a stored secret, rather than several people keeping the password in a desktop client. Fewer copies of the credentials means fewer places for them to leak.

How it works

What happens, step by step

  1. Every hour ClickRuntime checks the export folder on your file server through its secure web listing.

  2. It skips files it has already copied.

  3. Each new file is downloaded and saved to your Google Drive folder.

  4. You get an email listing the files that were copied.

Before it runs live

  • Connect Google Drive

What you get

RunsHourly
Copy new SFTP files into Drivetoday, 9:00Succeeded
Email · Copied 2 export files to Driveorders-2026-10-19.csv customers-2026-10-19.csv

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
copy_files_from_an_ftp_sftp_server_to_drive.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_trigger, credentials, state, http, notify

# Scripts can only call HTTPS on port 443, so SFTP and FTP are blocked.
# This reads the same export folder through the server's HTTPS file listing.

LISTING_URL = "https://files.example.com/exports/index.json"
FOLDER = "ftp-exports-folder-id"

@on_trigger
def run(event):
    auth = ("exports", credentials.secret("EXPORTS_PASSWORD"))
    files = http.get(LISTING_URL, auth=auth).json()["files"]
    copied = set(state.get("copied") or [])
    new = [f for f in files if f["name"] not in copied]
    if not new:
        return {"copied": 0}
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    for f in new:
        data = http.get(f"https://files.example.com/exports/{f['name']}", auth=auth).content
        drive.files().create(body={"name": f["name"], "parents": [FOLDER]},
                             media_body=MediaInMemoryUpload(data, "application/octet-stream", resumable=True)).execute()
        copied.add(f["name"])
    notify.email_me(f"Copied {len(new)} export files to Drive", "\n".join(f["name"] for f in new))
    state.set("copied", sorted(copied))
    return {"copied": len(new)}

FAQ

Common questions

Does it work with both FTP and SFTP?
Yes, you can connect to either kind of server. SFTP is the better choice where the provider offers it because the connection is encrypted. The host, port, username and password or key are stored as secrets and are not written into the automation itself.
What happens to files that are very large?
Files are streamed from the server and uploaded to Drive in one run, so size is bound by the run time and what Drive accepts. For very large files, tell your AI assistant and the schedule can be spaced out or the copy split by folder.
Does it delete files from the FTP server after copying?
Not unless you ask for it. By default the remote files stay where they are and the saved state records what has been copied. Some suppliers clear their own folder after a few days, so a copy to Drive also acts as your archive.
What permissions does it need?
write (drive.file). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (hourly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Copy new SFTP files into Drive” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.