Extract and organize receipts
Read the merchant, date, total and currency from receipt photos into fields, sort them into expense categories, and file them by year and month.
Receipts pile up as photos with names like IMG_4471.jpg, and when you need one for a refund, a warranty claim or your taxes, you have to open them one by one. This guide builds a library workflow for a Receipts folder: upload a photo there, and an AI model reads the merchant, date, total and currency into fields, picks an expense category, renames the file after what it is, and files it under the year and month of the purchase. Receipts it can't read properly go to a Needs review folder. The photo itself is never changed, so you can always check a value against it.
- File uploaded (trigger)Folder Receipts
- Load content
- Read the receiptAI extract · Merchant, Purchase date, Total, Currency
- Next
- Expense categoryAI classify
- Name partsSet values
- Set field × 5Merchant, Purchase date, Total, Currency, Expense category
- Keep the detailsAdd attachment
- Has a date?
- True
- RenameDate, merchant, amount
- File by monthReceipts/‹yyyy›/‹MM›
- False
- Needs reviewReceipts/Needs review
- True
- Error
- Needs reviewThe same step as on False
- Next
The two Needs review boxes are one step with two connections into it: the run reaches it when the receipt has no date, or when a required value couldn't be read.
What you'll build
| Before | After | |
|---|---|---|
| Name | receipt-corner-bakery.jpg | 2026-11-14 Corner Bakery 15.98 USD.jpg |
| Folder | Receipts | Receipts/2026/11 |
| Fields | None | Merchant Corner Bakery, Purchase date 2026-11-14, Total 15.98, Currency USD, Expense category Dining |
| Attachments | None | Receipt details, a short Markdown summary that search can find |
The steps, names, folders and fields are verified from runs of this workflow. The values the AI read are illustrative: they're what the sample receipt shows, and a good model reads them the same way, but check your own results.
Before you start
| Difficulty | Intermediate |
| Time | About 30 minutes |
| Workflow kind | Library workflow |
| Connections | An AI connection whose model takes images |
| Models | An image model that reads text well, such as qwen2.5vl or gemma3:12b on Ollama, or a hosted model such as gpt-4.1-mini. An extraction model, on Cloudflare Workers AI or OpenRouter, gives a confidence for each value. |
| Folders | Receipts. Create it in Files. Needs review and the year and month folders are created as needed. |
| Fields | Created in the first step below |
| Tags | None |
| Sample file | receipt-corner-bakery.jpg: a made-up bakery receipt |
Build the workflow
Create the fields
In Settings › Fields, click New field for each of these. See Creating a field.
| Name | Type | Choices |
|---|---|---|
| Merchant | Text | |
| Purchase date | Date | |
| Total | Number | |
| Currency | Text | |
| Expense category | Choice | Groceries, Dining, Travel, Office, Household, Other |
Create the workflow
Open Automations › Workflows, click New workflow, name it Read receipts, keep Library workflow, and choose File uploaded. Set its Folder to Receipts and File types to image/png, image/jpeg and image/webp.
Only uploads into Receipts itself start a run, so moving a receipt into a month folder later doesn't start it again.
Load the photo
Add Load content after the trigger.
Read the receipt
Add AI extract, rename it Read the receipt, and click Configure step.
- Connection: your AI connection.
- Method: Extraction model if the editor doesn't flag the connection; otherwise Language model, which works with every connection, including Ollama.
- Add image input, then Image: Load content › Content.
Click Use existing fields. It adds a value for each of your fields with a matching type. Remove Expense category, which the next step decides, and any other fields you don't want filled. Then fill in the descriptions and Required:
| Value | Type | Required | Description |
|---|---|---|---|
| Merchant | Text | Yes | The shop, restaurant or company the purchase was made from, as printed at the top of the receipt. |
| Purchase date | Date | No | The date of the purchase. Ignore due dates and return-by dates. |
| Total | Number | Yes | The final amount paid, including tax and tip, without the currency symbol. |
| Currency | Text | No | The three-letter ISO 4217 code of the total, such as USD, EUR or GBP. Only when the receipt shows it or its symbol makes it unambiguous. |
On the Advanced tab, add Additional instructions: Read printed text only. If several totals appear, use the one labelled Total or Amount paid. Then set If this step fails to Take the error path. The step gets an Error output, which you'll connect later.
A value the model can't find stays empty and is listed in the step's Missing values; Avenvail never guesses one. A Required value that's missing fails the step with ai_required_missing, and the run takes the error path.
Pick an expense category
Add AI classify after Read the receipt, rename it Expense category, and click Configure step.
- Connection, Method and Image as for AI classify in the screenshot guide.
- Add text input, then a template:
Merchant: {{ steps.extract.merchant }}. - Allow no match when none of the categories fit: on.
| Category | What belongs in this category? |
|---|---|
| Groceries | Supermarkets and food shops for home. |
| Dining | Restaurants, cafes, bakeries, bars and takeaway. |
| Travel | Transport, fuel, parking, hotels and tickets. |
| Office | Office supplies, software, electronics and work equipment. |
| Household | Home goods, hardware, utilities and repairs. |
Leave out Other: receipts that fit nothing get it below. Set If this step fails to Continue, so a failed category doesn't lose the values already read.
Prepare the name
Add Set values, rename it Name parts, and add two values, each as a template:
| Name | Value |
|---|---|
merchant | {{ steps.extract.merchant | replace: '/', '-' | truncate: 60 }} |
amount | {{ steps.extract.total }} {{ steps.extract.currency | default: '' }} |
File names can't contain /: Avenvail keeps only what comes after the last one, so Harbor Hardware / Garden would become Garden. replace turns it into a dash instead, and truncate stops a long merchant name from crowding out the rest.
Store the values in fields
Add five Set field steps one after another. Pick the Field, then set Value:
| Field | Value |
|---|---|
| Merchant | From a step: Read the receipt › Merchant |
| Purchase date | From a step: Read the receipt › Purchase date |
| Total | From a step: Read the receipt › Total |
| Currency | From a step: Read the receipt › Currency |
| Expense category | Template: {{ steps.classify.label | default: 'Other' }} |
A value that wasn't found leaves the field as it was. The category's name matches the field's choices, ignoring case; Other covers receipts nothing fits.
Keep a readable summary
Add Add attachment, rename it Keep the details:
- Name:
Receipt details - Kind: Markdown
- Text: a template:
## Receipt details - **Merchant:** {{ steps.extract.merchant }} - **Date:** {{ steps.extract.purchaseDate | default: 'not found' }} - **Total:** {{ steps.extract.total }} {{ steps.extract.currency | optional }} - **Category:** {{ steps.classify.label | default: 'Other' }} Read by the *Read receipts* workflow. Check the original image before relying on these values.
Markdown attachments are searchable, so searching Files for bakery finds this receipt even after you rename it.
File it by date
Add a Condition, rename it Has a date?, with one rule: Read the receipt › Purchase date isn't null.
From True, add:
- Rename, with New name
{{ steps.extract.purchaseDate }} {{ steps.set-values.merchant }} {{ steps.set-values.amount }}. Keep Keep the extension on. - Move to folder, renamed File by month: Folder Receipts, Subfolders
{{ steps.extract.purchaseDate | date: 'yyyy/MM' }}.
From False, add Move to folder, renamed Needs review: Folder Receipts, Subfolders Needs review.
The date is checked first because date can't format a missing value, and filing an undated receipt under today's month would hide it.
Send failures to review
Drag from Read the receipt's Error output to the Needs review step. It now has two connections into it, and runs when either is taken.
Test it
- Upload the sample receipt into Receipts with the workflow inactive.
- Click Test, choose it, turn on Allow sending content to outside services, and click Start test.
- Select Read the receipt. Its outputs show each value, and Missing values lists any it couldn't find. With an extraction model, Confidence shows how sure it was of each one.
- Select the Set field steps, Keep the details, Rename and File by month to see what they would write. Nothing is written to the real file during a test.
Try a photo of a real receipt too, and a picture that isn't a receipt at all: it should end at Needs review.
Turn it on
Click Publish, then turn on Active. Upload receipts into Receipts from the browser, from your phone's browser, or with a ShareX token whose uploads you file there.
What to expect
Verified runs, with the values the stand-in model returned:
| Case | Path | Result |
|---|---|---|
| Every value found | Next → Has a date? True | Fields set, renamed 2026-11-14 Corner Bakery 15.98 USD.jpg, moved to Receipts/2026/11 |
| No date or currency on the receipt | Next → Has a date? False | Merchant, Total and Expense category set; Purchase date and Currency left as they were; name unchanged; moved to Receipts/Needs review |
| Total not readable | Error: ai_required_missing | Nothing set; moved to Receipts/Needs review; run Completed with errors |
A merchant read as Harbor Hardware / Garden became Harbor Hardware - Garden in the name.
Troubleshooting
| Problem | Cause and fix |
|---|---|
| Most receipts end in Needs review | The model can't read the photo. Use a model that reads text better, photograph receipts flat and well lit, and check the run's Missing values. |
ai_model_missing_feature | The model doesn't take images. Choose a vision model. |
| Expense category is always Other | AI classify found no category or failed. Open the run: a failure shows its error, and No category fits means the descriptions need work. |
Currency is a symbol, such as $ | The model didn't follow the description. Add Answer with a three-letter code to it, or make Additional instructions say so. |
| A field you corrected is overwritten on the next run | Only if Fields a person set in the workflow's Settings is Replace them. By default workflows keep values a person set. |
input_missing on Rename or Keep the details | A template uses a value that wasn't found, without default or optional. Add one, or make the value Required. |
| A receipt was filed in the wrong month | The model read another date, such as a return-by date. Sharpen the Purchase date description, then move the file and correct the field in its details. |
| Receipts weren't processed at all | They were uploaded into a subfolder, or into another folder. The trigger only watches Receipts itself. |
Make it your own
More details
Add values to Read the receipt, such as Tax (Number), Payment method (Text) or Items (List of text), create matching fields, and add a Set field for each.
Find receipts by field
Each receipt's details show its fields, marked as set by the workflow, and you can correct them there. Scripts can list receipts by field through the API, such as every Dining receipt; see Filtering by a field.
Notify on large purchases
Add a Condition after the Set field steps with Read the receipt › Total is greater than 200, and a Send notification on True. See Send rich Discord notifications.
Catch receipts anywhere
Instead of a Receipts folder, start with an AI detect step asking Is this a receipt, invoice or order confirmation? on every image, and continue on Yes. See AI detect. Every image is then sent to the model.
Read receipts with OCR first
With Avenvail OCR running, a text-only model can read receipts, and the photo never goes to the AI service: only its text does.
- Between Load content and Read the receipt, add Extract text with Preset set to Document, which keeps each amount on the line with its label.
- In Read the receipt, remove the image input, click Add text input, and set Text to Extract text › Text. Do the same in Expense category.
- Give the values clear Descriptions, such as The final total, on the line that says TOTAL, because OCR text loses the receipt's columns.
On the sample, Document read every line with its amount, such as TOTAL USD 15.98 (verified). Automatic dropped the right-hand column of amounts, so don't use it for receipts. Photos taken at an angle or in poor light read less reliably than scans; check Confidence on Extract text in a test run. Connect Extract text's No text found path to Needs review as well.
Privacy, cost and reliability
- Receipts show what you bought, where and when, and sometimes part of a card number. Each photo is sent twice, to AI extract and AI classify, at the address of your AI connection. Use a local model to keep them on your network.
- With a hosted service, each receipt costs two requests with an image. Set Tokens a day on the connection to cap spending.
- AI reads numbers wrongly sometimes. The original photo is never changed, the summary says the values were read by a workflow, and each field shows that a workflow set it, so check before you rely on a value for anything that matters.
- An intake workflow that also handles these uploads changes the photo before it's saved. Resizing to 2560 pixels keeps receipts readable; heavy compression may not.