> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive Download from Link

> Tool that downloads a Google Drive file, or the files inside a Google Drive folder, from a link into the task and returns a `file_url` per file for downstream tools.

This document covers `download_google_drive_link` (display name **"Google Drive Download from Link"**). Given a Google Drive link, it downloads that file — or every file directly inside that folder — into the running task, and returns a `file_url` per file that downstream tools (`structured_data_extraction`, `csv`, `python_code`, export tools) accept.

## When to use — and when not

Use it when an agent is handed a **Drive link** and needs what is behind it **now** — e.g. "process the invoices in this folder: [https://drive.google.com/drive/folders/…](https://drive.google.com/drive/folders/…)".

* To find one file **by name** without a link, use `search_and_download_google_drive_file`.
* To process files **as they arrive** in a folder, use a Google Drive `file_import` **trigger**. The trigger only picks up files added after it is set up; this tool is how you import what is already there.

The download is a **point-in-time copy**; later changes in Drive are not reflected. Call again to refresh.

## Authentication

Uses the workspace's **Google Drive** connection (the first active one). The access token is injected by the platform and is not a per-run input. The folder or file must be visible to the connected Google account — shared with it, in its My Drive, or in a shared drive it belongs to. Outbound Drive API calls are audited.

Off by default — enable it in the agent's Tools panel.

## Inputs

* `link` (required): a folder link (`drive.google.com/drive/folders/<id>`, any `/u/<n>/` variant), a file link (`/file/d/<id>`, `open?id=`, `uc?id=`, `docs.google.com/.../d/<id>`), or a bare Drive ID.
* `include_types` (optional): file extensions to keep, e.g. `["pdf", "xlsx"]`. Case-insensitive; a leading dot is allowed. Omit to keep every type.
* `max_files` (optional): how many files to download from a folder. Default and maximum **10**.

## Behaviour

* A **folder** link downloads the files **directly inside** it, in name order. Subfolders are not opened.
* A **file** link downloads that one file.
* **Native Google files** (Docs, Sheets, Slides, Forms, shortcuts, …) are skipped — they have no file content to download and are not exported.
* Files whose extension is not in `include_types` are skipped.
* Each file can be at most **25 MB**, and at most **100 MB** is downloaded per call. A file larger than 25 MB is skipped (or, if Drive under-reported its size, stopped mid-download) as `too_large`; files that would push the call past 100 MB are skipped as `over_size_budget`.
* Links with a `?resourcekey=` (some older "anyone with the link" items) are supported: the key is sent back to Drive, along with each file's own key inside such a folder.
* Only the first 1,000 items of a folder are considered (`folder_truncated: true` when there are more).
* Files are downloaded four at a time. One failed file does not stop the others.
* Downloading the same file (same name and size) twice in one task reuses the copy already saved.

## Output

Structured result:

* `source`: `id`, `name`, `type` (`folder` | `file`), `url` of the linked item.
* `files`: every file a download was attempted for — `name`, `mime_type`, `size`, `drive_url`, `saved`, and when saved `file_url` and `file_id` (the platform `files` row); otherwise `not_saved_reason` (`too_large`, `empty_file`, `storage_unavailable`, `download_failed`).
* `saved_count`, `failed_count`.
* `skipped`: up to 50 items not attempted, each with `name` and `reason` (`subfolder`, `google_native_file`, `type_not_included`, `over_max_files`, `over_size_budget`, `too_large`); `skipped_count` is the full number.
* `folder_truncated` when the folder had more than 1,000 items.

On react tasks each `file_url` is a `${VAR_N}` task-variable reference that resolves automatically when passed to the next tool; CodeAct tasks receive the raw storage URL. Each saved file is registered as a task file, so it appears in the task's files like a manual upload.

## Errors

The call is reported as failed when:

* No Google Drive connection is available.
* `link` is not a Google Drive link or ID, or no ID can be found in it.
* The item does not exist or is not shared with the connected account.
* The folder cannot be listed.
* A **file** link points at a native Google file, or at a file outside `include_types`.
* Downloads were attempted and **none** succeeded.

An empty folder, or one where every file was filtered out, is **not** an error: the result simply has `saved_count: 0` and the `skipped` list explains why.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.