Automation library · Documents and files

Create custom PDF documents from templates with Gemini

Started by someone opening a chat with it, and works across Google Drive. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 30 steps, 4 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: GeminiRetrieval

30 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 2Model 9Logic 13Service 6

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

  1. 1Google Gemini Chat ModelLm Chat Google GeminiModel
  2. 2GetMetaDataHttp Request ToolService
  3. 3When chat message receivedChat triggerStarts it
  4. 4DocProcessTool WorkflowModel
  5. 5Postgres Chat MemoryMemory Postgres ChatModel
  6. 6Template ListHttp RequestService
  7. 7When Executed by Another WorkflowExecute Workflow triggerStarts it
  8. 8Google Gemini Chat Model1Lm Chat Google GeminiModel
  9. 9Structured Output ParserOutput Parser StructuredModel
  10. 10Google Gemini Chat Model2Lm Chat Google GeminiModel
  11. 11DocAgentAgentModel
  12. 12User Choice Match CheckChain LlmModel
  13. 13Format ControlChain LlmModel
  14. 14IfIfLogic
  15. 15Formatting CorrectionCodeLogic
  16. 16User Choice Match CorrectSetLogic
  17. 17User Choice Matching ErrorSetLogic
  18. 18CopyTemplateGoogle DriveService
  19. 19GetMetaData2Http RequestService
  20. 20If1IfLogic
  21. 21Edit FieldsSetLogic
  22. 22Cop. Document ID Matching ErrorSetLogic
  23. 23FillDocumentHttp RequestService
  24. 24ifIfLogic
  25. 25Generate Download LinkHttp RequestService
  26. 26SwitchSwitchLogic
  27. 27Download Link FormatSetLogic
  28. 28Template Technical ErrorSetLogic
  29. 29Incomplete Information ErrorSetLogic
  30. 30Other ErrorsSetLogic

How it's built

Starts on
Someone opening a chat with it
Steps
30, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Drive
Model
Gemini
Retrieval
Answers are drawn from documents you supply, not from the model alone

Questions

What does it need to run?

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

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 30 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 30 steps before you point it at anything that matters.