Skip to main content

Generate a Flow with AI

The AI generator uses Claude (claude-sonnet-4-6) with an edit_flow tool to build or modify Voiceblox flows from natural language descriptions.

How to use it

  1. Click the AI button in the top toolbar
  2. Describe the agent you want to build in plain language
  3. The AI generates a set of operations and applies them to the canvas

How it works

The system prompt is dynamically built from nodeTemplates.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_user to surface a clarifying question (response: { done: false, message })
  • Calls edit_flow to produce a list of operations (response: { done: true, operations[], versionName })
The operations are validated against the graph’s topology before being applied. If validation fails, the AI retries up to 3 times with the error feedback.

Operation types

OperationWhat it does
add_nodeAdds a new node with all parameters
update_nodeUpdates parameters on an existing node
remove_nodeDeletes a node and all its edges
add_edgeConnects two nodes
remove_edgeRemoves a connection

Example prompts

Build a customer support agent for a SaaS product with:
- A greeting
- A triage question (billing vs technical support)
- Two branches routing to different specialists
Add a web search tool to the existing flow so the agent can
look up real-time product pricing.
Change the opening message to be more friendly and casual.

Requirements

  • ANTHROPIC_API_KEY must 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
See Prompting Tips for more examples.