Ocriva Logo

Documents

Connect Google Drive

Automatically pull documents from Google Drive for processing and export results back

integrationsgoogle-drivefile-storageautomation

Published: 4/8/2026

Connect Google Drive

Connect Google Drive to Ocriva so the system automatically pulls documents from an input folder, processes them with AI, and writes the results back to an output folder. Unlike other integrations that are outbound-only webhooks, the Google Drive integration is bidirectional: Ocriva pulls files in for processing and pushes results back to Drive in a single workflow.


Prerequisites

  • A Google account with access to Google Drive
  • An Ocriva organization to connect

How It Works

Google Drive (Input Folder)
      |

Ocriva pulls files → creates uploads → AI OCR
      |

Process with Template
      |
      ├──▶ Export results (JSON/CSV) → Google Drive (Output Folder)
      |
      └──▶ (Optional) Webhook notifies external systems

When sync is enabled, Ocriva monitors the input folder at regular intervals. When new files are detected, they are pulled in and created as uploads immediately — no manual uploading through the dashboard is required. Results are written back to the output folder in the configured format, giving your team direct access to extracted data from Drive without logging into Ocriva.

NOTE

Google Drive integration operates at the organization level, per template. One organization connects Drive once, and each template independently selects its own folders.


Step 1: Connect Google Drive to Your Organization

  1. Go to Organization Settings in the Ocriva dashboard
  2. Select the Integrations tab and find the Google Drive card
  3. Click Connect
  4. You will be redirected to the Google OAuth consent screen
  5. Select the Google account that has access to the Drive folders you want to use
  6. Click Allow to grant Ocriva permission to read from and write to your Drive
  7. After authorization, the Organization Settings page shows the status as Connected

TIP

Use a Google account that is the Owner or Editor of the target folders. This ensures Ocriva has full read and write permissions without encountering access errors during sync or export.


Step 2: Configure Input and Output Folders in a Template

After connecting Drive, assign folders to each template:

  1. Go to Templates and open the template you want to configure
  2. Select the Google Drive Settings tab
  3. Fill in the settings using the table below, then click Save
FieldDescription
Input FolderThe folder containing documents to process. Ocriva pulls new files from this folder.
Output FolderThe folder where result files (JSON/CSV) are written after processing completes.
Sync EnabledEnables or disables automatic polling of the input folder.

TIP

Create clearly named, separate folders for each template — for example Ocriva/Invoices/Input and Ocriva/Invoices/Output. This prevents files from mixing across document types and makes it easy to audit what was processed.


Step 3: Pull Documents from Drive

With sync enabled, Ocriva pulls new files from the input folder automatically:

  • Supported file types: PDF, images (PNG, JPG, TIFF), and scanned documents
  • Each pulled file is created as an upload in Ocriva and processed using the configured template
  • Processing status is visible in the Processing History dashboard

TIP

Organize your Drive folders by document type and create matching Ocriva templates — one for invoices, one for receipts, one for contracts. Each template pulls only from its own input folder, keeping processing pipelines independent.


Step 4: Export Results Back to Drive

When Ocriva finishes processing a document, results are automatically exported to the output folder:

  • Result files are saved in JSON or CSV format depending on your template configuration
  • File names correspond to the source file, for example invoice-2026-04.pdf produces invoice-2026-04-result.json
  • Team members can access results directly from Drive without logging into Ocriva

You can combine this with a webhook to notify external systems at the same time — for example, appending data to Google Sheets or posting a Slack message as soon as the export completes.


Checking Connection Status

Go to Organization Settings → Integrations → Google Drive to view the current status:

StatusMeaning
activeConnection is healthy. Token is valid and sync is operational.
disconnectedManually disconnected, or access was revoked from the Google account.
expiredToken has expired and automatic refresh failed.

Ocriva refreshes the access token automatically before it expires. If refresh fails — for example because the user revoked permissions in their Google account — the status changes to expired and sync stops until the connection is re-established.

To disconnect: Click Disconnect in Organization Settings. The stored token is deleted immediately.

To reconnect: Click Connect and complete the OAuth flow again.


Troubleshooting

ProblemLikely CauseResolution
Cannot connect Google DriveNot yet authorized, or token has expiredGo to Organization Settings → Integrations → Google Drive and click Connect again
No files found in input folderFolder ID is incorrect, or the connected account does not have access to the folderVerify the folder is shared with the connected Google account and the Folder ID in the template is correct
Export failsOutput folder does not allow write accessConfirm the connected Google account has Editor or Owner permission on the output folder
Status shows "expired"Token refresh failed, likely due to revoked permissionsDisconnect and reconnect via Organization Settings
Sync is not running despite active statusSync Enabled is turned off in the template, or the input folder is emptyEnable Sync in Template Settings and confirm the input folder contains files

Tips

  • Folder structure per document type: Create separate input and output folders per template, such as Ocriva/Invoices/Input and Ocriva/Receipts/Input. This keeps files organized and makes it easy to trace what each template processed.
  • Combine with webhooks: Add a webhook alongside Drive export to simultaneously push data to Google Sheets or trigger a Slack notification. This gives you double delivery — a structured file in Drive and a live notification in your team's workflow tool.
  • Shared Drive support: Ocriva works with Google Shared Drives. You can point input and output folders to any folder in a Shared Drive — it does not need to be in My Drive.
  • File retention and data privacy: Source files pulled from Drive are subject to the File Retention Policy configured in Ocriva. Review your retention settings before enabling sync on folders containing personal data. See File Retention for details.