Automation library · E-commerce

Confirm COD orders and recover carts with Telegram

Started by an incoming Telegram message, and works across Google Sheets, Slack and Telegram. It hands the judgement calls to OpenAI. 33 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

33 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
1Loop or waits
3Services it connects to

The flow

Starts it 5Model 2Logic 9Service 17

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

  1. 1Listen for Button RepliesTelegram triggerStarts it
  2. 2Every 15 MinutesSchedule triggerStarts it
  3. 3New Order PlacedWebhookStarts it
  4. 4Cart AbandonedWebhookStarts it
  5. 5On Workflow ErrorError triggerStarts it
  6. 6Route Confirm vs CancelSwitchLogic
  7. 7Get Pending OrdersGoogle SheetsService
  8. 8Normalize Order DataSetLogic
  9. 9Normalize Cart DataSetLogic
  10. 10Slack – Post Workflow Error AlertSlackService
  11. 11Update Sheet, ConfirmedGoogle SheetsService
  12. 12Update Sheet, CancelledGoogle SheetsService
  13. 13Calculate Elapsed & Nudge StageCodeLogic
  14. 14Log Order to SheetGoogle SheetsService
  15. 15Log Abandoned CartGoogle SheetsService
  16. 16Send Confirmation ThanksTelegramService
  17. 17Send Cancellation AckTelegramService
  18. 18Filter, Due for Nudge NowFilterLogic
  19. 19Filter, RTO Risk (2hr+)FilterLogic
  20. 20Send Order ConfirmationTelegramService
  21. 21Wait 30 MinutesWaitLogic
  22. 22Notify Admin, Order CancelledTelegramService
  23. 23Generate Nudge Message (AI)Open AiModel
  24. 24Notify Admin, RTO RiskTelegramService
  25. 25Check If Order PlacedGoogle SheetsService
  26. 26Send Follow-Up NudgeTelegramService
  27. 27Mark RTO Risk in SheetGoogle SheetsService
  28. 28Order Already Placed?IfLogic
  29. 29Update Nudge CountGoogle SheetsService
  30. 30Skip, Already OrderedNo OpLogic
  31. 31Generate Discount Message (AI)Open AiModel
  32. 32Send Discount RecoveryTelegramService
  33. 33Update Cart, Recovery SentGoogle SheetsService

How it's built

Starts on
An incoming Telegram message
Steps
33, with 2 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, Slack, Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Google Sheets, Slack 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 an incoming Telegram message.

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 33 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 33 steps before you point it at anything that matters.