Automation library · Money admin

Process emailed PDF invoices into QuickBooks bills with OpenAI

Started by an arriving email, and works across Gmail. It hands the judgement calls to OpenAI. 22 steps, 4 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

22 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
0Loops or waits
1Service it connects to

The flow

Starts it 1Model 2Logic 12Service 7

The steps in the order they run, from what starts it.

  1. 1Gmail TriggerGmail triggerStarts it
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3ConfigSetLogic
  4. 4AI Extract Invoice DataInformation ExtractorModel
  5. 5Extract Text from PDFExtract From FileService
  6. 6Is Invoice?IfLogic
  7. 7Validate Extracted DataCodeLogic
  8. 8Is Valid?IfLogic
  9. 9Search vendorQuickbooksService
  10. 10Error: Extraction FailedGmailService
  11. 11Vendor Found?IfLogic
  12. 12Prepare Bill DataCodeLogic
  13. 13Error: Vendor Not FoundGmailService
  14. 14Create BillQuickbooksService
  15. 15Build Attachment MetadataCodeLogic
  16. 16Fetch PDF BinaryCodeLogic
  17. 17Metadata to BinaryCodeLogic
  18. 18Merge PDF + MetadataMergeLogic
  19. 19Force Inline BinaryCodeLogic
  20. 20Upload PDF to BillHttp RequestService
  21. 21Send Confirmation?IfLogic
  22. 22Send Confirmation EmailGmailService

How it's built

Starts on
An arriving email
Steps
22, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 22 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 22 steps before you point it at anything that matters.