n8n

How to Automate Google Drive PDF Data Extraction?

Turn PDFs in Google Drive into structured data with two AI engines, then compare the results. Ideal for teams that need fast and accurate data from invoices, forms, contracts, or KYC files without manual copy and paste.

The run starts with a manual test. You set one clear prompt that tells the system what to pull from the PDF. The file is downloaded from Google Drive and converted into a format the AI tools can read. The same file and prompt are then sent to Anthropic and Google Gemini at the same time. You can ask for JSON output for clean handoff to your database or app. Results let you see which model is faster, cheaper, or more accurate for your use case.

Setup needs access to Google Drive plus API keys for Anthropic and Google Gemini. Pick the PDF, edit the prompt for the fields you want, and run a test to review both outputs. Teams can use this to extract VAT IDs, totals, customer fields, and more. Expect big time savings on document intake and fewer errors from retyping. If you only want one AI, disable the other call to control cost.

What are the key features?

  • Manual test trigger to run the flow safely on demand
  • Single prompt field used by both AI calls for consistent extraction
  • Google Drive download of the selected PDF file
  • File to base64 conversion so the AI tools can read the document
  • Parallel HTTP requests to Anthropic and Google Gemini for side by side results
  • Optional JSON formatting using model settings for structured output
  • Enable or disable either AI call to manage cost and testing

What are the benefits?

  • Reduce manual work from 2 hours to 5 minutes per file
  • Streamline document intake by up to 80 percent
  • Improve data accuracy by removing most retyping errors
  • Compare two AI outputs to pick the faster or cheaper option
  • Produce clean JSON for easy loading into apps and databases

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, Anthropic and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. Open the Define Prompt node and write a clear instruction for the fields you want from the PDF, for example VAT numbers by country.
  4. Double click the Google Drive node. In the Credential to connect with dropdown, click Create new credential and follow the on screen steps to connect your Google Drive account. Pick the PDF file you want to process.
  5. Double click the Anthropic HTTP Request node. In the Credential dropdown, click Create new credential. Generate an API key in your Anthropic account and paste it into n8n. Save the credential.
  6. Double click the Google Gemini HTTP Request node. In the Credential dropdown, click Create new credential. Create an API key in Google AI Studio and paste it into n8n for the Google Gemini credential. Save the credential.
  7. Confirm the Extract from File node is set to convert the PDF to a base64 field. This prepares the file for both AI requests.
  8. Optional for structured output: In the Gemini request body, add generationConfig with responseMimeType set to application/json. For Anthropic, use a response prefill pattern to guide JSON formatting.
  9. Click Execute workflow to run a test. Open the two HTTP nodes and review their outputs. Check that the fields match your prompt and that JSON is valid if you requested it.
  10. If the Google Drive node fails, make sure the PDF is in the connected account and that you have permission to download it. If an AI request fails, verify the API key and usage limits.
  11. To compare cost or speed across runs, keep the prompt the same and only change the file. You can disable either AI node when you want to use only one provider.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Anthropic

Sign up

Pay-as-you-go: Claude 3 Haiku at $0.25 per 1M input tokens and $1.25 per 1M output tokens

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.