Immediately stops flow execution and transfers the conversation to human agents. Sets the flow status to ‘handoff’ and prevents further automated processing.
from kapso.builder.flows.nodes import HandoffNodenode = HandoffNode(id="escalate_to_human")
Handoff after explanation
Copy
# Send explanation firstexplanation = SendTextNode( id="handoff_explanation", text="I'll connect you with a specialist who can better assist you.")# Then handoffhandoff = HandoffNode(id="transfer_to_agent")# Connect themflow.add_edge("handoff_explanation", "transfer_to_agent", "next")
Conditional handoff flow
Copy
# Decision pointdecision = DecideNode( id="check_complexity", conditions=[ Condition(label="simple", description="Issue is simple"), Condition(label="complex", description="Issue requires human help") ])# Automated responsesimple_response = SendTextNode( id="automated_help", text="Here's how to resolve this issue...")# Human handoffcomplex_handoff = HandoffNode(id="human_assistance")# Connect decision pathsflow.add_edge("check_complexity", "automated_help", "simple")flow.add_edge("check_complexity", "complex_handoff", "complex")