Automation library · Lead generation

Score, route, and reply to inbound leads with OpenAI and Gmail

Started by another system calling it, and works across Gmail, Google Sheets and Telegram. It hands the judgement calls to OpenAI. 24 steps, 1 branch: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

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

The flow

Starts it 3Model 3Logic 10Service 8

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

  1. 1When Lead Form SubmittedWebhookStarts it
  2. 2OpenAI GPT-4o-mini ModelLm Chat Open AiModel
  3. 3Apply Scoring JSON SchemaOutput Parser StructuredModel
  4. 4When Weekly at Monday 9amSchedule triggerStarts it
  5. 5Acknowledge Lead SubmissionRespond To WebhookStarts it
  6. 6Lead Scoring AgentAgentModel
  7. 7Read Lead Log from SheetsGoogle SheetsService
  8. 8Set Lead FieldsSetLogic
  9. 9Compute Lead ScoreCodeLogic
  10. 10Prepare for Manual ReviewSetLogic
  11. 11Filter Past 7 DaysFilterLogic
  12. 12Filter Valid LeadsFilterLogic
  13. 13Route by Lead QualitySwitchLogic
  14. 14Append Unscored to SheetsGoogle SheetsService
  15. 15Generate Weekly DigestCodeLogic
  16. 16Set Hot Lead AttributesSetLogic
  17. 17Set Warm Lead AttributesSetLogic
  18. 18Set Cold Lead AttributesSetLogic
  19. 19Ask Manual Review on TelegramTelegramService
  20. 20Post Weekly Digest on TelegramTelegramService
  21. 21Send Hot Lead Alert EmailGmailService
  22. 22Notify Sales on TelegramTelegramService
  23. 23Append Lead to SheetsGoogle SheetsService
  24. 24Draft Lead Response EmailGmailService

How it's built

Starts on
Another system calling it
Steps
24, with 1 branch
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets, Telegram
Model
OpenAI

Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

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 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.