Sahil
02/20/2025, 12:37 AMSahil
02/20/2025, 12:37 AMVapi Support Bot
02/20/2025, 12:38 AMSahil
02/20/2025, 12:38 AMVapi Support Bot
02/20/2025, 12:38 AMVapi Support Bot
02/20/2025, 12:39 AMSahil
02/20/2025, 12:40 AMVapi Support Bot
02/20/2025, 12:43 AMVapi Support Bot
02/20/2025, 12:43 AMApiRequest
and Gather
workflow nodes, providing flexibility in operations without interrupting the workflow.
3. Example Configuration:
- For instance, you can set up a hook for a call transfer:
json
{
"hooks": [{
"on": "call.ending",
"do": [{
"type": "transfer",
"destination": {
// Your transfer configuration
}
}]
}]
}
In this example, when a call is ending, a transfer action is executed.
4. Conditional Execution:
- Hooks can be conditionally executed using Assistant.hooks.filter
, allowing different hooks to be triggered based on various outcomes, such as call completion or system errors.
### Benefits of Using Hooks:
- Event Management: Hooks help manage events effectively, improving user experience by ensuring smooth transitions during interactions.
- Transfer Actions: They enable seamless call transfers based on user input or call progress.
- Enhanced Reliability: Hooks contribute to a more resilient and performant voice AI application by providing detailed control over workflows.
For more detailed information, you can explore Vapi's [workflow documentation](https://docs.vapi.ai/api#:~:text=Hook) to see how hooks can be integrated and utilized effectively!
Source: