Automation library · Data collection

Auto-reply to Instagram comments with Gemini and Google Sheets

Started by a clock, and works across Google Sheets. It hands the judgement calls to Gemini. 18 steps, 1 branch, 2 loops or waits: a working afternoon to understand properly.

MediumCalls a model: Gemini

18 stepsMedium: a working afternoon
1Branch: places the flow splits
2Loops or waits
1Service it connects to

The flow

Starts it 2Model 1Logic 10Service 5

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

  1. 1Manual TriggerManual triggerStarts it
  2. 2Schedule Trigger (Every 15 min)Schedule triggerStarts it
  3. 3Configure Post & MessageSetLogic
  4. 4Get Instagram PostsFacebook Graph ApiService
  5. 5Filter and Get Post IDCodeLogic
  6. 6Get All CommentsFacebook Graph ApiService
  7. 7Read Contacted UsersGoogle SheetsService
  8. 8Filter New CommentsCodeLogic
  9. 9Check If Has New CommentsIfLogic
  10. 10Loop Over ItemsSplit In BatchesLogic
  11. 11Skip (No New Comments)No OpLogic
  12. 12Generate SummaryCodeLogic
  13. 13Generate Reply with AIGoogle GeminiModel
  14. 14Parse AI ReplyCodeLogic
  15. 15Reply on CommentsFacebook Graph ApiService
  16. 16WaitWaitLogic
  17. 17API Error FallbackNo OpLogic
  18. 18Record Contacted UserGoogle SheetsService

How it's built

Starts on
A clock
Steps
18, with 1 branch, 2 loops or waits
Size
Medium: a working afternoon
Connects to
Google Sheets
Model
Gemini

Questions

What does it need to run?

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

What starts it?

It starts on a clock.

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. 18 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 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 18 steps before you point it at anything that matters.