# Managed AI Agent

**Managed AI Agent** is an autonomous loop *after* the work is known — usually [On Call End](https://docs.voicelogica.ai/workflows/on-call-end/). It is not [AI Response to Caller](https://docs.voicelogica.ai/workflow-nodes/ai-response/). It will not talk on the line.

  <ShotPlaceholder
    src="/assets/workflow-nodes/managed-agent.png"
    name="wn-ma"
    alt="Managed AI Agent — Task"
    capture="Managed AI Agent node on Task. 1600×900. No emails."
  />

## Why this node

File the ticket, update the CRM, write the follow-up — a short tool loop with a cost cap. One HTTP call is still [Connect To External Service](https://docs.voicelogica.ai/workflow-nodes/api/). One completion is [AI Response Generation](https://docs.voicelogica.ai/workflow-nodes/ai-generation/).

## What you configure

- **Task** (required) — What the loop must finish. Seeded so a fresh card is not empty.
- **Built-in tools / API tools / MCP** — What it may call. Runtime expects at least one tool.
- **Models** — Primary (seeded). Optional escalation on the same provider.
- **Limits** — Max iterations (default 15, 0 = no iteration cap) and max cost (USD, max 0.5). **Stuck detection** bails if the same tool+args fire twice.
- **Knowledge** — Optional files + rerank. Same idea as the agent knowledge attach.

**Dry run** is on the node — use it while you test. Ports: **Task completed**, **Task failed**.

## First setup — after hang-up, create a ticket

1. Connect the CRM on [Integrations](https://docs.voicelogica.ai/integrations/) if the loop will write there.

2. [On Call End](https://docs.voicelogica.ai/workflows/on-call-end/) → **Managed AI Agent**. Task: open a ticket from the call summary. Add the HubSpot (or API) tool it needs.

     <ShotPlaceholder
       src="/assets/workflow-nodes/managed-agent-filled.png"
       name="managed-agent-filled"
       alt="Managed AI Agent filled"
       capture="Workflow builder → Managed AI Agent selected. Task filled and at least one tool added. 1600×900. Redact numbers/emails/PINs."
     />

3. Leave limits at the seed. **Save & go live**, attach, hang up one call. Check the CRM — if nothing landed, no tool was added, HubSpot is disconnected, or dry run is on.

## What “broken” looks like

- **Needs setup** — empty Task.
- Loop stops early — cost / iteration cap, or stuck detection.
- Mid-call silence — this node is on During Call.

## Troubleshooting

**Why not just chain API + Email?**

Do that when the steps are fixed. Use this node when the *set* of writes depends on what happened on the call and you accept a capped loop.

## Next Steps

[On Call End](https://docs.voicelogica.ai/workflows/on-call-end/).  
[HubSpot nodes](https://docs.voicelogica.ai/workflow-nodes/hubspot/) — a single deterministic write.  
[AI Response Generation](https://docs.voicelogica.ai/workflow-nodes/ai-generation/).
