Templates / Confirm COD orders and recover carts with Telegram, Google Sheets, OpenAI and Slack

Confirm COD orders and recover carts with Telegram, Google Sheets, OpenAI and Slack

Ready for 3.0

by Rahul Joshi ✓ · 32 views · created 2026-07-23 · Lead Nurturing, AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (15)

TelegramGoogle SheetsOpenAISlack

What it does

Quick overview This workflow handles COD order confirmation and abandoned-cart recovery by combining webhooks, Google Sheets logging, OpenAI message generation, and Telegram messaging with inline buttons, plus Slack alerts for execution errors. How it works 1. Receives a new COD order via a webhook, normalizes the payload, appends it to an Orders Google Sheets tab, and sends the customer a Telegram message with Confirm/Cancel buttons. 2. Listens for Telegram button callbacks and routes the response to either confirm or cancel the order. 3. On confirmation, updates the matching order in Google Sheets and sends a Telegram thank-you message to the customer. 4. On cancellation, updates the order in Google Sheets, acknowledges the cancellation in Telegram, and notifies an admin via Telegram. 5. Runs every 15 minutes, reads orders from Google Sheets, calculates how long each order has been pending, and uses OpenAI (gpt-4o-mini) to generate and send timed Telegram nudges at 30 minutes, 1 hour, and 2 hours. 6. Flags orders with no response after 2 hours as RTO risk, alerts the admin in Telegram, and updates the RTO flag in Google Sheets. 7. Receives an abandoned-cart event via a webhook, logs it to an AbandonedCarts Google Sheets tab, waits 30 minutes, checks Google Sheets for an order, and if none is found sends an OpenAI-written discount message over Telegram and marks the cart as contacted. 8. Posts a Slack message when the workflow encounters an execution error. Setup 1. Create and connect credentials for Telegram Bot API, Google Sheets OAuth2, OpenAI, and Slack OAuth2. 2. Create a Google Sheets document with Orders and AbandonedCarts tabs and ensure the columns match the workflow’s expected fields. 3. Replace YOURGOOGLESHEETID in all Google Sheets nodes and set YOURADMINTELEGRAMCHATID in the admin notification nodes. 4. Update the Slack channel ID (YOURSLACKCHANNELID) used for error alerts. 5. Copy the two webhook URLs (/codos/new-order and /codos/cart-abandoned) and configure them in your store/checkout system to send POST requests with the required fields (including telegramchatid).

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.