Automatically extract structured data from documents uploaded to Google Drive using n8n and the Parserdata API , then save clean JSON results back to Drive.
No prior n8n experience required.
This automation creates a fully hands-off document processing pipeline:
- Watches a Google Drive folder
- Detects newly uploaded files
- Downloads the document
- Sends it to the Parserdata extraction API
- Cleans the API response
- Saves the extracted data as a JSON file back to Google Drive
Once activated, everything runs automatically.
You will need:
- An n8n instance (cloud or self-hosted)
- A Google Drive account
- A Parserdata API key
- Open n8n
- Click New Workflow
- Give the workflow a name, for example:
Google Drive → Parserdata Extract → JSON
This node watches a Google Drive folder and starts the workflow automatically.
- Add node → Google Drive Trigger
- Configure the node:
- Trigger On:
Specific Folder - Event:
File Created - Folder To Watch: Select your input folder (for example:
Invoices) - Polling: Every minute (default is fine)
- Authenticate Google Drive
(standard Google OAuth popup)
What this does:
Whenever a new file appears in the selected folder, the workflow starts automatically.
Now we need the actual file content.
-
Add node → Google Drive
-
Set:
- Operation:
Download - File ID:
{{$json["id"]}}
- Operation:
-
Use the same Google Drive credentials
What this does:
Downloads the detected file and converts it into binary data that can be sent to an API.
This is the most important step.
- Add node → HTTP Request
- Method:
POST - URL: https://api.parserdata.com/v1/extract
- Authentication Type: Header Auth
- Header Name:
X-API-Key - Header Value: Your X-API-Key
- Send Body: enabled
- Content Type:
multipart/form-data
Name: prompt
Value: Extract invoice number, invoice date, supplier name, total amount, and line items (description, quantity, unit price, net amount).
Name: options
Value: {"return_schema":false,"return_selected_fields":false}
- Parameter Type: Form Binary Data
- Name: file
- Input Data Field Name: data
- Timeout:
300000(5 minutes)
What this does:
Uploads the document to Parserdata and instructs the AI exactly which fields to extract.
The API response includes metadata. We want only the extracted data.
- Add node → Code
- Language: JavaScript
- Paste the following code:
const api = $json;
// Create a clean output filename
const inputName = (api.file_name || api.result?.fileName || 'document').toString();
const base = inputName.replace(/\.[^.]+$/, '');
const outName = `${base}_extracted.json`;
// Return ONLY the extracted result
return [{
json: {
outName,
payload: api.result ?? api,
}
}];What this does:
Removes unnecessary API metadata
Keeps only extracted fields
Generates a clean JSON filename
Google Drive requires files in binary format.
-
Add node → Move Binary Data
-
Configure:
Mode: JSON → Binary
File Name: {{$json.outName}}
MIME Type: application/json
Keep Source: enabled
What this does: Turns structured JSON into a downloadable .json file.
Final step: save the result.
-
Add node → Google Drive
-
Configure:
Operation: Upload
Binary Data: enabled
File Name: {{$binary.data.fileName}}
Parent Folder: Select your output folder (for example: Extracted Results)
What this does: Uploads the extracted JSON file back to Google Drive automatically.
- Click Save
- Click Publish
🎉 Done!
- You upload a document to Google Drive
- n8n detects the new file
- The file is downloaded
- Sent to the Parserdata API
- Data is extracted using AI
- Clean JSON is generated
- JSON is uploaded back to Drive
All steps are fully automated.
- Start with one test document
- Inspect each node's output while testing
- If extraction results are incorrect, refine the prompt
- Keep field names consistent for downstream automation
- Download
workflow/google-drive-parserdata.json. - In n8n, click Import from File.
- Select the downloaded JSON file.
- Open the imported workflow and:
- Set your Google Drive credentials on all Google Drive nodes.
- Create an HTTP Header Auth credential with:
- Header name:
X-API-Key - Header value:
Your X-API-Key
- Header name:
- Replace
YOUR_INPUT_FOLDER_IDandYOUR_OUTPUT_FOLDER_IDwith your own Google Drive folder IDs.
- Save and activate the workflow.
This workflow is designed to fit a wide range of real-world automation and data extraction scenarios, including:
-
Invoice processing
Automatically extract invoice numbers, due dates, line items, prices, and totals from supplier invoices. -
Accounting automation
Reduce manual data entry by converting financial documents into structured JSON for accounting systems. -
ERP ingestion pipelines
Feed clean, structured data directly into ERP systems for order tracking, reconciliation, or reporting. -
CRM data enrichment
Extract customer, order, or transaction data from documents and attach it to CRM records. -
Back-office operations automation
Streamline repetitive document handling tasks across finance, operations, and administration teams. -
Supplier and purchase order processing
Automatically process purchase orders, delivery notes, and supplier documents. -
Financial reporting workflows
Prepare structured data for dashboards, analytics, and downstream reporting tools. -
Data preparation for analytics and BI tools
Generate machine-readable JSON ready for data warehouses and BI platforms. -
Startups and small teams
Replace manual workflows with AI-driven automation using minimal infrastructure.
MIT
