AleP
08/18/2025, 1:29 PMChiranjeet Mishra
08/20/2025, 9:18 AMimport { useVapiCall } from '@/hooks/useVapiCall';
const { startCallWithWorkflow } = useVapiCall();
// Define your workflow structure
const transientWorkflow = {
name: 'My Transient Workflow',
nodes: [
{
name: 'introduction',
type: 'conversation',
isStart: true,
prompt: 'You are a helpful assistant',
messagePlan: {
firstMessage: 'Hello! How can I help you today?',
},
metadata: {
position: { x: 0, y: 0 }
}
},
{
name: 'end',
type: 'end',
metadata: {
position: { x: 200, y: 100 }
}
}
],
edges: [
{
from: 'introduction',
to: 'end'
}
],
globalPrompt: 'Be helpful and concise',
model: {
provider: 'openai',
model: 'gpt-4'
},
voice: {
provider: 'azure',
voiceId: 'andrew'
}
};
// Start call with transient workflow
startCallWithWorkflow(transientWorkflow, {
// Optional variable values
customerName: 'John',
customVariable: 'value'
});