Automation library · Lead generation

Qualify and score omnichannel leads with OpenAI and Gmail

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

LargeCalls a model: OpenAI

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

The flow

Starts it 2Model 6Logic 11Service 3

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

  1. 1OpenAI GPT-5.6 ResponseLm Chat Open AiModel
  2. 2Parse Response OutputOutput Parser StructuredModel
  3. 3Capture Webhook LeadsWebhookStarts it
  4. 4Capture Gmail LeadsGmail triggerStarts it
  5. 5OpenAI GPT-5.6 AnalyzerLm Chat Open AiModel
  6. 6Parse AI Analysis OutputOutput Parser StructuredModel
  7. 7Generate Hot Lead ResponseChain LlmModel
  8. 8Set Webhook Lead DataCodeLogic
  9. 9Set Gmail Lead DataSetLogic
  10. 10Analyze Lead with AIChain LlmModel
  11. 11Draft Response EmailCodeLogic
  12. 12Set Lead ConfigurationSetLogic
  13. 13Calculate Lead ScoreCodeLogic
  14. 14Create Draft in GmailGmailService
  15. 15If Lead ValidIfLogic
  16. 16Route by Lead ScoreSwitchLogic
  17. 17Build Lead Database EntryCodeLogic
  18. 18Read Existing Leads from SheetsGoogle SheetsService
  19. 19Append Lead to SheetsGoogle SheetsService
  20. 20Check for Duplicate LeadsCodeLogic
  21. 21If Duplicate LeadIfLogic
  22. 22Restore Lead DataCodeLogic

How it's built

Starts on
Another system calling it
Steps
22, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail 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 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 22 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 22 steps before you point it at anything that matters.