diff --git a/fern/docs.yml b/fern/docs.yml index a2e4a6b4..f0e30cf6 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -123,30 +123,6 @@ navigation: path: examples/docs-agent.mdx icon: fa-light fa-microphone - - section: Workflows - contents: - - page: Quickstart - path: workflows/quickstart.mdx - icon: fa-light fa-bolt-lightning - - page: Overview - path: workflows/overview.mdx - icon: fa-light fa-book - - section: Examples - icon: fa-light fa-code - contents: - - page: Appointment scheduling - path: workflows/examples/appointment-scheduling.mdx - icon: fa-light fa-calendar-check - - page: Outbound sales - path: workflows/examples/outbound-sales.mdx - icon: fa-light fa-money-bill-wave - - page: Medical triage - path: workflows/examples/clinic-triage-scheduling.mdx - icon: fa-light fa-stethoscope - - page: Order management - path: workflows/examples/ecommerce-order-management.mdx - icon: fa-light fa-shopping-cart - - section: Assistant customization contents: - section: Conversation behaviour @@ -236,6 +212,31 @@ navigation: - page: Tool calling integration path: customization/custom-llm/tool-calling-integration.mdx + - section: Workflows + icon: fa-light fa-diagram-project + contents: + - page: Quickstart + path: workflows/quickstart.mdx + icon: fa-light fa-bolt-lightning + - page: Overview + path: workflows/overview.mdx + icon: fa-light fa-eye + - section: Examples + icon: fa-light fa-code + contents: + - page: Appointment scheduling + path: workflows/examples/appointment-scheduling.mdx + icon: fa-light fa-calendar-check + - page: Outbound sales + path: workflows/examples/outbound-sales.mdx + icon: fa-light fa-money-bill-wave + - page: Medical triage + path: workflows/examples/clinic-triage-scheduling.mdx + icon: fa-light fa-stethoscope + - page: Order management + path: workflows/examples/ecommerce-order-management.mdx + icon: fa-light fa-shopping-cart + - section: Best practices contents: - page: Prompting guide diff --git a/fern/static/images/workflows/workflows-add-node.png b/fern/static/images/workflows/workflows-add-node.png new file mode 100644 index 00000000..f3684e7e Binary files /dev/null and b/fern/static/images/workflows/workflows-add-node.png differ diff --git a/fern/static/images/workflows/workflows-ai-edge.png b/fern/static/images/workflows/workflows-ai-edge.png new file mode 100644 index 00000000..a540dbcc Binary files /dev/null and b/fern/static/images/workflows/workflows-ai-edge.png differ diff --git a/fern/static/images/workflows/workflows-api-node.png b/fern/static/images/workflows/workflows-api-node.png new file mode 100644 index 00000000..8aa17046 Binary files /dev/null and b/fern/static/images/workflows/workflows-api-node.png differ diff --git a/fern/static/images/workflows/workflows-complete-basic-flow.png b/fern/static/images/workflows/workflows-complete-basic-flow.png new file mode 100644 index 00000000..14c6581b Binary files /dev/null and b/fern/static/images/workflows/workflows-complete-basic-flow.png differ diff --git a/fern/static/images/workflows/workflows-configure-first-node.png b/fern/static/images/workflows/workflows-configure-first-node.png new file mode 100644 index 00000000..071214c9 Binary files /dev/null and b/fern/static/images/workflows/workflows-configure-first-node.png differ diff --git a/fern/static/images/workflows/workflows-conversation-node.png b/fern/static/images/workflows/workflows-conversation-node.png new file mode 100644 index 00000000..03017b47 Binary files /dev/null and b/fern/static/images/workflows/workflows-conversation-node.png differ diff --git a/fern/static/images/workflows/workflows-create-workflow.png b/fern/static/images/workflows/workflows-create-workflow.png new file mode 100644 index 00000000..aa592b36 Binary files /dev/null and b/fern/static/images/workflows/workflows-create-workflow.png differ diff --git a/fern/static/images/workflows/workflows-edit-edge-condition.png b/fern/static/images/workflows/workflows-edit-edge-condition.png new file mode 100644 index 00000000..7006869a Binary files /dev/null and b/fern/static/images/workflows/workflows-edit-edge-condition.png differ diff --git a/fern/static/images/workflows/workflows-end-call-node.png b/fern/static/images/workflows/workflows-end-call-node.png new file mode 100644 index 00000000..6893dd6b Binary files /dev/null and b/fern/static/images/workflows/workflows-end-call-node.png differ diff --git a/fern/static/images/workflows/workflows-end-node.png b/fern/static/images/workflows/workflows-end-node.png new file mode 100644 index 00000000..c0bc18eb Binary files /dev/null and b/fern/static/images/workflows/workflows-end-node.png differ diff --git a/fern/static/images/workflows/workflows-extract-node.png b/fern/static/images/workflows/workflows-extract-node.png new file mode 100644 index 00000000..f1790af8 Binary files /dev/null and b/fern/static/images/workflows/workflows-extract-node.png differ diff --git a/fern/static/images/workflows/workflows-extract-variables.png b/fern/static/images/workflows/workflows-extract-variables.png new file mode 100644 index 00000000..7fd1fe05 Binary files /dev/null and b/fern/static/images/workflows/workflows-extract-variables.png differ diff --git a/fern/static/images/workflows/workflows-global-node-configuration.png b/fern/static/images/workflows/workflows-global-node-configuration.png new file mode 100644 index 00000000..2b7ddb89 Binary files /dev/null and b/fern/static/images/workflows/workflows-global-node-configuration.png differ diff --git a/fern/static/images/workflows/workflows-global-node-toggle.png b/fern/static/images/workflows/workflows-global-node-toggle.png new file mode 100644 index 00000000..7c84f404 Binary files /dev/null and b/fern/static/images/workflows/workflows-global-node-toggle.png differ diff --git a/fern/static/images/workflows/workflows-overview.png b/fern/static/images/workflows/workflows-overview.png new file mode 100644 index 00000000..f7815491 Binary files /dev/null and b/fern/static/images/workflows/workflows-overview.png differ diff --git a/fern/static/images/workflows/workflows-second-node-added.png b/fern/static/images/workflows/workflows-second-node-added.png new file mode 100644 index 00000000..13bc5b72 Binary files /dev/null and b/fern/static/images/workflows/workflows-second-node-added.png differ diff --git a/fern/static/images/workflows/workflows-second-node-prompt.png b/fern/static/images/workflows/workflows-second-node-prompt.png new file mode 100644 index 00000000..d87bceca Binary files /dev/null and b/fern/static/images/workflows/workflows-second-node-prompt.png differ diff --git a/fern/static/images/workflows/workflows-test-call-button.png b/fern/static/images/workflows/workflows-test-call-button.png new file mode 100644 index 00000000..9e52bf06 Binary files /dev/null and b/fern/static/images/workflows/workflows-test-call-button.png differ diff --git a/fern/static/images/workflows/workflows-tools-node.png b/fern/static/images/workflows/workflows-tools-node.png new file mode 100644 index 00000000..fb90d6eb Binary files /dev/null and b/fern/static/images/workflows/workflows-tools-node.png differ diff --git a/fern/static/images/workflows/workflows-transfer-call-node.png b/fern/static/images/workflows/workflows-transfer-call-node.png new file mode 100644 index 00000000..c5189206 Binary files /dev/null and b/fern/static/images/workflows/workflows-transfer-call-node.png differ diff --git a/fern/static/images/workflows/workflows-transfer-node.png b/fern/static/images/workflows/workflows-transfer-node.png new file mode 100644 index 00000000..5c6c6558 Binary files /dev/null and b/fern/static/images/workflows/workflows-transfer-node.png differ diff --git a/fern/workflows/overview.mdx b/fern/workflows/overview.mdx index 002f6de0..4cdcfe67 100644 --- a/fern/workflows/overview.mdx +++ b/fern/workflows/overview.mdx @@ -1,95 +1,134 @@ --- title: Workflows overview -subtitle: Learn about Vapi's visual builder for creating robust, deterministic conversation flows. -slug: workflows/overview -description: Learn about Vapi's visual builder for creating robust, deterministic conversation flows. +subtitle: Learn to create robust, deterministic conversation flows with a visual builder. --- ## Introduction Workflows is a visual builder designed for creating robust, deterministic conversation flows. It empowers developers and low-code builders to design agents through an intuitive interface representing interactions via nodes and edges. -## Key benefits + + Vapi Workflows + -* **Visual conversation builder** - Easily prototype and demonstrate conversation flows visually -* **Complex flow management** - Ideal for scenarios with numerous interaction paths, such as call centers, customer support, appointment scheduling, and onboarding processes -* **Reliable determinism** - Offers stronger control compared to single-prompt Assistants, ensuring predictable conversational paths even in highly complex flows -* **Developer-focused flexibility** - Fully configurable via API, enabling selection of models, transcribers, and voices available throughout the Vapi platform +## Key Benefits -## Common use patterns +- **Visual Conversation Builder:** Easily prototype and demonstrate conversation flows visually. +- **Complex Flow Management:** Ideal for scenarios with numerous interaction paths, such as call centers, customer support, appointment scheduling, and onboarding processes. +- **Reliable Determinism:** Offers stronger control compared to single-prompt Assistants, ensuring predictable conversational paths even in highly complex flows. +- **Developer-Focused Flexibility:** Fully configurable via API, enabling selection of models, transcribers, and voices available throughout the Vapi platform. +- **Multilingual Support:** Seamlessly build multilingual conversation flows with language-specific nodes and prompts. -* **User intent manager** - Route user interactions based on specific intents -* **Human escalation paths** - Allow users to transfer to human agents at any workflow stage -* **Customer-specific flows** - Differentiate workflows based on user profiles, such as new versus existing customers +## Common Use Patterns -## Workflows structure +- **User Intent Manager:** Route user interactions based on specific intents. +- **Human Escalation Paths:** Allow users to transfer to human agents at any workflow stage. +- **Multilingual Flows:** Create dedicated conversation branches for different languages. +- **Customer-Specific Flows:** Differentiate workflows based on user profiles, such as new versus existing customers. -Workflows consist of nodes and edges. There are multiple types of nodes and a Workflow must have a start node, which is the main entry point for the conversation flow. +## Workflow structure -By default a Conversation Node is the start node, but it can be changed to a different type of node. Start nodes cannot be deleted and a Workflow must have exactly one. +Workflows consists of node and edges. There are multiple types of nodes and a Workflow must have a start node, which is the main entry point for the conversation flow. ---- +By default a Conversation Node is the start node, but it can be changed to a different type of note. Start nodes cannot be deleted and a Workflow must have exactly one. -## Node types +## Node Types and Configuration -### Conversation Node +## Conversation Node The Conversation Node is the default type of node. It's highly configurable and it's the main building block for conversation flows. -#### Configuration options + + Create workflow interface + + + +### Configuration options + +#### First Message + +Specify the initial spoken message when entering the node. This configuration is helpful if developers want the agent to speak first without waiting for user to say something. + +#### Prompt + +Provide detailed instructions guiding agent responses and conversation direction, including response style and content. + +The prompt is the most important part of the Conversation Node. Building reliable and high-quality voice agents heavily depend on the quality of the prompt supplied. + +#### Global Node + +Allows routing to this node from any point in the workflow, commonly used for escalation purposes e.g. when user wants to jump from the pre-determined conversation flow to speaking to a human to address specific needs. This feature can be enabled via the Global toggle; developers must specify an Enter Condition that defines the condition for routing to the Global Node. -* **First Message** - Specify the initial spoken message when entering the node -* **Prompt** - Provide detailed instructions guiding agent responses and conversation direction -* **Global Node** - Allows routing to this node from any point in the workflow -* **Model/Voice/Transcriber Settings** - Individually configure AI model, voice, and transcription services per node -* **Extract Variables** - Gather variables from conversation using liquid syntax `{{ variable_name }}` +#### Model/Voice/Transcriber Settings -#### Variable extraction +Individually configure the AI model, voice, and transcription services per node. This is similar to configuring Single Prompt Assistants. + +#### Extract Variables + +Extract Variables lets users gather/extract variables from a conversation. These variables can be used as dynamic variables for the rest of the workflow via liquid syntax `{{ variable_name }}`. Variables can be configured by: -* Defining variable name and data type (String, Number, Boolean, Integer) -* Writing a clear extraction prompt describing what data to extract -* Setting enums for String-type variables to constrain values to a specific set -### API Request Node +- Defining variable name and data type (String, Number, Boolean, Integer) +- Writing a clear extraction prompt (a description of the variable to help determine how/what data to extract) +- Setting enums for String-type variables to constrain values (to map to a specific set) + + + Create workflow interface + -The API Request Node allows developers to make HTTP requests to their API, custom endpoints, or automation services like Make, n8n, or Zapier. +## API Request Node -* Configure GET and POST requests -* Request bodies must be formatted in [JSON Schema](https://json-schema.org/) -* Body UI builder automatically handles JSON Schema formatting +The API Request Node allows developers to make HTTP Requests to their API, custom endpoints, or automation services like Make, n8n, or Zapier. Developers can configure it to perform GET and POST requests. Request bodies must be formatted in [JSON Schema](https://json-schema.org/) (the body UI builder automatically does this). -### Transfer Call Node + + Create workflow interface + + +## Transfer Call Node Transfer calls to another phone number, including human agents or specialized voice agents. -* Specify a phone number destination -* Configure a [transfer plan](/call-forwarding#call-transfers-mode) to provide context to the receiving party -* Include a message or summary of the call before connecting +Developers can specify a phone number destination and a [transfer plan](https://docs.vapi.ai/call-forwarding#call-transfers-mode), which lets them specify a message or a summary of the call to the person or agent picking up in the destination number before actually connecting the call. + + + Create workflow interface + -### End Call Node +## End Call Node Terminal node to end calls explicitly. Configure with an optional closing message (via the first message field) to users before termination. + + Create workflow interface + + Workflows without a defined End Call Node risk unintended minutes usage. Ensure all workflows have clear termination points to ensure the call eventually ends. -### Tool Node +## Tool Node -Integrate existing Tools library functionalities. Select tools previously created for use within Workflows, maintaining consistency with Assistant configurations. +Integrate existing Tools library functionalities. Select tools previously created for use within Workflows, maintaining consistency with Assistant configurations. ---- + + Create workflow interface + + +## Edges -## Edges and conditions +A node is connected to another node via an edge. Developers can specify a condition (within the edge) that must be true (satisfied) for the conversation to flow from one node to the next. + + + Create workflow interface + -A node is connected to another node via an edge. Developers can specify a condition (within the edge) that must be true for the conversation to flow from one node to the next. ### Types of conditions **AI-based conditions** - Written in plain language and evaluated by LLMs: ```txt -User wants to talk about voice agents +User wanted to talk about voice agents ``` **Logical conditions** - For precise control using variables: @@ -105,11 +144,12 @@ User wants to talk about voice agents ### Best practices for conditions * Use descriptive, natural language for AI-based conditions +* Format conditions as: "User [verb] [rest of condition]" * Extract variables as enums to enable reliable branching * Test all conditional paths thoroughly * Keep conditions simple and specific ---- +A useful combination of features is to extract variables as enums and use them to branch conversation flows based on a specific set of tasks that the agent can help users with. ## Best practices @@ -140,4 +180,4 @@ Ready to start building? Check out these resources: * [**Workflows quickstart**](/workflows/quickstart) - Build your first workflow step-by-step * [**Workflow examples**](/workflows/examples) - Explore pre-built workflows for common use cases * [**Custom Tools**](/tools/custom-tools) - Integrate external APIs and services into your workflows -* [**Dynamic Variables**](/assistants/dynamic-variables) - Advanced variable usage and personalization techniques +* [**Dynamic Variables**](/assistants/dynamic-variables) - Advanced variable usage and personalization techniques \ No newline at end of file