When Should Your Shopify Chat Bot Hand Off to a Human? A Small Rules Engine A developer published a small, testable JavaScript rules engine for deciding when a Shopify live-chat bot should hand a conversation off to a human agent. The function returns a reason string rather than a boolean — triggered by a customer asking for a person, sensitive-topic keywords, two failed answers, or low bot confidence — so each escalation can be logged, and it falls back to collecting contact details when the team is offline. The writeup recommends sending the chat transcript with every transfer and reviewing the top handoff reasons weekly. When Should Your Shopify Chat Bot Hand Off to a Human? A Small Rules Engine A live chat AI app is only as good as its handoff. Here's a small, testable function that decides when to pass a chat to your team, and what to do if nobody is online. function shouldHandOff { message, failedAnswers, botConfident } { if ASKS HUMAN.test message return 'customer asked'; if ESCALATE WORDS.test message return 'sensitive topic'; if failedAnswers = 2 return 'bot failed twice'; if botConfident return 'low confidence'; return null; } Returning a reason instead of true means you can log why each chat escalated. Adjust the days and hours to your team's schedule. if isOnline { return { action: 'transfer', reason, transcript: chat.history }; } return { action: 'collect contact', reason, reply: 'Our team is offline right now. Leave your email or phone and we will reply by 11 AM tomorrow.', }; } Always send the transcript with the transfer so shoppers don't repeat themselves. Quick tests javascript console.log shouldHandOff { message: 'My order arrived damaged', failedAnswers: 0, botConfident: true } ; // 'sensitive topic' console.log shouldHandOff { message: 'What is the delivery time?', failedAnswers: 0, botConfident: true } ; // null Tips Log every handoff reason and review the top ones weekly. Don't promise a reply time your team can't keep. Keep the "talk to a person" option visible, not only automatic. If the shopper writes in an angry tone, escalate early.