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

# Call Flows

> Build complex conversations, connect with your tools and more with flows

Flows are the visual blueprints that define exactly how your AI phone agent behaves, from the greeting, to data collection, to decisions, actions, and the final call outcome. They describe what the agent says, what it asks, what it stores, what APIs it calls, and how the conversation moves forward.

<Frame>
  <img src="https://mintcdn.com/phonely/P3K7fZNCkRngwBaq/assets/call-flow.gif?s=adae844724813a07c3843d1d59cb77a7" alt="Flow builder in action" width="960" height="540" data-path="assets/call-flow.gif" />
</Frame>

Flows are made of several core elements:

### 1. Blocks

Blocks are the individual steps in your workflow. Each block performs one clear function, such as:

* Speaking to the caller (Talk)
* Collecting information (Collect).
* Applying logic or conditions (Filter, Time Filter)
* Calling an external system (API Request, Google Sheets, Code)
* Transferring or ending a call (Transfer Flow, End Call)
* Sending messages (Email, SMS)
* Running post-call actions.

Blocks are intentionally focused complex behavior is created by connecting blocks together, not by overloading a single block.

### 2. Connections & Exit  Conditions

Connections determine how the conversation moves forward.

An edge can represent:

* A simple continuation (always go next)
* A conditional path (only proceed if a condition is met)
* An exit outcome (success, failure, escalation, etc)

#### Exit condition tooltips

When you hover over a connection handle or edge, Phonely now displays a tooltip explaining which condition is applied, why the edge exists or what will cause the call to take that path.

<Frame>
  <img src="https://mintcdn.com/phonely/Uef2tIM2gQ6eJm8s/assets/edge-tool-tip-message.png?fit=max&auto=format&n=Uef2tIM2gQ6eJm8s&q=85&s=99f85abcc4b0e0243fea1d1d51f5a723" alt="Edge Tool Tip Message" style={{ width:"79%" }} width="2612" height="1088" data-path="assets/edge-tool-tip-message.png" />
</Frame>

This makes large or complex flows easier to understand and debug at a glance.

### 3. Variables

Variables store information during the call, such as:

* Caller-provided inputs.
* API responses.
* System-generated data (timestamp, outcomes, etc.)

<Frame>
  <img src="https://mintcdn.com/phonely/jyis0VoDpcYYC93-/assets/list-of-available-variables.png?fit=max&auto=format&n=jyis0VoDpcYYC93-&q=85&s=00d1dd56d446dbfc3779c00d4308e388" alt="List Of Available Variables" title="List Of Available Variables" style={{ width:"65%" }} width="1492" height="1072" data-path="assets/list-of-available-variables.png" />
</Frame>

They act as the agent’s short-term working memory for the duration of the call.

## Canvas Controls

Phonely includes several canvas tools to help you navigate and organize large workflows.

You'll find tools for:

* Add new blocks
* Using sticky notes
* Organizing blocks
* Replacing invalid variables
* Undo/Redo actions
* Viewing your change history

See the dedicated [toolbar quick actions guide](/key-concepts/flow-canvas-controls) for more details.

## Create a Flow

