Escalation to a Human

If you’re building an agent that answers questions coming from users (e.g., a support chatbot), you may want to set up rules such that anytime the incoming message from a user is sensitive (e.g., the user is angry or in a dangerous situation) then the LLM automatically escalates it to a human. With Workflows you’d be able to build that out real quick.

Implementation Steps

1

Add a classification prompt

Use a Prompt Node to filter out incoming messages

2

Add a downstream prompt

Use another prompt node for the LLM to respond to messages that don’t need to be escalated

3

Add and connect two Final Output Nodes

Connect the classification prompt outputs to two separate Final Output Nodes

4

Set up variables and hit Run!

Message routing to a human operator