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

# Agent dispatch

> Assign tickets on a PSA board with an Agent Builder skill that a Flow runs when a ticket is ready, instead of an Auto-dispatch profile.

Some service desks decide who gets a ticket by rules a profile can't express: a fixed pool per queue, workload weighted by priority, a free slot on the tech's Planner, or who's out this week. You can run that dispatcher in Thread as an **Agent Builder** skill. A **Flow** runs the skill when a ticket reaches a "ready to assign" status, and the skill sets the owner itself. This is a supported alternative to an [Auto-dispatch profile](https://docs.getthread.com/inbox/auto-dispatch-profiles.md). Use a profile when "assign the next eligible tech on this team" is all you need.

## How agent dispatch works

This example uses a board, **Service Desk**, with a status **Ready to be Assigned**, and a shared skill, **Service Desk Dispatcher**.

| Piece | Set to | What it does |
| - | - | - |
| Flow conditions | Board is **Service Desk**, Status is **Ready to be Assigned**, Owner is blank | Decides which tickets the dispatcher sees |
| Flow action | **Agent Builder → Run a Skill**: Service Desk Dispatcher, with the **update ticket** and **add note** write tools checked | Runs the skill unattended on each matching ticket |
| Skill | Your pool and your rule for picking a tech | Picks one tech, sets them as owner, and writes a note saying why |

1. Intake or triage moves a new ticket to **Ready to be Assigned**.
2. The Flow matches it and runs **Service Desk Dispatcher**.
3. The skill checks the ticket has no owner, scores the pool, and sets the winner as owner with the **update ticket** tool. It can also set a status or book a schedule entry, if you checked those tools.
4. If no one qualifies, the skill writes nothing except a note, and the ticket waits for a dispatcher.

A Flow acts on a ticket **once**. Once it has run on a ticket, it skips that ticket for good, even if the run failed or the skill chose not to assign. Plan for that case before you go live (see [Catch and re-dispatch tickets](https://docs.getthread.com/inbox/dispatch-scenarios/catch-and-re-dispatch.md)).

## Variations

Every desk builds the dispatcher a little differently. Pick one option per row and write it into the skill.

| Decision | Options |
| - | - |
| **Who's in the pool** | A fixed list of named techs written in the skill. Or the techs **available for dispatch**: the skill asks for members available for dispatch, which only returns techs on a team in an **enabled Auto-assign profile**. Or everyone on the board's team. |
| **How the winner is picked** | Fewest open tickets. Open tickets weighted by priority. Round-robin. A per-tech cap. First tech with a free slot on the Planner. Skip names on an out-of-office list in the skill. |
| **What the skill writes** | Owner only. Owner and a status such as **Assigned**. Owner, a Planner entry, and a status such as **Scheduled**. |
| **What triggers it** | A dedicated status such as **Ready to be Assigned**. Status **New** with Owner blank. A status your triage step sets (see [Triage, route, then dispatch](https://docs.getthread.com/inbox/dispatch-scenarios/triage-route-then-dispatch.md)). |
| **When no one qualifies** | Leave it unassigned with a note. Move it to a status a dispatcher works from. |

## Before you start

* The board has a status that means "ready to assign", and intake or triage sets it.
* No Auto-assign profile dispatches from that status on that board. If one does, see [Auto-assign plus an agent](https://docs.getthread.com/inbox/dispatch-scenarios/auto-assign-plus-an-agent.md).
* The skill is a **shared** skill. Run a Skill only runs shared skills.
* You know how to build a Flow with an Agent Builder action. See [Flows](https://docs.getthread.com/inbox/flows.md). The [Smart Dispatch](https://docs.getthread.com/skill-library/scheduling-and-dispatch/smart-dispatch.md) and [Tier Dispatcher](https://docs.getthread.com/skill-library/scheduling-and-dispatch/tier-dispatcher.md) prompts are good starting points.

## Set up agent dispatch

**1. Write the dispatcher skill**

Create a shared skill with your pool and your picking rule. Tell it to: do nothing if the ticket already has an owner; never pick a deactivated or excluded tech; set the owner with the update ticket tool; add a plain-text internal note with the reason; and when there's no clear winner, assign no one and say so in the note.

**2. Prove it by hand**

Run the skill in Super Magic on a few real tickets. Check it picks the tech your dispatcher would, and leaves owned tickets alone.

**3. Create the Flow**

Add the conditions from the table above. Add **Agent Builder → Run a Skill**, choose the skill, and check **only** the write tools it needs: update ticket, add note, and the schedule tool if it books time. Turn the Flow on.

**4. Watch the first week**

Read the agent's notes daily, and compare the Flow's run history with the tickets that actually got an owner.

Check the write tools on purpose. If you leave them all unchecked on **Run a Skill**, the skill gets every write tool that's allowed in unattended runs, not none.

## Rules for agent dispatch

* **One run per ticket per Flow.** A failed or declined run still counts, and nothing retries it.
* **The agent overwrites.** The update ticket tool assigns whoever the skill names, even if the ticket already has an owner. Guard against it in the Flow conditions and in the skill.
* **Auto-assign never takes an owned ticket.** If a profile also covers this status, the profile skips tickets the agent already assigned. The agent can still overwrite the profile's pick.
* **Shared skills only.** A personal skill in Run a Skill does nothing, and the run still shows as succeeded.
* **"Succeeded" means it ran.** Run history marks a run succeeded when it starts. Check the ticket's owner and the agent's note to see what happened.
* **Notes need the add note tool.** In a Flow, the agent's reply isn't posted on the ticket.
* **The skill acts as its creator**, or as an active admin if the creator isn't an active member.
* **Schedules.** The skill can read Planner entries. Thread's built-in agent tools don't read work schedules or time off. Keep shifts and absences in the skill, or use [After-hours and shift dispatch](https://docs.getthread.com/inbox/dispatch-scenarios/after-hours-and-shift-dispatch.md).
* **Get next thread doesn't run in Flows.** It only works for a technician in Super Magic.
* **Track agent dispatch from the Flow.** Use the Flow's run history and the agent's notes to see what it assigned and why.


## Related topics

- [Skill-match dispatch](https://docs.getthread.com/inbox/dispatch-scenarios/skill-match-dispatch.md)
- [Triage, route, then dispatch](https://docs.getthread.com/inbox/dispatch-scenarios/triage-route-then-dispatch.md)
- [Catch and re-dispatch tickets](https://docs.getthread.com/inbox/dispatch-scenarios/catch-and-re-dispatch.md)
