Handle number porting requests through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to handle mobile number portability – moving a number from one operator to another without changing it.
For customers joining you, the workflow checks eligibility, explains how to get the porting code from their current operator, verifies their ID and submits the request to the porting system, returning a reference and a porting date. Customers can check progress by reference at any time. For customers leaving, it explains the process plainly and issues their porting code. Failed or disputed ports go to the porting team as a ticket, and customers whose current operator won't release their number are told how to complain to the regulator.
Porting is regulated in most markets, with fixed timelines and rules against blocking. A clear, consistent answer in chat helps operators meet those rules and gives regulators fewer complaints to handle.
Who can benefit from this guide:
- Mobile network operators winning or losing customers through porting
- Porting and number management teams
- Telecom regulators and central porting database operators
- Customer support teams handling porting questions in shops and online
- Business customers moving several numbers at once
Handle number porting
This workflow submits porting requests, tracks them by reference and escalates failed or blocked ports. See how to build a number porting workflow.
1. Create a trigger
Start the flow when a customer wants to move their number in either direction.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type.
- Name the trigger (e.g. “Number Porting”) and add a short description (e.g. “Triggers if user wants to keep their number when switching operator, move their number to us, leave for another network, asks for a porting code, checks a porting request or says a port failed.”).
- Add training phrases (e.g. “I want to switch to your network and keep my number”, “How do I port my number?”, “I need my porting code”, “Where is my porting request?”, “My number transfer failed”).
2. Ask which way the number is moving
Porting in and porting out are different journeys, so split them first.
Add a Send message action with quick replies:
“I can help you move your number. What would you like to do?”
Quick replies: Bring my number to you | Move my number to another network | Check a porting request | My port failed or was refused
Add a Message received sub-trigger under each quick reply. Bring my number to you continues to Step 3, Move my number to another network to Step 7, Check a porting request to Step 6, and My port failed or was refused to Step 8.
3. Check eligibility to port in
Catch the cases that will be refused before the customer goes to the trouble of getting a code.
Add an Ask survey action. Action title: Porting eligibility
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| The number you want to bring | port_number |
Phone | Please enter the full number, including the country code |
| Your current operator | losing_operator |
Text | Please choose or type your current operator |
| Is it prepaid or postpaid? | line_type |
Text | Please choose prepaid or postpaid |
Add quick replies with the other operators’ names to losing_operator, and Prepaid | Postpaid to line_type.
Add a Send API action with GET to the porting system’s eligibility endpoint, passing port_number and losing_operator. Store it as elig_response and parse it with Set variable: elig_response = _.json_parse(elig_response). Add a Branch:
| Condition | Next |
|---|---|
elig_response["eligible"] == true |
Step 4 |
elig_response["reason"] == "recent_port" |
“This number was moved less than {elig_response[“min_days”]} days ago, so it can’t be moved again yet.“ |
elig_response["reason"] == "not_registered" |
Explain that the number must be registered with the current operator first |
elig_response["reason"] == "already_ours" |
“This number is already on our network.” |
| Else | Step 8 |
For postpaid lines, add a Send message noting that any contract or unpaid bill stays with the current operator – but that an unpaid bill on its own isn’t always a reason to refuse a port. Keep the exact rule in the AI agent’s Knowledge tab, so it can be updated without editing the workflow.
4. Collect the porting code and verify the customer
Get the authorisation from the losing operator and confirm the request is from the number’s owner.
Add a Send message:
“To move your number, you need a porting code from {losing_operator}. You can usually get it by sending a free text from the number you’re moving, or by asking in one of their shops. The code is valid for a limited time, so please continue when you have it.”
Add an Ask survey action. Action title: Porting request
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Your porting code | porting_code |
Text | Please enter the code exactly as you received it |
| Your full name, as registered with {losing_operator} | full_name |
Text | Please enter your full name |
| Your ID number | id_number |
Text | Please enter the ID number the number is registered with |
| Your email address | email |
Please provide a valid email address | |
| How you’d like your new SIM | sim_delivery |
Text | Please choose a shop collection or delivery |
Add quick replies Collect from a shop | Deliver to me to sim_delivery. Keep Enable skip off for email – a failed port becomes a ticket, and Email is required on every ticket.
For checking the ID number’s format before it’s sent, follow Verify personal ID through AI chat. The losing operator’s records are the real check – the porting system compares the name and ID with them in Step 5.
5. Submit the request to the porting system
Send the request and tell the customer exactly what happens next.
Add a Send API action:
- HTTP method: POST
- URL endpoint: the porting system’s request endpoint
- Headers: the authorisation key your system requires
- Body:
port_number,losing_operator,porting_code,full_name,id_numberandline_type - Resulting variable:
port_response
Parse it with Set variable, then add a Branch:
| Condition | Next |
|---|---|
port_response["status"] == "accepted" |
The confirmation message below |
port_response["reason"] == "invalid_code" |
“That code wasn’t accepted – it may have expired. Please request a new one from {losing_operator}.” Offer one retry with a Jump to Step 4 |
port_response["reason"] == "id_mismatch" |
Explain the details don’t match the current operator’s records, and offer a Live agent handoff |
| Else | Step 8 |
On acceptance:
“Your request is in. Your reference is {port_response[“reference”]}. Your number will move on {port_response[“port_date”]}. On that day you may have no service for up to a few hours – when your {losing_operator} SIM stops working, put in your new SIM and restart your phone. Mobile money balances don’t move with the number, so withdraw or transfer them first.“
Under Error and Timed out, don’t tell the customer the request was submitted – go to Step 8 so a person can submit it by hand.
6. Check a porting request by reference
Let customers track their request without waiting for a live agent.
Add an Ask survey with one Text field, port_reference, and an invalid reply such as “Please enter the reference from your confirmation message.”
Add a Send API action with GET to the porting system’s status endpoint, passing port_reference. Parse the result and add a Branch on status_response["status"]:
- submitted or with losing operator – “Your request is with {losing_operator} for approval. They have {status_response[“days_left”]} working days to respond.“
- scheduled – give the porting date and the SIM reminder from Step 5.
- completed – “Your number moved on {status_response[“completed_on”]}. If it isn’t working yet, restart your phone.“
- rejected – give the reason and continue to Step 8.
Proto can only message people first on Webchat, so on other channels customers learn about a change by checking here or from a live agent’s reply to their ticket in the Inbox.
7. Explain porting out and issue the code
Treat customers who want to leave with the same clarity – blocking a port is often against the rules.
Add an LLM Processing action with Use Knowledge info to provide more context on, {_user_input} as the input and a system prompt such as: “Explain how to move a number to another operator using only the knowledge provided: how to get a porting code, how long it lasts, what happens to unused airtime, bundles and contracts. Be neutral – don’t argue against leaving.” Send the result with a Send message.
Then offer Get my porting code as a quick reply. Ask for the number and the last four digits of the registered ID, and add a Send API POST to your code issuing endpoint. The endpoint should verify the details and send the code by SMS to the number itself – never show it in the chat, which may not be on that phone. Confirm with: “If the details match, your porting code has been sent by text to {port_number}.”
8. Escalate failed, refused and disputed ports
Give the porting team a complete case, and give the customer a route to the regulator.
Add a Create ticket action:
- Assignee: your porting team
- Subject: Porting issue – {port_number} – {losing_operator}
- Description: direction of the port, reference if any, the eligibility and submission results with reason codes, and what the customer says happened
- Full name:
{full_name}; Email:{email}; Phone number: a number that works now - Auto-apply tags: porting and port-failed, port-refused or port-dispute
- Custom fields: a Losing operator single-select field, so the team can see which operator refuses most
Store {_new_ticket.short_id} as case_reference and send it to the customer.
If the reason shows the other operator refused or didn’t respond within the regulated time, add a Send message:
“If {losing_operator} has refused your request without a valid reason, you have the right to complain to the telecom regulator. We’ll follow up with them too, using reference {case_reference}.”
When the AI agent is run by a regulator, Jump to your complaints intake workflow instead, with the porting details already set as variables.
9. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Port in a number with a valid test code and confirm the reference, porting date and mobile money warning appear.
- Enter an expired code and confirm one retry is offered, then a ticket on the second failure.
- Check a reference in each status – with losing operator, scheduled, completed and rejected.
- Request a porting code to leave and confirm it’s never shown in the chat.
- Build and test in an undeployed version – Duplicate the live version first – then click Deploy when every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)