Immediately stops flow execution and transfers the conversation to human agents. Sets the flow status to ‘handoff’ and prevents further automated processing.

Configuration

  • id: Unique node identifier
No other configuration needed - handoff nodes simply trigger the transfer.

How it works

  1. Stops execution: Immediately halts automated flow processing
  2. Sets status: Changes flow execution status from ‘running’ to ‘handoff’
  3. Prevents messages: Blocks further automated message processing
  4. Requires intervention: Human agents must manually handle the conversation

Examples

Basic handoff
from kapso.builder.flows.nodes import HandoffNode

node = HandoffNode(id="escalate_to_human")
Handoff after explanation
# Send explanation first
explanation = SendTextNode(
    id="handoff_explanation",
    text="I'll connect you with a specialist who can better assist you."
)

# Then handoff
handoff = HandoffNode(id="transfer_to_agent")

# Connect them
flow.add_edge("handoff_explanation", "transfer_to_agent", "next")
Conditional handoff flow
# Decision point
decision = DecideNode(
    id="check_complexity",
    conditions=[
        Condition(label="simple", description="Issue is simple"),
        Condition(label="complex", description="Issue requires human help")
    ]
)

# Automated response
simple_response = SendTextNode(
    id="automated_help",
    text="Here's how to resolve this issue..."
)

# Human handoff
complex_handoff = HandoffNode(id="human_assistance")

# Connect decision paths
flow.add_edge("check_complexity", "automated_help", "simple")
flow.add_edge("check_complexity", "complex_handoff", "complex")

Usage patterns

Escalation flow