like-gold•3mo ago
Workflow challenges
⏺ Summary of VAPI Workflow Integration Attempts
What We Discovered
Through extensive testing, we are finding that workflows are not supported in the VAPI
Web SDK. The Web SDK seems to only accept:
1. Assistant IDs (from assistants created in VAPI dashboard)
2. Inline assistant configurations
Everything We Tried
1. Initial Approach: Used workflowId parameter
- Result: SDK returned empty object, no error
2. Alternative Parameters: Tried workflow, assistantId with workflow ID
- Result: SDK returned empty object
3. Direct Vapi Constructor: Attempted new window.Vapi() approach
- Result: Constructor not available in the SDK
4. Assistant Object with ID: Used assistant: { id: workflowId }
- Result: Created instance but API call failed with "Assistant or Squad must
be provided"
5. Various SDK Versions: Tested both CDN versions
-
https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js
- https://unpkg.com/@vapi-ai/web@latest/dist/vapi.js
- Result: Neither supported workflows
Key Error Messages
- "API Key and Assistant Configurations are required"
- "Assistant or Squad must be provided" (400 error from api.vapi.ai/call/web)
Questions for VAPI Support
1. Is there any way to use workflows with the Web SDK? Our testing suggests
workflows are server-side only.
2. If workflows aren't supported in Web SDK, what's the recommended approach for
web applications that need workflow functionality?
3. Is there documentation specifically about workflow implementation? We
couldn't find any examples showing workflow usage with the Web SDK.
4. Can workflow IDs be used as assistant IDs in any scenario? Some users report
this worked before, but it doesn't seem to work now.
5. Is there a different SDK or API endpoint for web-based workflow calls?
3 Replies
Hi Bryan Altman,
Currently, Vapi workflows operate independently and cannot be directly linked to assistants within the Web SDK. Here's how you can manage workflows with the Vapi Web SDK:
1. Direct API Calls for Workflows: Use direct API calls to initiate workflows instead of attempting to use
vapi.start()
with a workflow ID. You call the workflow directly using its ID through the appropriate API endpoint.
2. Web SDK Configuration: Ensure that you configure your web application to use the workflow logic directly, handling the flow within your application instead of through assistant linkages.
If you need further technical details on setting up and managing workflows, the Workflows quickstart guide can provide helpful insights. This guide covers the steps to create and test workflows independently before deploying them via API in your web application.Workflows quickstart | Vapi
Build a simple agent that greets users and gathers basic information using Vapi workflows.
optimistic-gold•3mo ago
We're facing the same issue—there’s no way to get it working with the Web SDK/API. The workflow is absolutely essential to maintain the level of control any real-world enterprise project needs. Prompt engineering quickly becomes unmanageable once you start dealing with real use cases and CX in mind. Sooner or later, even for simple scenarios, a workflow becomes necessary. We’d really appreciate it if you could fix this or at least provide an estimated timeline. Thanks so much!
On the other hand, I have assistants running with "window.vapiSDK.run".
Would it be possible to use "window.vapiSDK.run" to start a workflow instead of the assistant? Thanks in advance!
g.onload = function () {
vapiInstance = window.vapiSDK.run({
apiKey: apiKey,
assistant: assistantId,
config: buttonConfig
});
I've solved it! I added Vite to the setup for vapi.start(null, null, null, WORKFLOW_ID) and it seems to work.
Hey, I'm closing this ticket now. Let me know if you need anything else.