Create an invoice workflow

What are you trying to achieve?

Hello, I am new to the community and try to build a workflow that takes received invoices from my emails, saves it in the most suitable GDrive Folder. Where I struggle at the moment are the steps:

  1. Analyse the PDF document that has been uploaded to the general GDrive Folder
  2. Allocate it to the correct sub-folder

I am not sure whether the modules I selected are the right ones and how to adjust them correctly so the GPT can allocate the invoices correctly.

Steps taken so far

I have attached a screenshot of the Modules I connected so far.

Screenshots: scenario setup, module configuration, errors

Hi Farid, Welcome to the community.

Can you please share output from GPT, and instructions added in GPT.

Best

I tipycally ask GPP to provide the output as a Json, with one of the variable being the suitable folder.

then you use a parse Json module to turn the result from GPT into something usable.

The prompt should be something similar to this:

You are a file classifier assistant.

Based on the following text content, determine:

  1. What type of document it is (e.g., invoice, contract, resume, receipt, report)
  2. The most suitable folder path to store the document
  3. Optional metadata like company/client name, date, or project code if available

Return the response in this exact JSON format:

{
“suitable_folder”: “”,
“document_type”: “”,
“client_name”: “”,
“project_code”: “”,
“notes”: “”,
“confidence_score”: <value between 0 and 1>
}

Here is the content:

{{text}}

You need to also specify what should be the folders used in each case, and then you can add them to the next module.

Hey Felipe,

you don’t need the Parse JSON module in the example you are providing. There is a setting inside the openAI module to return the output as a JSON and to parse it directly.

@Farid1 Use this as a referance to parse json from GPT response : JSON & Iterator mapping not working - #4 by Prem_Patel