PDF extraction
How to watch a Google Drive folder for new PDFs
Use Google Drive API change notifications, Zapier, Make, or n8n to upload new Drive PDFs into okraPDF for extraction.
Google Drive folder intake is a natural PDF workflow. A vendor, client, or teammate drops a PDF in a shared folder. The file should be uploaded to okraPDF, processed, and routed into Sheets, Slack, a CRM, or your product.
This is API-feasible today. The Google Drive API push notification guide supports notifications for Drive files and changes resources. Drive also treats folders as files with the folder MIME type, as described in the Drive files and folders overview. The production pattern is usually: watch changes, filter for files whose parent is the target folder, then download and upload matching PDFs.
Choose the Drive path
| Path | Use when | Tradeoff |
|---|---|---|
| Zapier Drive trigger | Fastest no-code setup | Limited control but easy |
| Make or n8n Drive nodes | Flexible no-code setup | More setup work |
| Direct Drive API | Native product connector | OAuth, watch renewal, change tracking |
okraPDF’s direct Drive watch-folder connector is a native-product upgrade. The API path is available today through automation platforms or your own backend.
Direct API architecture
The direct Drive API flow:
- User connects Google Drive with OAuth.
- User selects a folder through Google Picker or your folder selector.
- Your backend stores the folder ID.
- Your backend starts a Drive changes watch channel.
- Drive sends a notification to your webhook.
- Your backend lists changes since the stored page token.
- Your backend filters for files with the watched folder as a parent.
- Your backend filters for PDFs.
- Your backend downloads the file.
- Your backend uploads it to okraPDF.
- okraPDF emits
document.processed.
Drive notifications tell you to check what changed; they do not contain the whole file. You need to list changes and fetch the file content.
Folder filtering
Do not treat every Drive change as an intake candidate. Filter before upload.
Recommended checks:
- The file is not trashed.
- The MIME type is
application/pdf. - The parent folder includes the selected folder ID.
- The file ID has not already been processed.
- The file size is within your upload limit.
- The user still has permission to read the file.
Store the Drive file ID, modified time, and okraPDF document ID. If a user edits or replaces a file, decide whether that creates a new okraPDF document or updates the old one.
Zapier setup
- Trigger: Google Drive New File in Folder.
- Filter: file extension is PDF.
- Action: okraPDF Upload PDF.
- Second Zap trigger: okraPDF PDF Ready.
- Destination: Google Sheets, Slack, Airtable, or your app.
This is the fastest path for teams that already live in Zapier.
Make or n8n setup
Make and n8n can both watch Drive and call HTTP APIs. Use the same structure:
- Drive trigger for new files in a folder.
- Filter for PDFs.
- HTTP request to okraPDF upload.
- Webhook trigger for okraPDF ready events.
- Destination module for rows or notifications.
Keep the upload flow and ready flow separate. Upload creates the job. Ready means downstream data is safe to use.
OAuth and scope notes
Drive integrations can request broad access or file-scoped access. Prefer the narrowest workable scope. If customers select individual folders or files, design the UX around explicit consent and clear revocation.
For business-critical folders, add a reconnect state. OAuth tokens expire, permissions change, and shared drives can be reorganized. A Drive connector should show “last seen”, “last ingested”, and “last error” rather than failing quietly.
Failure handling
Create a skipped-file log. Good statuses are:
skipped_not_pdfskipped_too_largeupload_failedprocessing_failedprocessed
This makes Drive intake explainable when a user asks why one PDF appeared in Sheets and another did not.