> For the complete documentation index, see [llms.txt](https://documentation.proto.cx/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.proto.cx/docs/modules/ai-agents/workflows-and-actions/auto-team-match.md).

# Auto team match

`Action` — Matches input text against alternative team names configured in Team settings. If no match is found, the team is not set.

## What it does

Takes an input value — typically a chat variable — and matches it against the alternative names defined for each team. Saves the matched team to a variable for downstream actions.

## When to use it

To route a chat to the right team based on what the person mentions, such as matching an institution or department name to the team that handles it, before a live agent handoff.

## Settings

| Setting                       | Description                                                                                                                                                     |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Input text**                | The text to match against team names. Accepts chat variables. Toggle **Script** to supply a [chat script](/docs/developers/chat-scripts.md) expression instead. |
| **Save output into variable** | The chat variable that stores the matched team result. Must start with a letter and contain only letters, numbers, or underscores.                              |

Press **Save** to confirm edits.

## Outcome branches

The action branches into **Match found**, **No match**, and **Error**. Nest subsequent actions under each as needed.

## Example

```
Auto team match
• Input:   {financial_institution}
• Save to: matched_team
├─ Match found
│  └─ Live agent handoff → matched_team
└─ No match
   └─ Live agent handoff → general queue
```

## Related

{% content-ref url="/pages/aLlL00SsNeVzsBT6G7gY" %}
[Live agent handoff](/docs/modules/ai-agents/workflows-and-actions/live-agent-handoff.md)
{% endcontent-ref %}

{% content-ref url="/pages/hChfEfAeHuCw3fNFxnRo" %}
[Auto fill field](/docs/modules/ai-agents/workflows-and-actions/auto-fill-field.md)
{% endcontent-ref %}
