# Assign To (AI)

Pin the conversation to one named AI agent for its next replies, overriding whatever would otherwise decide which agent answers.

## Getting here

**Automate → Workflows**, open a workflow, click **+** on the canvas, then pick **Assign To (AI)** under **Add Steps**.

## Before you start

- An **owner**, **admin** or **agent** can add this step and save the workflow. Publishing it is an **owner** or **admin** action.
- Building and running workflows depends on your plan; see [pricing](/pricing).
- At least one enabled AI agent must already exist in the workspace for this step to name.
- Nothing outside Inchat has to be connected. The step only writes to the conversation.

## Set up

1. Open the workflow and click **+** where the assignment belongs.
2. Pick **Assign To (AI)**.
3. Under **AI Agent**, choose the agent that should answer this conversation from here on.
4. Save the step, then publish the workflow.

## Fields

| Field | What it means | Limits |
| --- | --- | --- |
| AI Agent | The named, enabled AI agent this conversation is pinned to. | Only enabled agents in this workspace are offered. There is no timeout, distribution or online/offline setting on this step. |

## How it works

- On a thread this step is actually allowed to touch, it pins the named agent to the conversation and marks the AI as the thread's owner, so the next inbound message is answered by this agent rather than by whatever would otherwise be selected — see Limits for when it is not allowed to touch it.
- It also clears a hold placed earlier in the same conversation by a **Pause AI / Unassign** step — this is one of three ways that hold is cleared, the other two being an operator clicking **Resume AI** on the thread, or picking a specific AI agent in the conversation's own settings.
- It sends the customer nothing by itself. The named agent answers only when the customer next writes in.

## When it fails

- The named agent no longer exists, or has since been disabled, in this workspace: the step fails with **no AI agent with id … in this workspace — it may have been deleted**, and the conversation's agent is left as it was.
- The thread is already human-owned, or already paused because the customer asked for a person: the step is refused before it writes anything — the conversation's agent and owner are left exactly as they were, and the run stops there rather than continuing to a later step.
- The conversation moved out from under the step while it was running (for example, a person took it over at the same moment): the step stops and the run does not continue past it.
- You read the reason in the workflow's **Activity** tab: pick the run under **Execution log** and the failed step carries its own line of text.
- Saving is refused if no AI agent is chosen — **Pick an AI agent for the “Assign to AI” action.**

## Limits

- It only takes effect on a thread that is not already human-owned or already paused for a customer-requested reason — on one of those, the step is refused and the run stops rather than overriding the hold (see When it fails). It cannot be used to take a thread away from a person or from that kind of pause.
- It clears a hold placed by an earlier **Pause AI / Unassign** step, but never the hold set when the customer asks for a person or an **Escalate** step runs. Another run meeting that hold is refused. An Assign To (AI) later in the same run as the Escalate succeeds, and the AI stays paused.
- It has no timeout, no distribution and no online/offline concept — it names one agent and either succeeds or is refused; there is no other setting on this step.
- It does not check anything about the customer's channel or window — it only changes which agent answers, not whether a reply can currently be sent.

## Best practices

- Use this step when a specific agent — one built for a particular product line or language — should take over from here, rather than whichever agent the conversation would otherwise use.
- Follow it with an **AI Reply** step on the same path if the workflow itself needs the named agent to answer immediately, since this step only sets who answers next, not that a reply happens now.

## Use cases

- A Condition step detects the contact asked about a specific product line and hands the conversation to the AI agent built for it.
- A conversation paused earlier in the same flow by **Pause AI / Unassign** is handed back to an AI agent once a hand-off to another workflow has finished its own work.

## FAQ and troubleshooting

### Does the AI answer right away when this step runs?

No. It only pins the agent; the agent's first reply happens on the customer's next inbound message.

### I have this step in a flow but the AI still is not replying.

Check whether the thread is already human-owned or already paused because the customer asked for a person — on either of those, this step refuses to run at all rather than overriding the hold. It only ever clears the separate hold Pause AI / Unassign sets. Even when the step succeeds, a person who replied on the thread within the last few hours holds the AI's own reply turn out separately — that hold is not this step's to clear; it lifts on its own or when someone clicks Resume AI.

## Related

- [Assign To (human)](https://inchat.inseller.my/help/workflows/assign-to-human)
- [Assign To (team)](https://inchat.inseller.my/help/workflows/assign-to-team)
- [Pause AI / Unassign](https://inchat.inseller.my/help/workflows/pause-ai-unassign)
- [Escalate](https://inchat.inseller.my/help/workflows/escalate)
- [AI Reply](https://inchat.inseller.my/help/workflows/ai-reply)

---

Source files: `src/lib/workflows/ai-builder/spec.ts`, `src/lib/workflows/canvas-model.ts`, `src/components/workflows/WorkflowStepConfigDrawer.tsx`, `src/lib/workflows/engine-record-actions.ts`, `src/lib/workflows/form-payload.ts`, `src/lib/orchestrator/thread-gate.ts`, `src/lib/workflows/execution-guard.ts`, `src/lib/workflows/internal-actions.ts`, `src/components/inbox/ThreadOwnerToggle.tsx`, `supabase/migrations/20260925120000_hand_back_to_ai_clears_workflow_pause.sql`, `src/lib/orchestrator/human-reply-hold.ts`, `src/lib/inbox/human-reply-hold.ts`, `src/lib/orchestrator/handle-inbound.ts`, `src/lib/workflows/engine.test.ts`
