Automation library · CRM

Score customer health and churn risk with Salesforce

Started by a clock, and works across Gmail and Salesforce. It hands the judgement calls to Gemini. 27 steps, 4 branches, 2 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini

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

The flow

Starts it 2Model 1Logic 14Service 10

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

  1. 1Batch SyncSchedule triggerStarts it
  2. 2Error TriggerError triggerStarts it
  3. 3Salesforce - Fetch AccountsSalesforceService
  4. 4Alert - Error NotificationGmailService
  5. 5Loop Over ItemsSplit In BatchesLogic
  6. 6Init Retry CodeCodeLogic
  7. 7Decision - Circuit BreakerIfLogic
  8. 8ERP - Fetch OrdersHttp RequestService
  9. 9Fallback - Fetch Orders BackupHttp RequestService
  10. 10Decision - Orders SuccessIfLogic
  11. 11ERP - Fetch PaymentsHttp RequestService
  12. 12Wait - Retry DelayWaitLogic
  13. 13Support - Fetch TicketsHttp RequestService
  14. 14Increment Retry CountCodeLogic
  15. 15Marketing - Fetch EngagementHttp RequestService
  16. 16Normalize - Customer DataSetLogic
  17. 17Prepare AI InputCodeLogic
  18. 18AI - Customer Intelligence (Gemini)Google GeminiModel
  19. 19Parse - AI OutputCodeLogic
  20. 20Decision - High RiskIfLogic
  21. 21Alert - High Risk EmailGmailService
  22. 22Routing - Customer TypeSwitchLogic
  23. 23Merge - Preserve DataMergeLogic
  24. 24Update an accountSalesforceService
  25. 25Merge - Final OutputMergeLogic
  26. 26Log - Execution SummaryCodeLogic
  27. 27Alert - Success NotificationGmailService

How it's built

Starts on
A clock
Steps
27, with 4 branches, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Salesforce
Model
Gemini

Questions

What does it need to run?

An n8n account, plus your own Gmail and Salesforce accounts, 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?

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