<Steps>
  <Step title="Go to the agent design page." />

  <Step title="Click the + to create a new workflow or select an existing workflow and click the Edit button." />

  <Step title="Click the “+” button between existing blocks or at the end of a chain to insert a new block." />

  <Step title="New blocks are auto-positioned to keep the layout readable.">
    The canvas is where you visually design and manage your workflow.

    <Frame>
      <img src="https://mintcdn.com/phonely/92-YWjeCySzQC5rN/assets/how-to-add-a-new-block.png?fit=max&auto=format&n=92-YWjeCySzQC5rN&q=85&s=622135db5e28751756c0b2019c4bb62c" alt="How To Add A New Block" title="How To Add A New Block" style={{ width:"65%" }} width="1832" height="1972" data-path="assets/how-to-add-a-new-block.png" />
    </Frame>
  </Step>

  <Step title="Click any block in your flow to open its configuration panel. ">
    Each block contains different settings, and the options you see will depend on the type of block you’re setting up.

    <Frame>
      <img src="https://mintcdn.com/phonely/92-YWjeCySzQC5rN/assets/example-configuring-a-collect-block.png?fit=max&auto=format&n=92-YWjeCySzQC5rN&q=85&s=9d936121dc0322b1aa178103586a93db" alt="Example Configuring A Collect Block" title="Example Configuring A Collect Block" style={{ width:"87%" }} width="2396" height="1616" data-path="assets/example-configuring-a-collect-block.png" />
    </Frame>
  </Step>

  <Step title="Connect blocks">
    You can change connections between blocks by hovering over an edge clicking the **X** button, and then place your cursor over the output node of one block and drag the edge to connect to the input node of another block.
  </Step>

  <Step title="Save your changes.">
    Every save creates a new version you can review or revert.
  </Step>

  <Step title="Publish when ready.">
    Publishing makes the version live for real callers.
  </Step>
</Steps>

### Copy & Paste Across Tabs

You can now select one or multiple blocks. Copy them and then paste them into another open Phonely tab. This allows you to reuse logic across flows and build variations without starting from scratch.

<Frame>
  <img src="https://mintcdn.com/phonely/aPBxVliDS8PgNSzR/assets/selecting-blocks-copy-paste.png?fit=max&auto=format&n=aPBxVliDS8PgNSzR&q=85&s=50264d00927b22ea7182ed774d98f990" alt="Selecting Blocks Copy Paste" title="Selecting Blocks Copy Paste" style={{ width:"94%" }} width="2320" height="1324" data-path="assets/selecting-blocks-copy-paste.png" />
</Frame>

### Save, Version, and Publish

Every save creates a new **version**. Versions can be reviewed or reverted.

When publishing, review the version details and confirm the version you want to make live for callers.

### Call variables

<AccordionGroup>
  <Accordion title="What are call variables?">
    Variables are dynamic containers that persist for the duration of the call - like the agent's working memory.
  </Accordion>

  <Accordion title="How to set variables">
    Use Collect blocks for caller input, API Request blocks for external data, or add custom variables via the Variable modal.
  </Accordion>

  <Accordion title="How to access variables">
    Reference by name with @variable\_name or select from the Variable modal. Use them in prompts, conditions, and API payloads.
  </Accordion>
</AccordionGroup>

### Variable types

Variables in Phonely can store different types of data. Choose the appropriate type when collecting information from callers or storing data from API responses.

| Type           | Data Type  | Description                                |
| :------------- | :--------- | :----------------------------------------- |
| **text**       | `string`   | General text                               |
| **number**     | `number`   | Numeric values                             |
| **date**       | `ISO date` | Dates in ISO format                        |
| **time**       | `HH:mm`    | Times in 24-hour format                    |
| **name**       | `string`   | Caller names                               |
| **email**      | `string`   | Email addresses                            |
| **phone**      | `string`   | Phone numbers                              |
| **url**        | `string`   | Web addresses                              |
| **address**    | `object`   | Street, city, region, postal code, country |
| **currency**   | `number`   | Monetary values                            |
| **percentage** | `number`   | Percent values                             |
| **duration**   | `string`   | Time spans                                 |
| **custom**     | `any`      | User-defined schema                        |

### Call outcome tagging

<Info>
  Outcome tags enable analytics, reporting, and automations after the call ends.
</Info>

Call outcomes are configured at the **block level**. Each block in your workflow can have an outcome tag assigned to it. When a call ends on that block, the call is tagged with that block's outcome.

If the block where the call ends does not have an outcome tag set, Phonely falls back to the **last block the call visited** that had an outcome defined.

This means you only need to tag the blocks that represent meaningful endpoints or milestones in your flow, you don't need to tag every block.

