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

# Pre Call, Post Call, and Ongoing Conversation triggers

> Workflows that run from inside an agent's conversation lifecycle.

Anyreach agents can trigger workflows at three points in a conversation's lifecycle: **before** a call begins, **after** a call ends, and **during** an active conversation.

## Overview

| Trigger                  | When it fires          | Execution mode | Use for                                                              |
| ------------------------ | ---------------------- | -------------- | -------------------------------------------------------------------- |
| **Pre Call**             | Before the call begins | Sync           | Fetch caller context, decide whether to dial, set greeting variables |
| **Post Call**            | After the call ends    | Async          | Summaries, CRM writes, notifications, follow-up scheduling           |
| **Ongoing Conversation** | During an active call  | Sync           | Real-time look-ups, mid-call actions, tool invocations by the agent  |

## Pre Call trigger

Runs once before the call connects. For outbound calls, this fires before dialing. For inbound calls, it fires between the incoming ring and the agent picking up.

### Use cases

* Look up the caller in your CRM and inject context into the agent's system prompt
* Check a do-not-call list and skip the call if the contact is on it
* Set greeting variables (e.g., the contact's first name) that the agent uses in its opening

### What's in ctx

```json theme={null}
{
  "trigger": {
    "type": "pre_call",
    "conversation_id": "conv_...",
    "agent_id": "agent_...",
    "phone_number": "+15551234567",
    "direction": "outbound"
  }
}
```

### Latency consideration

The call is waiting. Pre Call workflows should complete in under 5 seconds — longer delays cause the caller to hear silence before the agent speaks.

## Post Call trigger

Runs once after the call ends. The conversation transcript and metadata are available.

### Use cases

* Summarize the conversation using an AI expression
* Write a CRM activity (HubSpot, Salesforce)
* Send a Slack notification with call summary and duration
* Score the call and route to the right team
* Schedule a follow-up callback or email

### What's in ctx

```json theme={null}
{
  "trigger": {
    "type": "post_call",
    "conversation_id": "conv_...",
    "agent_id": "agent_...",
    "phone_number": "+15551234567",
    "direction": "outbound",
    "duration_seconds": 247,
    "status": "completed",
    "transcript": "Agent: Hello, this is... User: Hi, I'd like to..."
  }
}
```

<Note>
  The Post Call trigger inspector shows a **Custom Metadata** section. Click **+ Add Custom Metadata** to attach additional key-value data to the trigger for use in downstream steps.
</Note>

### Latency consideration

Post Call runs asynchronously — the call has already ended. You can use Wait steps and long-running operations freely.

## Ongoing Conversation trigger

Fires during an active conversation, typically when the agent's LLM decides to invoke a workflow as a tool. The agent can look up data, place orders, update records, or take other actions mid-call.

<Frame>
  <img src="https://mintcdn.com/anyreach/H7de0CJCTkbxSIQS/images/workflows/trigger-ongoing-conversation.png?fit=max&auto=format&n=H7de0CJCTkbxSIQS&q=85&s=d3520af20863c66031e3d5f4cd1fe573" alt="Post Call trigger configured in inspector" width="3108" height="1940" data-path="images/workflows/trigger-ongoing-conversation.png" />
</Frame>

* The **Arguments** section in the inspector specifies which input values the Conversational Agent must provide when invoking the workflow. Define these fields to ensure the agent supplies all necessary data for the workflow to execute properly.
* The **Custom Metadata** section in the inspector can be confiugred to accept any additional data from the conversational agent.

### Use cases

* Look up a customer's order status
* Book a meeting or schedule a callback
* Transfer context to a human agent
* Run a real-time compliance check

### Latency consideration

The user is on the line waiting. Ongoing Conversation workflows should complete in under 2 seconds. Tips:

* Keep the workflow short — 1–3 steps
* Avoid Wait steps
* Return a concise string from the Output step for the agent to speak

## Setting up conversation triggers

Conversation triggers are configured directly on the **Agents** configuration section as an inline workflow:

<Steps>
  <Step title="Select An Agent To Configure">
    Choose an "Agent" that you want to configure a **Conversation** related trigger.
  </Step>

  <Step title="Select **Abilities & Actions**">
    In the Agent Configuration, select **Abilities & Actions** section
  </Step>

  <Step title="Configure and save">
    Configure any options in the inspector, then click **Save**.
  </Step>

  <Step title="Deploy the workflow">
    Click the **Deploy** button (lightning icon). Only deployed workflows fire automatically.
  </Step>

  <Step title="Attach to an agent">
    In the agent's settings, attach the workflow as the Pre Call, Post Call, or tool workflow for that agent.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/anyreach/H7de0CJCTkbxSIQS/images/workflows/agent-configuration.png?fit=max&auto=format&n=H7de0CJCTkbxSIQS&q=85&s=201bb644f8a0b123cbf14064e5eaccdf" alt="Post Call trigger configured in inspector" width="3088" height="1938" data-path="images/workflows/agent-configuration.png" />
</Frame>

* The agent configuration panel displays separate sections for **Pre Call**, **Post Call**, and **In-Call** workflows, each labeled with when they will trigger.
* Click **Add Workflow** to create a new workflow for the selected trigger.
* An inline workflow builder will appear, allowing you to define the workflow’s business logic and configuration without leaving the agent setup page.

<Frame>
  <img src="https://mintcdn.com/anyreach/H7de0CJCTkbxSIQS/images/workflows/inline-workflow.png?fit=max&auto=format&n=H7de0CJCTkbxSIQS&q=85&s=b0f880aeea3c0bf09998cf5cdb84a4d7" alt="Post Call trigger configured in inspector" width="3200" height="1924" data-path="images/workflows/inline-workflow.png" />
</Frame>

* The inline workflow builder is directly accessible within the agent configuration screen.
* You can create and edit workflows without leaving the agent setup process.
* Workflows built here are automatically attached to the agent as Pre Call, Post Call, or In-Call automations.
* This streamlined experience reduces context switching and speeds up configuration.
