# Send to Google Drive

Archive documents to Drive as part of a workflow.

This guide explains how to use the workflow action **Send document to Google Drive** to automatically copy invoice PDF attachments into Google Drive when your workflow reaches that step.

**Who this is for:** Finance and operations teams that want invoices archived in Google Drive as part of processing, without manual downloads and re-uploads.

## What this step does

When an invoice reaches the step, Cortena:

1. Takes the invoice **PDF attachment**.
2. Creates any **subfolders** defined in your **Folder file path template**.
3. Uploads the file to Google Drive using the attachment's original name (`{{filename}}`).
4. Writes an entry to the invoice **Activity** log (success, failure, or skipped).

## Choose your destination

| Option | Where files are stored | Who owns the Drive | What you configure |
| --- | --- | --- | --- |
| **Cortena Shared Folder** | Cortena's shared Google Drive for your tenant, under a fixed **Exports** subfolder, then your path template | Cortena (shared with your organisation) | Only the folder file path template |
| **Data exchange** | A folder you select in your own Google Drive | Your Google account / organisation | Connect Google Drive in Integrations → Data exchange, pick a target folder, then set the path template |

With **Data exchange**, files live in **your** Drive. With **Cortena Shared Folder**, files live in Cortena's shared workspace under **Exports**.

Default path template for invoice workflows:

`Accounts Payables Invoices/{{invoice_date_yyyy}}/{{invoice_date_mm}}/{{filename}}`

## Set up the node

1. Go to **Workflow** and open the workflow you want to change.
2. From **ADD STEP → Actions**, add **Send document to Google Drive**.
3. Give the node a clear **Label** (appears in Activity).
4. Connect the step where it should run (after extraction, after a conditional, or before export).
5. Choose **Cortena Shared Folder** or **Data exchange** and set the path template.
6. Optionally enable **Ignore when invoice is reprocessed** to avoid duplicate PDFs on reprocess.
7. Save / publish the workflow.

![Workflow node: Send document to Google Drive](https://help.cortena.ai/assets/img/help/google-drive/01-workflow-send-document-to-google-drive-node.png)

### Path template variables

| Variable | Meaning |
| --- | --- |
| `{{invoice_date_yyyy}}` | Invoice date · year |
| `{{invoice_date_mm}}` | Invoice date · month |
| `{{invoice_date_dd}}` | Invoice date · day |
| `{{filename}}` | Attachment file name |
| `{{invoice_number}}` | Invoice number |
| `{{invoice_supplier_name}}` | Supplier name |
| `{{cost_center_kost1}}` | Cost center KOST1 |
| `{{booking_account_number}}` | Booking account number |

## Activity log

Every upload attempt is recorded on the invoice **Activity** panel:

- **Uploaded to Google Drive** · success
- **Google Drive upload failed** · missing folder, permissions, or configuration
- **Google Drive upload skipped** · for example ignore-on-reprocess was enabled

![Invoice Activity: Google Drive upload logged](https://help.cortena.ai/assets/img/help/google-drive/02-invoice-activity-google-drive-upload.png)

## Tips

- Start with **Cortena Shared Folder** for the quickest reliable archive.
- Switch to **Data exchange** when files must live in a specific company-owned folder. Connect Google Drive under **Integrations → Data exchange** first; until then the destination shows as not connected.
- **Exports** is fixed for Cortena Shared Folder. You only customise the path under Exports.
- Expenses use the same node type with a default **Expenses** section folder instead of Accounts Payables Invoices.

![Data exchange: Google Drive not connected](https://help.cortena.ai/assets/img/help/google-drive/03-data-exchange-not-connected.png)
