Submit expense claims through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to let staff claim expenses by sending a photo of each receipt – no forms, no retyping amounts and no claims returned for a missing cost centre.
The workflow sends each receipt to an OCR service, which reads the amount, date and merchant, and asks the person to confirm them and pick a category. It checks each receipt against your expenses policy, builds a claim from as many receipts as the person has, and submits it to your finance system for approval – or opens a ticket for the manager's team where there's no approval flow. Anything over the limit or rejected is explained, with a finance live agent on hand.
It is part of the same employee AI agent as HR policy questions, so staff can ask what they're allowed to claim and claim it in the same chat.
Who can benefit from this guide:
- Finance teams in ministries, agencies and public bodies
- Banks and digital finance providers with staff travelling between branches
- Telecom operators with field engineers and sales teams on the road
- Hospitals and health services with outreach and community staff
- Managers approving claims who want them complete the first time
Submit expense claims
This workflow reads receipts, checks them against policy and submits a complete expense claim for approval 24/7. See how to build an expense claim workflow.
1. Create a trigger
Start the flow when a staff member wants to claim expenses.
- 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. “Expense Claim”) and add a short description (e.g. “Triggers if a member of staff wants to claim, submit or get reimbursed for work expenses, such as travel, fuel, meals, accommodation or supplies they paid for themselves.”).
- Add training phrases (e.g. “I want to claim expenses”, “Submit my taxi receipts”, “How do I get paid back for the hotel?”, “Claim for the workshop in Kigali”).
Questions about what can be claimed belong to the HR policy workflow, or a finance policy workflow if you have one.
Deploy the AI agent on your signed-in intranet Webchat, where {_customer.email} identifies the person, and on WhatsApp – the easiest way to photograph a receipt while travelling.
2. Start the claim
Identify the person and open a draft claim the receipts will be added to.
Verify the staff member as in Step 5 of the HR policy guide, so the staff variable is set. Then add an Ask survey action. Action title: Claim details
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| What were these expenses for? | claim_purpose |
Text | Please describe the trip, event or work they were for |
| Cost centre | cost_centre |
Text, with a quick reply for {staff["cost_centre"]} |
Please enter the cost centre code |
Add a Send API action:
- HTTP method: POST
- URL endpoint: your finance system’s endpoint for a new draft claim
- Body:
{staff["id"]},{claim_purpose}and{cost_centre} - Resulting variable:
claim
Under Error and Timed out, tell the person the finance system isn’t available and offer Talk to finance (Step 9) – don’t collect receipts with nowhere to save them.
Then add a Set variable action to set receipt_count to 0 and claim_total to 0.
3. Upload a receipt
One receipt at a time keeps each amount matched to its photo.
Add an Ask survey action. Action title: Receipt
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Send a clear photo or PDF of the receipt | receipt |
Attachment | Please send the receipt as a photo or PDF |
Make sure Enable skip is off. Ask people to lay the receipt flat and include the whole of it, total included.
4. Read the receipt
An OCR service reads the receipt, so the person only has to check it.
Add a Send API action to your OCR or document-reading service, as in Auto-populate fields with OCR:
- HTTP method: POST
- Body: the link to the uploaded
receiptfile, and the fields you want back –amount,currency,dateandmerchant - Resulting variable:
receipt_data
LLM Processing only takes text, so it can’t read the image itself – the OCR service has to. Configure the service to return null for anything it can’t read clearly, rather than guessing. Under Error and Timed out, and when receipt_data["amount"] is empty, ask for the amount, date and merchant with an Ask survey instead.
5. Confirm the details and choose a category
The person checks what was read and says what the expense was.
Add a Send message:
“I read {receipt_data[“merchant”]}, {receipt_data[“date”]}, {receipt_data[“currency”]} {receipt_data[“amount”]}. Is that right?“
with quick replies Yes, that’s right | Something’s wrong. Under Something’s wrong, add an Ask survey with Amount (Number), Date (Text) and Merchant (Text), and a Set variable action to overwrite the values in receipt_data.
Then add a Send message:
“What kind of expense was this?”
with quick replies Travel | Accommodation | Meals | Fuel | Supplies | Other, using your finance system’s category names. Under each, add a Message received sub-trigger and a Set variable action for category.
6. Check the receipt against policy
Catch an over-limit receipt now, not after the manager has approved it.
Add a Send API action:
- HTTP method: POST
- URL endpoint: your finance system’s policy check endpoint
- Body:
{staff["grade"]},{category},{receipt_data["amount"]},{receipt_data["date"]}and{receipt_data["merchant"]} - Resulting variable:
policy
Keep limits per category in the finance system rather than in the chat, so they change in one place. If your limits only exist in a policy document, add it to the Knowledge base and use an LLM Processing action with Use Knowledge info to provide more context on to return the limit for the category as a number – and have finance check those answers before going live.
Add a Branch:
| Condition | What happens |
|---|---|
policy["result"] == "over_limit" |
Send “The limit for {category} is {policy[“limit”]}, and this receipt is {receipt_data[“amount”]}. You can add a reason for your manager, or leave this receipt out.“ – quick replies Add a reason | Leave it out |
policy["result"] == "too_old" |
Send “Receipts must be claimed within {policy[“max_days”]} days, so I can’t add this one.“ – then go to Step 7’s next-receipt question |
policy["result"] == "duplicate" |
Send “This receipt looks like one you’ve already claimed, so I’ve left it out.” – then go to Step 7’s next-receipt question |
| Else | Continue to Step 7 |
Under Add a reason, an Ask survey with one Text field, over_limit_reason, which is added to the line.
7. Add the receipt and ask for the next
Repeat Steps 3–6 for each receipt, with a counter to keep the claim a sensible size.
Add a Send API action (HTTP method: POST) that adds the line to the draft claim – {claim["id"]}, the confirmed receipt data, {category}, any over_limit_reason and the receipt file’s link. Then add a Set variable action:
receipt_count:receipt_count + 1claim_total:_.round_num(_.as_float(claim_total) + _.as_float(receipt_data["amount"]), 2)
Add a Send message:
“Added. That’s {receipt_count} receipts, {claim_total} in total. Do you have another?”
with quick replies Add another receipt | Submit my claim. Under Add another receipt, add a Branch: if receipt_count < 20, add a Jump action back to Step 3. Under Else, say the claim is full and continue to Step 8 – the person can start a second claim for the rest.
8. Submit the claim for approval
Send the complete claim to whoever approves it.
Add a Send message that plays back the claim – purpose, cost centre, number of receipts and total – with quick replies Submit | Cancel claim.
Under Submit, add a Branch on how your organisation approves claims:
- Finance system approval: add a Send API action (HTTP method: POST) to submit
{claim["id"]}. The finance system sends it to the manager and pays it through payroll. Then send: “Your claim {claim[“id”]} for {claim_total} has been submitted. Your manager will approve it in the finance system.“ - No approval flow: add a Create ticket action assigned to the manager’s team – from a variable such as
{staff["team_id"]}if your HR system returns one, or from an Auto team match on{staff["department"]}– with the subject Expense claim – {staff[“name”]} – {claim_total}, the claim lines and any over-limit reasons in the description, the last receipt in Attachment(s), the tags expense-claim and over-limit where it applies, and a custom field for the total. The approver sees every receipt in the conversation in the Inbox, approves or rejects by replying from the ticket, and sets it to Resolved.
Under Cancel claim, a Send API action (HTTP method: DELETE) removes the draft.
9. Explain rejections and offer finance
People accept a rejection they understand.
Add a second workflow with the Message received trigger (e.g. “Expense Claim Status”, with phrases like “Where’s my expense claim?” and “Why was my claim rejected?”). Verify the person, then add a Send API action (HTTP method: GET) for their recent claims, resulting variable claims, and a Branch on claims[0]["status"]:
- Approved or Paid: send the amount and the payment date.
- Rejected or Returned: send the reason the approver recorded, e.g. “Your claim was returned because: {claims[0][“reason”]}. You can correct it in a new claim or talk to finance.“
- Pending: send who it’s waiting with and since when.
Wherever the person picks Talk to finance, add a Live agent handoff assigned to your finance team, with Live agent availability check on. Under If there is no live agent online, add a Create ticket for the finance team tagged expense-query.
10. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Submit a claim with three receipts and check the count, the total and each line in the finance system.
- Upload a blurred receipt and confirm the manual amount, date and merchant fields appear.
- Claim a meal above the limit, add a reason and confirm it reaches the approver with the over-limit tag.
- Ask “Why was my claim rejected?” for a returned claim and check the reason is shown, then pick Talk to finance.
- Build and test in an undeployed version – Duplicate the live version on the Workflows tab – then Deploy when every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)