Generate a Flow with AI
The AI generator uses Claude (claude-sonnet-4-6) with anedit_flow tool to build or modify Voiceblox flows from natural language descriptions.
How to use it
- Click the AI button in the top toolbar
- Describe the agent you want to build in plain language
- The AI generates a set of operations and applies them to the canvas
How it works
The system prompt is dynamically built fromnodeTemplates.ts and connectionRules.ts, so the AI always has an up-to-date understanding of the available nodes and valid connections.
When you submit a message, the AI either:
- Calls
ask_userto surface a clarifying question (response:{ done: false, message }) - Calls
edit_flowto produce a list of operations (response:{ done: true, operations[], versionName })
Operation types
| Operation | What it does |
|---|---|
add_node | Adds a new node with all parameters |
update_node | Updates parameters on an existing node |
remove_node | Deletes a node and all its edges |
add_edge | Connects two nodes |
remove_edge | Removes a connection |
Example prompts
Requirements
ANTHROPIC_API_KEYmust be set in.env.local
Tips
- Be specific about the conversation structure (number of steps, branch conditions)
- You can ask the AI to modify only part of an existing flow
- If the result isn’t right, describe what’s wrong and ask it to fix it