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

# Agent workflow

> Configure the full call lifecycle: knowledge, pre-call and post-call integrations, extraction, and webhooks.

Open an agent and select **Workflow**. This canvas is the call lifecycle around the prompt or conversation flow. It is labeled **Agent workflow**.

Use **Agent** to edit instructions or the visual flow. Use **Workflow** to attach what happens before, during, and after the call.

## Lifecycle

The canvas always shows this order:

1. **Call incoming / outgoing**
2. **Pre-call integrations** — prepare context before the conversation.
3. **Call started**
4. **Knowledge bases** — give the agent knowledge to answer questions.
5. **Agent** — in-call integrations and system tools.
6. **Call ended**
7. **Data extraction** — extract structured data from the conversation.
8. **Post-call integrations** — send results to connected services.

Dotted nodes sit beside that path:

| Node | Purpose |
| - | - |
| **Transfer/Transcript** | Fires on transfer started, transfer failed, and transcript updated. |
| **Recording ready** | Fires when the recording is available. |
| **Extraction done** | Fires after post-call extraction finishes. |
| **Webhooks** | POST selected call events to your HTTPS endpoints. |

## Attach knowledge bases

The **Knowledge bases** card lists collections on this agent.

<Steps>
  <Step title="Create a ready collection">
    In **Knowledge Base**, add sources and wait until the collection status is **Ready**. An agent can only use a ready knowledge base.
  </Step>

  <Step title="Attach">
    On **Workflow**, select **Attach**. You can attach up to three knowledge bases per agent.
  </Step>

  <Step title="Add another">
    Select **Attach another** until you reach three. **Attach another** is disabled at the limit.
  </Step>
</Steps>

Dimmed collections are still processing, empty, or failed. See [Knowledge bases](/build/knowledge-base).

## Pre-call integrations

**Pre-call integrations** run before the agent speaks. Use them to look up the caller, load account context, or reject work you should not take.

Select **Add integration**. HTTP functions and pre-call APIs can run with execution timing **before the call**. Keep tokens in [secrets](/accounts/secrets).

Empty state: **No integrations added**.

## In-call configuration

Select **Open** on the **Agent** card to return to the builder, or configure tools on the card.

| Tab | What it holds |
| - | - |
| **In-call integrations** | Connected services during the conversation (calendar, CRM, Slack, HTTP with during-call timing, and similar). Copy: **Use connected services during the conversation.** |
| **In-call system tools** | Built-in actions such as end call, transfer, extract, capture input, and custom functions. |

Disabled tools show **Disabled**. Edit or remove a row from the card. See [Actions and tools](/build/actions).

## Data extraction

**Data extraction** stores structured fields after the call. This is separate from an **Extract** node inside a conversation flow.

<Steps>
  <Step title="Add extraction">
    Select **Add extraction**.
  </Step>

  <Step title="Choose the event">
    **On call ended** or **On call transferred**.
  </Step>

  <Step title="Define the fields">
    Name each field and describe what to capture. These values can feed post-call integrations and [event-to-call workflows](/deploy/workflows).
  </Step>
</Steps>

Empty state: **No extraction rules configured**.

## Webhooks

**Webhooks** send call events to your endpoints. Select **Add webhook**.

| Field | Rule |
| - | - |
| Name | Shown in the subscriptions list. |
| Callback URL | HTTPS POST only. |
| Events | Select at least one event. |

Event groups:

| Group | Events |
| - | - |
| **Call lifecycle** | Call started, Call completed |
| **Real-time events** | Transcript updated, Transfer started, Transfer failed |
| **Processing** | Recording ready, Analysis done |

Headers can be a literal (**Const**), a variable, or a secret. Do not generate header values with the model.

Use **Send test event** to verify delivery before you publish.

Empty state: **No webhooks configured**.

## Post-call integrations

**Post-call integrations** run after **Call ended**. Use them to write the outcome to a CRM, notify Slack, or call your own HTTP endpoint.

Select **Add integration** and set execution timing to after the call.

## Save and publish

Workflow changes save with the agent draft. Wait for pending saves, preview, then **Publish**. A superseded version is read-only on this canvas.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.