Automation library · Scheduling

Automated marketing campaign email system with HubSpot

Started by a clock, and works across Gmail, Google Calendar, Google Sheets, HubSpot and one other. It hands the judgement calls to OpenAI. 39 steps: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

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

The flow

Starts it 3Model 7Logic 9Service 20

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

  1. 1Every hourSchedule triggerStarts it
  2. 2OpenAI Model1Lm Chat Open AiModel
  3. 3OpenAI ModelLm Chat Open AiModel
  4. 4DailySchedule triggerStarts it
  5. 5Gmail TriggerGmail triggerStarts it
  6. 6Get customersGoogle SheetsService
  7. 7Get campaignGoogle SheetsService
  8. 8AI Agent1AgentModel
  9. 9AI AgentAgentModel
  10. 10Don't email on weekendsFilterLogic
  11. 11Get message historiesData TableService
  12. 12FilterFilterLogic
  13. 13If campaign does not exist1Data TableService
  14. 14Convert to JSON objectCodeLogic
  15. 15Convert to JSON object1CodeLogic
  16. 16Get new campaignData TableService
  17. 17Update customer's replyData TableService
  18. 18Customer informationCodeLogic
  19. 19Insert new campaignData TableService
  20. 20Create new CustomerHubspotService
  21. 21Send a messageGmailService
  22. 22Get customerHubspotService
  23. 23ネガポジ判定Open AiModel
  24. 24Create calendar infoOpen AiModel
  25. 25Get CustomerHubspotService
  26. 26Update row in sheet1Google SheetsService
  27. 27Insert message historyData TableService
  28. 28Filter customerFilterLogic
  29. 29Update reply's categoryData TableService
  30. 30Convert to JSON ObjectCodeLogic
  31. 31reply to customerOpen AiModel
  32. 32Get historiesData TableService
  33. 33Create an eventGoogle CalendarService
  34. 34Convert to JSON object2CodeLogic
  35. 35Code in JavaScriptCodeLogic
  36. 36Reply to a messageGmailService
  37. 37Insert new mesageData TableService
  38. 38Update CampaignData TableService
  39. 39Update row in sheetGoogle SheetsService

How it's built

Starts on
A clock
Steps
39
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Calendar, Google Sheets, HubSpot, n8n data table
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Calendar, Google Sheets and HubSpot accounts, and a key for OpenAI. 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 OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 39 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 39 steps before you point it at anything that matters.