# Google Drive

> Upload, move, and manage files in Google Drive.

App · File Storage · 6 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/google-drive

## Triggers

Start a workflow when something happens in Google Drive. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Google Drive New File

Triggers when a new file is added to Google Drive.

**Filters**: Narrow which events start a run.

- `folder_id`
- `mime_type`
- `name_pattern`

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `id` (text)
- `name` (text)
- `mime_type` (text)
- `created_time` (text)
- `modified_time` (text)
- `web_view_link` (text)

## Actions

### Create folder

Create a folder in Google Drive and return a link to it.

**Inputs**

- Folder name (`folder_name`, text, required): The name of the folder to create.
- Parent folder URL (`parent_folder_url`, text): The Google Drive URL of the folder to create the new folder in.

**Outputs**: Response envelope; the payload is in the "folder_link" field.

- `folder_link` (text): A link to the created folder

**Example output**

```json
{
  "folder_link": "https://drive.google.com/drive/folders/newfolder123"
}
```

### Delete file

Delete a file from Google Drive.

**Inputs**

- File URL (`file_url`, text, required): The Google Drive URL of the file to delete.

**Outputs**: Response envelope; the payload is in the "deleted" field.

- `deleted` (true/false): Whether the file was deleted

**Example output**

```json
{
  "deleted": true
}
```

### Download file from URL

Download a Google Drive file given its sharing URL.

**Inputs**

- File URL (`file_url`, text, required): The sharing URL of the Google Drive file.
- Download folder (`download_dir`, text): The folder to save the downloaded file in.

**Outputs**

- `content_type` (text)
- `filename` (text)
- `size_bytes` (number)

**Example output**

```json
{
  "content_type": "application/pdf",
  "filename": "downloaded_file.txt",
  "size_bytes": 1024
}
```

### Duplicate file

Duplicate a file in Google Drive and return a link to the copy.

**Inputs**

- File URL (`file_url`, text, required): The Google Drive URL of the file to duplicate.
- Destination folder URL (`destination_folder_url`, text): The Google Drive URL of the folder to place the copy in.
- New name (`new_name`, text): The name for the copy.

**Outputs**: Response envelope; the payload is in the "duplicate_link" field.

- `duplicate_link` (text): A link to the duplicated file

**Example output**

```json
{
  "duplicate_link": "https://drive.google.com/file/d/xyz789/view"
}
```

### Move file

Move a file to a different folder in Google Drive.

**Inputs**

- File URL (`file_url`, text, required): The Google Drive URL of the file to move.
- Destination folder URL (`destination_folder_url`, text, required): The Google Drive URL of the folder to move the file to.

**Outputs**: Response envelope; the payload is in the "file_link" field.

- `file_link` (text): A link to the moved file

**Example output**

```json
{
  "file_link": "https://drive.google.com/file/d/abc123/view"
}
```

### Upload file

Upload a file to Google Drive and return a link to it.

**Inputs**

- File (`file_path`, text, required): The file to upload, chosen with the file picker.
- Folder URL (`folder_url`, text): The Google Drive folder URL to upload the file to.
- File type (`mime_type`, text): The file's format, for example 'application/pdf'.

**Outputs**: Response envelope; the payload is in the "upload_link" field.

- `upload_link` (text): A link to the uploaded file

**Example output**

```json
{
  "upload_link": "https://drive.google.com/file/d/abc123/view"
}
```
