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

# File sharing

> Connect a Google Drive service account to Ravenna so workflows and Ravenna Agents can search Drive files and share or unshare them with people.

Connect Google Drive with a service account so workflows and Ravenna Agents can find files and manage who can open them. This connection is separate from the per-user sign-in that [imports files into knowledge](https://docs.ravenna.ai/integrations/google-drive/knowledge.md).

## Connect a service account

**1. Create a service account**

In Google Cloud Console, create a service account in a project with the Google Drive API enabled. Download its JSON key file.

**2. Connect in Ravenna**

Go to **Settings > Integrations**, open **Google Drive** and choose **Connect with Service Account**. Enter the service account credentials from the JSON key file. Ravenna checks the credentials with Google before saving.

**3. Share files with the service account**

Share the folders and files Ravenna should work with to the service account's email address. Ravenna only sees what is shared with it. To share or unshare a file, the service account needs **Editor** access to it.

> [!NOTE]
>
> One Google Drive service account connects per organization. Every workspace in the organization uses it.

## Workflow actions

Add these actions from the **Google Drive** app in the [workflow builder](https://docs.ravenna.ai/documentation/automate/workflows/workflow-builder.md).

| Action | Inputs | Output |
| - | - | - |
| **Search Files** | **Search Keyword** (matches file names and content), **Max Results** (1 to 100, default 25) | **Files** (File ID, File Name, MIME Type, Web View Link, Modified Time, File Size) and **Total Count** |
| **Share File** | **File URL**, **Users**, **Permission Level** (`reader`, `commenter` or `writer`), **Send Notification Email** (on by default) | None |
| **Unshare File** | **File URL**, **Users** | None |

**Users** accepts people and user groups. Ravenna expands groups to their members and uses each person's email address.

## Agent tools

Reference these tools in [agent rules](https://docs.ravenna.ai/documentation/automate/agents/configure.md#rules) with @ mentions.

| Tool | What it does | Inputs |
| - | - | - |
| `@Search Google Drive Files` | Finds files and returns each file's ID, name, type and link | `keyword`, `name_contains`, `file_type` (folder, document, spreadsheet, presentation, pdf, image or video), `owner_email`, `modified_after`, `modified_before`, `parent_folder_id`, `max_results` (default 25, up to 50) |
| `@Share Google Drive File` | Shares a file with one person | `file_url`, `user_email`, `role` (`reader`, `commenter` or `writer`), `send_notification` (default true) |
| `@Unshare Google Drive File` | Removes one person's access to a file | `file_url`, `user_email` |

When someone asks for access to a team document, find it with @Search Google Drive Files using the document name, confirm the right file with the requester, then run @Share Google Drive File with their email and role reader.

When someone asks for access to a team document, find it with @Search Google Drive Files using the document name, confirm the right file with the requester, then run @Share Google Drive File with their email and role reader.

## How it works

> [accordion] File URLs
>
> Share and unshare take the file's link, such as `https://docs.google.com/document/d/FILE_ID/edit` or `https://drive.google.com/file/d/FILE_ID/view`. Ravenna reads the file ID from the `/d/` part. A link without it fails with an invalid file URL error.

> [accordion] Search scope
>
> Search covers every file shared with the service account, including shared drives it belongs to. Trashed files are left out. When an agent search reaches its limit, the result says so and the agent can add filters to narrow it.

> [accordion] What unsharing removes
>
> Unshare removes access granted directly on the file. People with no direct access are skipped. Access inherited from a shared folder and the file owner's access stay in place.

> [accordion] Notification emails
>
> Google emails each person a file is shared with unless you turn **Send Notification Email** off in the workflow action, or the agent sets `send_notification` to false.

Learn more about [workflows](https://docs.ravenna.ai/documentation/automate/workflows/overview) and [configuring agents](https://docs.ravenna.ai/documentation/automate/agents/configure.md)


## Related topics

- [Overview](https://docs.ravenna.ai/integrations/google-drive/overview.md)
- [Attachments](https://docs.ravenna.ai/documentation/tickets/attachments.md)
- [Setup](https://docs.ravenna.ai/integrations/slack/setup.md)
- [Workflows](https://docs.ravenna.ai/integrations/jamf/workflows.md)
- [Available tools](https://docs.ravenna.ai/documentation/automate/mcp/tools.md)


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