Voice Quickstart
Build a browser voice workflow with a Deepgram voice agent, test it in the editor, and connect it to the chat widget or AI Hub.
Coming soon
A browser voice workflow lets a user speak to an AI assistant from the browser. This quickstart builds a workflow with the Browser Voice Session trigger and the Deepgram Voice Agent action, tests it in the workflow editor, and connects it to a front end.
Architecture
microphone → ByteChef WebSocket → Deepgram Voice Agent (STT + LLM + TTS) → speakerThe Deepgram Voice Agent action runs speech-to-text, LLM reasoning, and text-to-speech at Deepgram over a single WebSocket. ByteChef forwards the audio, so you do not configure STT, the agent, and TTS as separate tasks. Splitting the chain across providers (for example, Deepgram STT, an Anthropic LLM, and ElevenLabs TTS) is possible, but the single-action setup is the recommended starting point.
Prerequisites
- ByteChef Enterprise Edition. Browser voice is not available in Community Edition.
- A Deepgram account and API key, from console.deepgram.com.
- A browser that supports the
AudioWorkletAPI: Chrome 66+, Firefox 76+, or Safari 14.1+. - HTTPS, or
http://localhostfor development. Browsers block microphone access on other insecure origins.
Step 1: Create a Deepgram connection
- Click Connections in the main sidebar, then New Connection.
- Select Deepgram, paste the API key, and click Save.
Step 2: Build the workflow
-
Create a workflow.
-
Add the trigger Browser > Browser Voice Session.
-
Configure the trigger:
Property Value Real-Time Workflow Any name, for example voice-subflow-1Audio Sample Rate 16 kHz Echo Cancellation On Noise Suppression On -
In the trigger's Real-Time Workflow editor (the embedded sub-workflow), add Deepgram > Voice Agent as the only task and configure it:
Property Description System Prompt The agent's behavior, for example "You are a helpful assistant. Keep responses concise and natural for spoken delivery." Greeting The assistant's opening line, for example "Hi! How can I help?" LLM Provider, LLM Model The model that generates replies, for example OpenAI gpt-4o-mini.TTS Provider, TTS Voice The voice, for example Deepgram aura-asteria-en.Audio Input/Output Encoding linear16. The input sample rate must match the trigger's sample rate.Connection The Deepgram connection from step 1.
Step 3: Test in the workflow editor
- Save the workflow.
- Click the microphone icon in the Playground panel header. The icon appears only when the workflow has a voice trigger.
- Grant microphone permission.
- Wait for the greeting, then speak.
See Testing voice in the editor for details and troubleshooting.
Step 4: Deploy
Deploy the project. The deployed workflow gets a webhook URL such as
https://<your-host>/api/automation/webhooks/<webhook-id>. Use this URL in the chat widget, the
AI Hub voice settings, or another front end.
Step 5: Connect a front end
Chat widget
import {AutomationChatModal} from '@bytechef/chat';
<AutomationChatModal
config={{
voiceWebhookUrl: 'https://<your-host>/api/automation/webhooks/<webhook-id>',
webhookUrl: 'https://<your-host>/api/automation/webhooks/<webhook-id>',
}}
/>If the widget runs inside an <iframe>, the iframe must have allow="microphone". Otherwise the
browser denies microphone access without a prompt:
<iframe src="https://your-site.com/chat" allow="microphone"></iframe>See the widget README for the full configuration reference.
AI Hub composer
A workspace administrator selects one of two voice routing modes in AI Hub Settings (the gear icon in the composer). The modes are mutually exclusive: selecting one clears the other.
| Mode | How it works | Setup |
|---|---|---|
| Workflow webhook (Path A) | Voice runs through your workflow's agent, with its system prompt, model, and tools. The AI Hub chat agent, its tools, and its memory are not active during voice. | Select Workflow webhook (Path A), paste the webhook URL from step 4, and click Save. |
| Native AI Hub voice (Path B) | Deepgram handles STT and TTS only. The AI Hub agent runs the LLM with the workspace's provider, tools, and chat memory. Voice and text turns in the same chat share session memory. | Create a Deepgram connection, select Native AI Hub voice (Path B), select Deepgram as the provider, paste the connection ID, optionally override Voice ID (default aura-asteria-en), and click Save. |
Then open an AI Hub chat and click the microphone button.
To use the Deepgram Voice Agent for STT, LLM, and TTS together, use Path A with a workflow that contains the Voice Agent action.
Limitations of native AI Hub voice
- Text-to-speech is buffered per sentence, not per token.
- The assistant does not stop speaking when the user starts talking (no barge-in).
- Deepgram is the only supported provider.
Costs
Deepgram bills voice usage per minute; ByteChef does not meter or charge for voice minutes. Check Deepgram's current pricing, and limit concurrent sessions per workspace in production.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| The microphone button does not appear | The workflow has no voice trigger with a Real-Time Workflow. Complete step 2. |
| The microphone button is disabled | The browser does not support AudioWorklet. Use a supported browser. |
| "Voice requires https://" | The page is served over plain HTTP from a host other than localhost. Serve ByteChef over HTTPS. |
| Microphone permission denied | The browser stored a denial for the origin. Reset it in the browser's site settings and reload. |
| "Invalid or expired session token" | Session tokens are single-use and expire after 60 seconds. Start a new session; check the client clock if it persists. |
| No audio response | The trigger's sample rate and the Voice Agent's audioInputSampleRate differ. Use the same value (typically 16000 for input; output is typically 24000). |
| The session ends after 30 minutes | The server limits each session to 30 minutes. Start a new session. |
Related
How is this guide?
Last updated on