Sync BigQuery data to Sftp via Google Cloud Storage

Recipe ToolsWorkatoNLUArtificial IntelligenceDirectory ServicesCloud PlatformFile Transfer

What it does

When a function call arrives, this automation queries BigQuery for new records. It exports matching data through Google Cloud Storage and uploads the file to Sftp so downstream systems stay in sync.

Who it's for

Data and analytics teams who need to move BigQuery exports to Sftp without manual file handling.

How teams use this

Export daily reports to Sftp

Query BigQuery for records from the past day, export them through Google Cloud Storage, and upload to Sftp. The file is then available for partners or legacy systems to retrieve.

Route exports to different Sftp paths

Use the same BigQuery query and export flow but change the Sftp destination folder based on the data type or region. Only the upload step changes.

Add data validation before upload

Include a row count check or data quality condition before the export runs so only valid datasets reach Sftp. Add a validation step that filters or halts the job if thresholds are not met.

Notify teams when export completes

Send a message to a Slack channel or email when the file is successfully uploaded to Sftp. Add a notification step after the upload so stakeholders know the data is ready.

How it works

  1. Receive the function call. A function call starts this automation in real time with the parameters needed to query and export data.
  2. Query BigQuery for new records. Run a custom SQL query in BigQuery to select rows that match the criteria. If no rows are found, the job stops with an error.
  3. Export data through Google Cloud Storage. Export the BigQuery results to a view, then to a table, and finally to Google Cloud Storage as a file for transfer.
  4. Upload file to Sftp server. Download the file from Google Cloud Storage and upload it to the Sftp server so it is ready for downstream systems.