Skip to content

Add AI Condition page and more details on Logic Condition #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,18 @@ navigation:
path: workflows/nodes/gather.mdx
- page: API Request
path: workflows/nodes/api-request.mdx
- page: Assistant
path: workflows/nodes/assistant.mdx
- page: Transfer
path: workflows/nodes/transfer.mdx
- page: Hangup
path: workflows/nodes/hangup.mdx

- section: Edges
contents:
- page: Logical Conditions
path: workflows/edges/logical-conditions.mdx

- page: AI Conditions
path: workflows/edges/ai-conditions.mdx
- section: Squads
path: squads.mdx
contents:
Expand Down
Binary file added fern/static/images/workflows/logic-condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 14 additions & 17 deletions fern/workflows/edges/ai-conditions.mdx
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
---
title: AI Conditions
subtitle: Dynamic AI-driven branching in workflows
subtitle: Smart workflow branching powered by AI
slug: /workflows/edges/ai-conditions
---

## Overview

The **AI Conditions** feature leverages artificial intelligence to determine the next step in your workflow based on conversation context. Unlike traditional logical conditions—which rely on explicit rules—AI Conditions allow your voice agent to evaluate complex or ambiguous scenarios, making branching decisions dynamically.
AI Conditions use artificial intelligence to decide the next step in your workflow based on the conversation. Instead of using fixed rules, they can understand complex situations and make smart decisions in real-time.

## How It Works

- **Contextual Evaluation:** The AI considers data from previous steps (e.g., user input, API responses) to gauge the conversation context.
- **Adaptive Decision-Making:** It uses its judgment to choose the most appropriate branch without relying solely on fixed comparisons.
- **Seamless Integration:** AI Conditions can complement existing logical conditions, offering a balance between predictable rules and adaptive behavior.
1. The AI looks at the conversation history and context
2. It makes a smart decision about which path to take, based on variables collected from Gather verbs and data returned from API requests.
3. Works alongside your existing rules for maximum flexibility

## Configuration

- **Activation:** Enable AI Conditions on a condition node where you want the AI to drive the branching logic.
- **Context Input:** The AI will utilize variables collected from Gather verbs and data returned from API requests.
- **Decision Logic:** No manual rules are required—the AI interprets context in real time to select the optimal branch.
- **Fallback:** You can combine AI Conditions with traditional logical conditions for added control.
## Configuration
- **Condition Node:** Start by inserting a condition node into your workflow.
- **Branch Setup:** Attach one or more nodes to the condition node.
- **AI Tag:** Click on the connecting edge and choose `AI` from the `Condition Type` dropdown
- **AI Condition** Use the input to define when the chosen branch should be taken.

## Usage

Deploy AI Conditions when your workflow requires flexibility and context-sensitive decision-making, such as:

- Handling ambiguous or multi-faceted user responses.
- Addressing scenarios where strict rules may not capture the conversation's nuances.
- Enhancing the user experience by providing more natural, human-like interactions.

For detailed configuration instructions and best practices, please refer to our dedicated documentation on AI-driven workflows.
Use AI Conditions when you need:
- To handle unclear or complex user responses
- More flexibility than traditional rules can provide
- More natural, human-like conversations
16 changes: 14 additions & 2 deletions fern/workflows/edges/logical-conditions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@ Logical Conditions enable you to create branching paths within your workflow. Th

- **Condition Node:** Start by inserting a condition node into your workflow.
- **Branch Setup:** Attach one or more nodes to the condition node.
- **Logic Tag:** Click the "Logic" tag on each connecting edge to define rules or comparisons (e.g., equals, greater than) using variables collected from previous steps.
- **Logic Tag:** Click the "Logic" tag on each connecting edge and select `Logic` from the `Condition Type` dropdown.
- **Condition Type:** Choose between requiring ALL conditions to be met (AND logic) or ANY condition to be met (OR logic)
- **Logic Conditions** Use the panel to define one or more rules or comparisons (e.g., equals, greater than) using variables collected from previous steps.

<Note>
To remove a comparison, click on the Trash icon to the right of the comparison.
</Note>

<Frame>
<img src="../../static/images/workflows/logic-condition.png" />
</Frame>

## Usage

Implement Logical Conditions to guide your conversation dynamically. They allow your workflow to adjust its path based on real-time data, ensuring more personalized and responsive interactions.

For detailed configuration instructions and advanced usage, please refer to our dedicated documentation on condition configuration.
<Note>
When [`Gathering`](/workflows/nodes/gather) string values that will be used in conditions, consider using `enum` types to ensure consistent value comparison. This helps prevent issues with case sensitivity, whitespace, or formatting differences that could affect condition evaluation.
</Note>
23 changes: 23 additions & 0 deletions fern/workflows/nodes/assistant.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Assistant
subtitle: Speak to a configured assistant
slug: /workflows/nodes/assistant
---

## Overview

The **Assistant** node enables a persistent conversation with one of your configured assistants.

## Configuration

- **Select an Assistant** Use the dropdown to select a pre-configured assistant.

## Usage

Add **Assistant** nodes as leaf nodes to enable ongoing conversations with your configured assistants. Currently, Assistant nodes must be placed at the end of a workflow branch, as they don't support transitioning to other nodes. This means the conversation with the assistant will continue until either the user ends the call or the assistant reaches a natural conclusion point.

The assistant will use its configured system prompt while inheriting the transcriber and voice settings from the global workflow assistant.

<Note>
Assistant nodes are currently designed as terminal nodes - they cannot be connected to other nodes in the workflow. This means the conversation will remain with the assistant until the call ends. Future updates will add support for AI-powered conditional branching.
</Note>
4 changes: 3 additions & 1 deletion fern/workflows/nodes/gather.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ Define one or more variables to gather from the user with:

Use **Gather** to extract specific details from user responses—such as their name, email, or ZIP code—to inform subsequent steps in your conversation. The Gather node doesn't directly prompt users; instead, it analyzes the conversation history to find the requested information and will ask follow-up questions if the user's response isn't clear. Make sure to precede it with a [`Say`](/workflows/nodes/say) node that explicitly prompts the user for the information you want to gather.

To use an extracted string variable in a [`Conditional`](/workflows/edges/logical-conditions) branch, we recommend using the `enum` option. This ensures the extracted value will reliably match your conditions later in the workflow.
<Note>
To use an extracted string variable in a [`Conditional`](/workflows/edges/logical-conditions) branch, we recommend using the `enum` option. This ensures the extracted value will reliably match your conditions later in the workflow.
</Note>
Loading