Tax self-service through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to give taxpayers self-service for three of their most common requests: working out which tax bracket they fall into, checking whether their tax affairs are in order, and getting a certificate of good standing.
The workflow calculates an income tax estimate from your published bands, checks the taxpayer's filing and payment status in your tax administration system, and – when everything is up to date – issues a good standing certificate as a document in the chat. Taxpayers who aren't compliant are told exactly what's outstanding.
Good standing certificates are needed for tenders, licences and loans, and requests for them peak around deadlines. Answering them in the chat frees tax office staff for cases that need judgement.
Who can benefit from this guide:
- Revenue authorities and tax administrations
- Taxpayer services and contact centre teams
- Municipal and local revenue offices
- Small business support agencies helping firms stay compliant
Tax self-service
This workflow estimates tax, checks compliance and issues good standing certificates 24/7. See how to build a tax self-service workflow.
1. Create a trigger
Start the flow when a taxpayer asks about their tax, compliance or a certificate.
- 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. “Tax Self-Service”) and add a short description (e.g. “Triggers if user wants to calculate their income tax, check their tax compliance or request a tax clearance or good standing certificate.”).
- Add training phrases (e.g. “How much tax will I pay”, “Which tax bracket am I in”, “Am I tax compliant”, “I need a tax clearance certificate”, “Good standing certificate”).
Then add a Send message with quick reply options: Calculate my tax | Check my compliance | Get a good standing certificate, and a Message received sub-trigger for each.
2. Calculate the tax bracket
Under the Calculate my tax sub-trigger, collect the taxpayer’s income.
Add an Ask survey action. Action title: Income details
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| What is your annual taxable income? | annual_income |
Number | Please enter an amount in numbers only |
Add a Branch action with one condition per band in your published tax table, starting with the lowest – conditions are checked in order, so each only needs an upper limit. Under each, add Set variable actions for the bracket and the estimate. For example, for a band taxed at 10% on income above 50,000, up to 100,000:
| Condition | Variable | Chat script |
|---|---|---|
_.as_float(annual_income) <= 100000 |
tax_bracket |
"10%" |
estimated_tax |
_.round_num((_.as_float(annual_income) - 50000) * 0.1) |
For higher bands, add the tax due on the lower bands to the calculation, as your tax table sets out.
Then add a Send message:
“With an annual taxable income of {annual_income}, you fall into the {tax_bracket} bracket. Your estimated income tax is {estimated_tax} a year. This is an estimate – your assessment may differ.”
If your system already has a tax calculator, use a Send API action to it instead of the branch, so the rates are only maintained in one place.
3. Verify the taxpayer
Compliance and certificates are personal, so confirm who’s asking first.
Under the Check my compliance and Get a good standing certificate sub-triggers, add an Ask survey action. Action title: Taxpayer verification
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Taxpayer identification number | tin |
Text | Please enter your taxpayer identification number |
email |
Please provide the email address registered with us |
Keep Enable skip off for both fields.
4. Check compliance
Fetch the taxpayer’s status from your tax administration system.
Add a Send API action:
- HTTP method: GET
- URL endpoint: your system’s compliance endpoint, passing
tinandemail - Headers: the authorisation key your system requires
- Resulting variable:
compliance
Add a Branch action:
- If
compliance["status"] == "compliant": Send message – “Your tax affairs are up to date.” On the certificate path, continue to Step 5. - Else if
compliance["status"] == "not_compliant": Send message listing what’s outstanding, e.g. “We can’t issue a certificate yet. Outstanding: {compliance[“outstanding_items”]}. Once these are filed or paid, ask me again.“ - Else: Send message saying the details couldn’t be matched, and a Jump action back to Step 3.
5. Issue the good standing certificate
Generate and send the certificate in the chat.
Add a Send API action (HTTP method: POST) to your certificate service, passing tin. Resulting variable: certificate.
Then add a Send attachment action. File format: Document. Source: Chat script, e.g. certificate["url"]. Follow it with a Send message:
“Here’s your certificate of good standing, valid until {certificate[“valid_until”]}. Its reference is {certificate[“reference”]}, which anyone can use to verify it with us.“
6. Hand over to a live agent
After each result, add a Send message with quick reply options: That’s all | Speak to an agent. Under a Message received sub-trigger for Speak to an agent, add a Live agent handoff action assigned to your taxpayer services team, with Live agent availability check turned on.
7. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Test an income in each band, and on each boundary, and check the estimate against your tax table.
- Test a compliant and a non-compliant taxpayer, and confirm only the compliant one receives a certificate.
- Open the certificate and check its details and validity date.
- Test a wrong TIN and email combination and confirm no details are shown.
- Build and test in an undeployed version – Duplicate the live version first – then Deploy it once every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)