Skip to main content
Flows let you orchestrate structured WhatsApp experiences. Think onboarding sequences, surveys, or support flows, while still weaving in AI. A flow can branch on conditions, get or save variables, or even invoke an agent as a step, so you can mix deterministic actions with AI-powered paths. This quickstart shows how to bootstrap a flow locally with the Kapso CLI, deploy it, and test it on your WhatsApp number. You can build flows in two ways:
  • Visual canvas: Use the web Flow Builder to drag and drop nodes.
  • CLI + Flow SDK: Define flows in code and deploy with the Kapso CLI (covered below).

Install and setup

pip install kapso
kapso login

Create your flow

kapso pull my-project
cd my-project
kapso flow init my_first_flow
This creates flows/my_first_flow/ with:
  • flow.py: Your flow definition
  • metadata.yaml: Flow metadata

Edit your flow

Open flows/my_first_flow/flow.py. The basic template looks like:
from kapso.builder.flows import Flow
from kapso.builder.flows.nodes import StartNode, SendTextNode, WaitForResponseNode

# Replace with your WhatsApp config ID from Kapso
WHATSAPP_CONFIG_ID = 'replace_with_your_whatsapp_config_id_from_kapso'

# Create the flow
flow = Flow(
    name="My First Flow",
    description="A basic flow template"
)

# Add nodes and edges
start_node = StartNode(id="start")
welcome_node = SendTextNode(
    id="welcome",
    whatsapp_config_id=WHATSAPP_CONFIG_ID,
    text="Welcome! How can I help you today?"
)

flow.add_node(start_node)
flow.add_node(welcome_node)
flow.add_edge("start", "welcome")
Important: Replace WHATSAPP_CONFIG_ID with your actual ID from the Kapso dashboard.

Deploy your flow

kapso flow push my_first_flow
The output shows:
✓ Created new flow in cloud
  Flow ID: flow_abc123
  Name: My First Flow

Test your flow

Go to app.kapso.ai → your project → Flows → click Test on your flow. The test modal lets you:
  • Send an initial message to trigger the flow
  • See mock WhatsApp messages in real time
  • View flow events and variables as it executes
  • Send user responses when the flow waits for input
Unlike agents, flows don’t have a snapshot command. Testing happens directly in the web interface.
I