diff --git a/docs/4. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a human agent.md b/docs/4. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a human agent.md index bd9a5f1d2..7f9d89a00 100644 --- a/docs/4. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a human agent.md +++ b/docs/4. Product Features/03. Flows/2. Flow Actions/16. Open a ticket with a human agent.md @@ -3,7 +3,7 @@ 5 minutes read Level: Advanced - Last Updated: October 2025 + Last Updated: July 2026 @@ -175,6 +175,22 @@ Once a ticket is created, users can make edits by utilizing the `Add Remark` opt image +## Use Case: Escalating unanswered AI queries to a human agent + +If you're using an AI Assistant to answer contact questions (see [File Search Using OpenAI Assistants](https://glific.github.io/docs/docs/Integrations/Filesearch%20Using%20OpenAI%20Assistants/)), some questions will fall outside what it can answer. Label the incoming message and Open a ticket with a human agent can be combined to automatically flag and route these to your team. + +1. Capture the contact's question with a Wait for Response node, then call your AI Assistant as usual. + +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. + +4. On that branch, add a [Label the incoming message](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Label%20the%20incoming%20message) node and enter a label such as AI_unhandled. No other Wait for Response node runs between the contact's original question and this point, so the label still lands on that original question rather than on the AI's reply. + +5. Right after the label node, add an Open a ticket with a human agent node, following the steps above. Use `@results.` as the Ticket Body so the ticket shows the contact's original question, and assign it to the relevant staff member or queue. + +This way, every query the AI can't resolve is labeled AI_unhandled and immediately handed off as a ticket, so you can report on how often the assistant falls back and make sure nothing gets missed. + ## Best Practices - Always assign tickets to the right staff to ensure faster resolution.