Skip to main content

Download File

Downloads a file from Google Drive to the local file system.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Drive Id - The identifier for the connected Google Drive service obtained from the Connect node.
  • File Id - The unique identifier of the file to be downloaded.
  • File Path - The local file path where the downloaded file should be saved.

Options

  • Pattern - (Optional) A pattern to use when creating a temporary file path if no File Path is specified.

Output

  • file_path - The local file path where the file was downloaded.

How It Works

The Download File node retrieves a file from Google Drive and saves it to the local file system. When executed, the node:

  1. Validates the required inputs (Drive Id, File Id, and File Path)
  2. Retrieves the Google Drive service client using the provided Drive Id
  3. Uses the Google Drive API to download the file with the Files.Get.Download method
  4. Creates or opens the specified local file path
  5. Copies the downloaded file content to the local file
  6. Returns the path to the downloaded file

Requirements

  • A valid Google Drive connection established using the Connect node
  • The File Id of an existing file in Google Drive
  • Appropriate permissions to read the file
  • Sufficient disk space to store the downloaded file
  • Write permissions to the specified file path

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Drive Id
  • Empty or invalid File Id
  • Empty or invalid File Path
  • Google Drive API errors during file download
  • Insufficient permissions to read the file
  • Insufficient disk space
  • Unable to create or write to the specified file path

Usage Notes

  • If no File Path is specified, a temporary file will be created using the Pattern option
  • The node will overwrite existing files at the specified path without warning
  • Large files may take longer to download depending on network conditions
  • The returned file_path can be used in subsequent nodes that process the downloaded file
  • Make sure the specified directory exists and is writable