How to run multiple AI prompts on each PDF in a GDrive folder and output to A GSheet or DB

Hi N8N Team & Community,

I’m hoping someone can point me to a tutorial video or doc that can help me with the following use case:

  • I have a bunch of customer contracts in a GDrive folder (and nested folders)
  • I want to connect to that folder and feed each file into OpenAI’s API (I have a key) to run prompts on each document. Examples include: What is the name of the customer in this document, what is the governing law in this document, are there refund rights in this document, what product(s) is/are being purchased, what is the name of this file, what is the URL of this file
  • I want to place the results of this into a GSheet or DB

I’m 100% confident this is doable in n8n… I’m a little stuck on the “how” right now

Many thanks in advance,
Jamie

2 Likes

Hi @Jamie_Sidey,

This is possible with n8n. Here’s an idea on how to build it.

  • add a step for google drive. extract all files in a specific folder
  • Connect the output to an ai agent (openai). Use a system prompt to extract the name, law, refund info. Make sure to output as json
  • Connect a google sheets step to upcert the results.

Hope this helps!

Robert Breen

Hi @Jamie_Sidey

Did this help you solve your issue?

Best,

Robert