The flow
Starts it 3Model 4Logic 6Service 7
The steps in the order they run, from what starts it.
- 1Google Drive TriggerGoogle Drive triggerStarts it
- 2execute_query_toolTool WorkflowModel
- 3Google Gemini Chat ModelLm Chat Google GeminiModel
- 4get_postgres_schemaTool WorkflowModel
- 5Execute Workflow TriggerExecute Workflow triggerStarts it
- 6When chat message receivedManual Chat triggerStarts it
- 7change_thisSetLogic
- 8AI Agent With SQL Query PromptAgentModel
- 9sql query executorPostgresService
- 10schema finderPostgresService
- 11table exists?PostgresService
- 12response outputSetLogic
- 13schema to stringCodeLogic
- 14fetch sheet dataGoogle SheetsService
- 15is not in databaseIfLogic
- 16create table queryCodeLogic
- 17remove tablePostgresService
- 18create tablePostgresService
- 19create insertion queryCodeLogic
- 20perform insertionPostgresService
How it's built
- Starts on
- An event in a connected app
- Steps
- 20, with 1 branch
- Size
- Medium: a working afternoon
- Connects to
- Google Sheets, Postgres
- Model
- Gemini
Questions
What does it need to run?
An n8n account, plus your own Google Sheets and Postgres accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.
What starts it?
It starts on an event in a connected app.
Does it use AI?
Yes. It calls Gemini. Model calls are billed by the provider, not by n8n.
How long does it take to set up?
Plan an afternoon. 20 steps is enough that you should read each one before running it.
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 itNothing 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 20 steps before you point it at anything that matters.