Switch AI agents between government agencies
Workflow purpose
This guide demonstrates how to use Proto's platform to hand a citizen off from one government agency's AI agent to another, with full context, when their issue turns out to belong somewhere else. Citizens shouldn't have to know which agency owns which problem, or repeat themselves once they've found the right one. This workflow uses Proto's AI Agent Network to pass the conversation, and everything already collected, to the receiving agency's agent in one step.
Who can benefit from this guide:
- Multi-agency government platforms where citizens may start in the wrong place
- Central banks and regulators referring citizens to a sister agency
- Digital government teams building "no wrong door" citizen services
- Anti-scam centres referring cases that belong to a different regulator
Switch between government agencies
This workflow confirms which agency actually owns the citizen's issue, then hands the conversation off with its full context attached. See how to switch AI agents between government agencies.
1. Create a trigger
Purpose: Catch the moment a citizen’s issue turns out to belong to a different agency.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type.
- Name the trigger “Cross-agency handoff”.
- Add a description such as “Triggers when the citizen’s request matches another agency’s mandate rather than this one.”
2. Confirm the destination agency
Purpose: Check with the citizen before transferring them anywhere.
- Add a Send message action with quick reply options for each partner agency this agent can hand off to.
- Add a Set variable action to store the selection as
destination_agency– quick reply selections aren’t captured automatically, so this step reads_user_inputinto the variable.
3. Handoff confirmation
Purpose: Tell the citizen what is about to happen so the transfer doesn’t feel like a dead end.
- Add a Send message action: “I’m transferring you to {destination_agency} with the details you’ve already shared, so they can pick up from here.” Send it before the handoff – once the chat has left this AI agent, it can’t send anything else.
4. AI agent handoff
Purpose: Transfer the conversation with everything already collected, so the citizen never repeats themselves.
- Add a Branch action with one condition per partner agency, e.g.
destination_agency == "Revenue authority", and an AI agent handoff action under each. The handoff’s destination is fixed, so each agency needs its own. - In each handoff’s AI Agent setting, select Connect external AI Agent and enter that agency’s AI Agent ID, AI Agent secret and Platform domain, copied from External AI Agent handoff on its AI agent’s Network tab, then Verify & Save.
- There’s nothing else to map – the receiving AI agent gets the citizen’s name and contact details, their latest message and every variable already collected in this conversation, readable as
{_transferred_context["first_name"]},{_transferred_context["issue_description"]}and so on. - Under Else and each When external AI agent transfer failed branch, add a Send message explaining the transfer couldn’t happen, then a Live agent handoff to your own team.
5. Test the flow
Purpose: Confirm the receiving agency actually gets what it needs.
- Run a test conversation on your Webchat – the AI agent tester isn’t a supported channel for AI agent handoff, so there the action always takes When external AI agent transfer failed. Collect a few fields, trigger the handoff, and confirm the receiving AI agent picks up the chat and can read the transferred context.
- Test with an agency selection that has no configured handoff credentials, and confirm the flow fails gracefully with a message rather than an error.
- Test declining the handoff to confirm the citizen can still continue with the original agent.
.png)