Automation library · Lead generation

Lead automation with OpenAI and Gmail

Started by a change in a Google Sheet, and works across Gmail, Google Calendar and Google Sheets. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 24 steps, 2 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

24 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 2Model 7Logic 6Service 9

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

  1. 1Calendly TriggerCalendly triggerStarts it
  2. 2Google Sheets TriggerGoogle Sheets triggerStarts it
  3. 3OpenAI Chat ModelLm Chat Open AiModel
  4. 4Simple MemoryMemory Buffer WindowModel
  5. 5Find available timesGoogle Calendar ToolService
  6. 6Simple Memory1Memory Buffer WindowModel
  7. 7BookGoogle Calendar ToolService
  8. 8Edit Fields1SetLogic
  9. 9Meeting FinderAgentModel
  10. 10Reschedule AgentAgentModel
  11. 11Append row in sheet1Google SheetsService
  12. 12Set messageSetLogic
  13. 13Code in JavaScriptCodeLogic
  14. 14Send message and wait for response1GmailService
  15. 15Message LeadGmailService
  16. 16Set Lead ResponseSetLogic
  17. 17Switch1SwitchLogic
  18. 18Structure TimeOpen AiModel
  19. 19Message a modelOpen AiModel
  20. 20Prep LoomGmailService
  21. 21SwitchSwitchLogic
  22. 22Update row in sheet1Google SheetsService
  23. 23Confirmation+Prep LoomGmailService
  24. 24Update Status/new timeGoogle SheetsService

How it's built

Starts on
A change in a Google Sheet
Steps
24, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Calendar, Google Sheets
Model
OpenAI
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 Gmail, Google Calendar and Google Sheets accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a change in a Google Sheet.

Does it use AI?

Yes. It calls OpenAI. 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 24 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 24 steps before you point it at anything that matters.