> ## Documentation Index
> Fetch the complete documentation index at: https://docs.callem.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> Design multi-step conversation flows with a visual node editor.

# Workflows

Workflows let you design structured, multi-step conversation flows using a visual node editor. Unlike single-prompt agents, workflows give you fine-grained control over the conversation path — including branching, conditions, and step-by-step data collection.

## When to Use Workflows

| Scenario                                         | Agent Type          |
| ------------------------------------------------ | ------------------- |
| Simple Q\&A, open-ended conversations            | Single-prompt agent |
| Structured scripts, surveys, qualification flows | **Workflow agent**  |
| Conditional logic, multi-path routing            | **Workflow agent**  |
| Data collection with validation at each step     | **Workflow agent**  |

Use workflows when you need predictable, repeatable conversation paths. For flexible, open-ended interactions, a single-prompt agent with a knowledge base is usually sufficient.

## Workflow Editor

The visual editor lets you build workflows by connecting **nodes** on a canvas. Each node represents a step in the conversation, and edges define the flow between steps.

### Node Types

| Node             | Description                                    | Key Settings                                     |
| ---------------- | ---------------------------------------------- | ------------------------------------------------ |
| **Start**        | Entry point of every workflow                  | Welcome message, language, background sound      |
| **Conversation** | The agent speaks and/or listens                | Step prompt, expected responses, data extraction |
| **Condition**    | Branch based on caller input or collected data | Conditions, comparison operators                 |
| **Transfer**     | Hand off the call to a human or another number | Transfer target, transfer message                |
| **End**          | Terminate the call                             | Closing message                                  |

***

## Start Node Properties

The Start node configures the initial behavior of every call in the workflow:

### General

| Setting             | Description                                                                     |
| ------------------- | ------------------------------------------------------------------------------- |
| **Welcome message** | The first thing the agent says when the call begins                             |
| **Global prompt**   | Instructions shared across all workflow states (tone, personality, constraints) |

### Text-to-Speech (TTS)

The Start node includes a full TTS configuration:

| Setting            | Description                                                                                                                                                            |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Voice**          | Select a voice from the voice library (browse by language, gender, provider)                                                                                           |
| **Voice Settings** | Provider-specific settings that appear dynamically based on the selected voice. Can include model selection (dropdown), speed, and other provider-specific parameters. |

<Tip>
  The TTS voice configured in the Start node applies to the entire workflow. All conversation steps will use this voice.
</Tip>

### Background Sound

Add ambient audio to create a more natural call experience:

| Setting     | Description                                                                       | Default |
| ----------- | --------------------------------------------------------------------------------- | ------- |
| **Enabled** | Toggle background sound on/off                                                    | Off     |
| **Sound**   | Choose from a library of pre-configured ambient sounds (e.g. office, call center) | —       |
| **Volume**  | Adjust the volume level (0–100%)                                                  | `50%`   |

***

## Conversation Node

Each Conversation node represents one step where the agent speaks and optionally collects information:

* **Step prompt**: what the agent should say and how to respond to the caller
* **Data extraction**: variables to extract from the caller's response
* **Validation**: conditions that must be met before moving to the next step

## Condition Node

Condition nodes enable branching logic:

* Evaluate variables collected in previous steps
* Compare values (equals, contains, greater than, etc.)
* Route to different paths based on the result

**Example**: After collecting the caller's interest level:

* If `interest = high` → route to appointment booking
* If `interest = low` → route to email follow-up
* Otherwise → route to general information

## Transfer Node

Transfer the call to a human agent or external number:

* **Transfer target**: phone number or SIP address
* **Transfer message**: what the agent says before transferring (e.g. "I'm connecting you with a specialist now")

## End Node

Terminate the call gracefully:

* **Closing message**: optional farewell message (e.g. "Thank you for calling. Have a great day!")

***

## Building a Workflow

<Steps>
  <Step title="Create a workflow agent">
    Navigate to Build > Agents, click **New Workflow Agent**, and name it.
  </Step>

  <Step title="Configure the Start node">
    Set the welcome message, language, background sound, and TTS settings.
  </Step>

  <Step title="Add conversation steps">
    Drag Conversation nodes onto the canvas. Define what the agent should say and what information to collect at each step.
  </Step>

  <Step title="Add branching logic">
    Use Condition nodes to route the call based on collected data. Connect the condition outputs to different Conversation, Transfer, or End nodes.
  </Step>

  <Step title="Connect nodes">
    Draw edges between nodes to define the flow. Every path must eventually reach an End or Transfer node.
  </Step>

  <Step title="Save and test">
    Click Save to persist the workflow. Test by calling the assigned phone number or using the built-in chat.
  </Step>
</Steps>

## Global Prompt

Workflow agents have a **Global Prompt** (instead of a System Prompt). This prompt applies to all steps in the workflow and defines the agent's overall behavior, tone, and constraints. Individual step prompts complement the global prompt with step-specific instructions.

<Tip>
  Use the global prompt for personality, tone, and rules that apply everywhere. Use step prompts for step-specific instructions like "Ask for the caller's name" or "Confirm the appointment details."
</Tip>

## Best Practices

<AccordionGroup>
  <Accordion title="Keep workflows linear when possible">
    Complex branching is powerful but harder to debug. Start with a linear flow (Start → Step 1 → Step 2 → End) and add branches only where the conversation genuinely needs to diverge.
  </Accordion>

  <Accordion title="Test every path">
    Make test calls that exercise each branch. Untested paths are where bugs hide. Pay special attention to edge cases and fallback routes.
  </Accordion>

  <Accordion title="Use clear node names">
    Name your nodes descriptively (e.g. "Collect Name", "Qualify Interest", "Book Appointment") so the workflow is readable at a glance.
  </Accordion>

  <Accordion title="Always have a fallback">
    Add a catch-all path from condition nodes that handles unexpected responses. Don't leave the caller in a dead-end.
  </Accordion>

  <Accordion title="Keep steps short">
    Each conversation step should have one clear goal (ask one question, confirm one piece of information). Long, multi-part steps confuse both the LLM and the caller.
  </Accordion>
</AccordionGroup>