<Steps>
  <Step title="Open any block in your workflow" />

  <Step title="Find the Call Outcome Tagging field in the block settings" />

  <Step title="Select an existing outcome or type a custom one" />
</Steps>

<img src="https://mintcdn.com/phonely/J2LKh_EYahA12J9K/assets/outcome-tagging-end-block.png?fit=max&auto=format&n=J2LKh_EYahA12J9K&q=85&s=3f5c3b7c93e29073d576e2cc1da2d9dc" alt="Outcome Tagging End Block" title="Outcome Tagging End Block" style={{ width:"89%" }} width="1480" height="612" data-path="assets/outcome-tagging-end-block.png" />

<Tip>
  Some examples of tags that you can use include: **appointment scheduled**, **lead qualified,** **customer satisfied, escalation needed, no show followup**, etc.
</Tip>

<Frame>
  <img src="https://mintcdn.com/phonely/RfQ0u5YpsXoCeebJ/assets/run-test-from-here.gif?s=27d7dca64e9bc6fd2dc5990b2b77a3c8" alt="Test from here feature" width="960" height="540" data-path="assets/run-test-from-here.gif" />
</Frame>

## Testing & best practices

<Tabs>
  <Tab title="Simulation">
    <Steps>
      <Step title="Upload a recording">
        Validate recognition and branch logic with real audio.
      </Step>

      <Step title="Simulate variables">
        Seed test values for `@name`, `@phone`, etc.
      </Step>

      <Step title="Path testing">
        Walk each branch and confirm expected prompts.
      </Step>

      <Step title="Error testing">
        Force empty/malformed inputs to validate fallbacks.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Live">
    <Steps>
      <Step title="Use test numbers">
        Route calls to non-production DIDs.
      </Step>

      <Step title="Monitor in real time">
        Watch transcripts and events in the dashboard.
      </Step>

      <Step title="Measure performance">
        Track response times, success rates, transfers.
      </Step>

      <Step title="A/B versions">
        Compare alternative prompts/flows.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Design guidelines

<AccordionGroup>
  <Accordion title="Conversation design">
    Keep prompts natural and concise, offer clear next steps, plan for interruptions, and confirm critical data before proceeding. 
  </Accordion>

  <Accordion title="Technical hygiene">
    Test all branches, add fallback edges, watch performance metrics, and keep external dependencies resilient.
  </Accordion>

  <Accordion title="Variable management">
    Use descriptive names, validate inputs, handle missing data gracefully, and scrub sensitive data when not needed.
  </Accordion>
</AccordionGroup>

## Troubleshooting guide

<AccordionGroup>
  <Accordion title="Flow not responding">
    Verify block connections, confirm required variables are set, test blocks individually, and check API auth/endpoints.
  </Accordion>

  <Accordion title="Poor call quality">
    Review Talk block voice settings, try alternate voices, adjust rate and pauses, and check variable interpolation.
  </Accordion>

  <Accordion title="Transfer failures">
    Confirm destination numbers/agents, test fallbacks, and verify timing and availability windows.
  </Accordion>

  <Accordion title="Variable issues">
    Check spelling/case, ensure values are set before use, validate data types, and test prompts using variables.
  </Accordion>

  <Accordion title="API integration problems">
    Test endpoints in isolation, verify credentials and headers, confirm request/response schemas, and watch rate limits/timeouts.
  </Accordion>
</AccordionGroup>

## Conclusion

You now have the essentials to design reliable, natural AI phone experiences:

<Steps>
  <Step title="Start simple">
    Build with Start Call, Talk, and End Call
  </Step>

  <Step title="Add interaction">
    Use Collect and Question blocks.
  </Step>

  <Step title="Integrate systems">
    Add API Request and conditional edges.
  </Step>

  <Step title="Optimize">
    Use Filter and Time Filter to route intelligently.
  </Step>

  <Step title="Test thoroughly">
    Apply simulation and live testing practices above.
  </Step>
</Steps>
