docs: add AI fallback use case combining Label the incoming message and Open a ticket#645
docs: add AI fallback use case combining Label the incoming message and Open a ticket#645SangeetaMishr wants to merge 5 commits into
Conversation
…cket for AI fallback Answers the Discord question in #550 on how to auto-label AI-unhandled queries and escalate them to a human agent ticket. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the feature metadata date from October 2025 to July 2026. Added a use-case section documenting how unanswered AI queries are escalated through a webhook fallback phrase, original-message labeling, human-agent ticket creation using the original question, and separate handling of the webhook 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚀 Deployed on https://deploy-preview-645--glific-docs.netlify.app |
…tion Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Removing backticks around @results.<result name from step 1> left raw angle brackets, which MDX parsed as an invalid JSX tag and failed the build. Restore backticks around just this placeholder. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
||
| 2. In your AI Assistant's Instructions, ask it to always reply with one clear, consistent phrase when it can't answer, for example "I'm not able to help with that yet." This gives the flow something reliable to check for. | ||
|
|
||
| 3. Add a [Split by a result in the flow](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Split%20By/Result%20in%20the%20Flow/) node on the assistant's response (e.g. @results.gptresponse.message). Create a branch matching that fallback phrase, or use the Other branch to catch anything that isn't one of the assistant's expected answers. |
There was a problem hiding this comment.
@results.gptresponse.message is not enclosed in a code block. Also, I feel it would be good to clarify, this variable contains the response generated by the AI assistant where gptresponse refers to the result name of the Call a Webhook node through which the assistant is being called.
There was a problem hiding this comment.
Please also add that this should be configured after success / failure of the webhook call and before this response is sent to the user.
There was a problem hiding this comment.
Addressed in 585ab80: @results.gptresponse.message is now code-formatted, and I've added a note clarifying gptresponse is the result name of the Call a Webhook node used to call the assistant. I've also restructured the steps to make explicit that this check goes on the Success exit of the Call a Webhook node, before the assistant's reply is sent to the contact, and added a note on handling the Failure exit separately.
tanuprasad530
left a comment
There was a problem hiding this comment.
Apart from the comments added, it would be good to add screenshot(s), if not for every step, just one screenshot showing the configuration would suffice.
- Wrap @results.gptresponse.message in code formatting and clarify that gptresponse is the result name of the Call a Webhook node used to call the assistant - Make explicit that the fallback check runs on the Success exit of the Call a Webhook node, before the assistant's reply is sent to the contact, and add guidance on handling the Failure exit Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Pushed 585ab80 addressing both inline comments (code-formatting On the screenshot request: I don't have access to a live Glific instance in this environment to capture a new one for this combined use case. Each node this walkthrough references already has its own configuration screenshot on its own doc page (Split by a Result in the Flow, Label the incoming message, and the Open a ticket steps above in this same page), which I've linked to. If a screenshot of this specific combined setup is still wanted, I'd need someone with app access to grab one and I'm happy to slot it in - let me know if that's still a blocker for merging. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/4`. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a
human agent.md:
- Line 188: Update the guidance around the Split by a result node on
`@results.gptresponse.message` to require an exact branch matching the configured
fallback phrase for escalation. Clarify that the Other branch must not be
presented as equivalent, and should be used only when every non-matching
response is intentionally treated as unhandled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1860686c-b980-4401-9eeb-8f150e1a02c4
📒 Files selected for processing (1)
docs/4. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a human agent.md
|
|
||
| 3. In your AI Assistant's Instructions, ask it to always reply with one clear, consistent phrase when it can't answer, for example "I'm not able to help with that yet." This gives the flow something reliable to check for. | ||
|
|
||
| 4. On the `Success` exit of the Call a Webhook node - before the assistant's reply is sent back to the contact - add a [Split by a result in the flow](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Split%20By/Result%20in%20the%20Flow/) node on `@results.gptresponse.message` (the assistant's response - `gptresponse` here is the result name you gave the Call a Webhook node in step 2, so adjust it if you used a different name). Create a branch matching that fallback phrase, or use the Other branch to catch anything that isn't one of the assistant's expected answers. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not present the Other branch as an equivalent fallback.
If only the fallback phrase is configured, Other receives every response that does not exactly match it—including valid AI answers. Clarify that the exact fallback-value branch should be used for escalation; use Other only when all non-matching responses are intentionally considered unhandled.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/4`. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a
human agent.md at line 188, Update the guidance around the Split by a result
node on `@results.gptresponse.message` to require an exact branch matching the
configured fallback phrase for escalation. Clarify that the Other branch must
not be presented as equivalent, and should be used only when every non-matching
response is intentionally treated as unhandled.
|
@tanuprasad530 worked on the comments suggested above please review it. |
Summary
Fixes #550
Adds a "Use Case: Escalating unanswered AI queries to a human agent" section to the
Open a ticket with a human agentdoc, answering the Discord question referenced in the issue:Label the incoming messagein the AI fallback path so unhandled messages get labeled automatically (e.g.AI_unhandled).Open a ticket with a human agentright after labeling, so those queries route to a human agent.The walkthrough covers:
Split by a result in the flowon the assistant's response to branch on that fallback phrase (or theOtherbranch)AI_unhandledright there - since noWait for Responseruns between the contact's original question and this point, the label still lands on the original question, not the AI's replyOpen a ticket with a human agentnode immediately after, using the original question as the ticket bodyCross-links to the existing File Search / OpenAI Assistants doc, the Split by a Result in the Flow doc, and the Label the incoming message doc (recently expanded in #644) rather than duplicating their content.
Verification
No Glific feature returns a built-in "AI couldn't answer" signal, so the guidance relies on the org configuring a consistent fallback phrase in the assistant's Instructions and branching on it - this matches how orgs actually do this today per the linked Discord thread. The claim that the label still applies correctly a few nodes after
Wait for Response(as long as no otherWait for Responseintervenes) is grounded inglific/glific'sadd_input_labelsbehavior verified while writing #644 (it labelscontext.last_message, which is only overwritten when a new inbound message resumes the flow).Test plan
Summary by CodeRabbit