Skip to content
agents/en vrai

Build your monthly mileage reimbursement report from your calendar

On the 1st of every month, the agent reads the business trips logged in your Google Calendar, works out missing distances with OpenStreetMap, flags anything inconsistent and prepares an Excel file plus a draft email for your accountant.

L3 autonomousVerified sourceBased on official documentation we checked; not tested by us yet.Updated
Difficulty
Advanced
Setup time
≈ 2 h (estimate; the author quotes about 15 minutes of setup)
Estimated cost
n8n: €0 self-hosted or from €20/month (Starter, billed annually) + OpenAI API calls (gpt-4.1-mini in the template); OpenStreetMap: no key needed; Google Calendar, Dropbox and Gmail: existing accounts
Category
Small business & freelancers

⏱ Trigger

On the 1st of every month at 7 am (cron)

✋ Human approval

Test mode by default: the agent builds the Excel and emails you the summary, with no draft for the accountant and no table writes. Pick a past month for the trial, then switch to live mode. Even in live mode, the email to your accountant stays a draft that you review and send yourself.

→ Output

Monthly Excel file in Dropbox + Gmail draft for the accountant + email summary of points to check

Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).

01Connected tools

02What the agent does on its own

  1. step 01

    On the 1st of the month, reads last month's events from a Google Calendar dedicated to your trips.

  2. step 02

    Parses titles written as "Departure > Arrival, km, purpose" directly; other events ("Client visit in Bristol") go to OpenAI, which returns stops, kilometres and purpose, or says it isn't a trip, and never invents a place.

  3. step 03

    For trips without kilometres or to be checked, finds the places with Nominatim (one request per second) and the driving distance with OSRM, round trip unless the event says one way.

  4. step 04

    Runs three checks before anything goes out: written kilometres too far from the route (adjustable tolerance, 20% by default), the same trip logged twice on one day, too many kilometres in one day (500 by default); trips read by the AI are always listed for review.

  5. step 05

    Builds an Excel file with one row per day and saves it to Dropbox.

  6. step 06

    In live mode, records the month in a data table so the same month is never drafted twice, creates a Gmail draft for your accountant with the Excel attached and emails you a summary of what to check.

03Agent instructions

$ instructions.txt · replace the {VARIABLES}
> You read one event from the calendar where {BUSINESS} logs its business car trips, and you turn it into a trip. Date: {DATE}; title: {TITLE}; location: {LOCATION}; description: {DESCRIPTION}; usual departure: {HOME_BASE}. Rules: isTrip is false when it isn't a car trip (call, online meeting, reminder, day off). List the stops in driving order, the first being the departure. Never invent a place that isn't in the event or the usual departure. km only when written, otherwise 0. Short purpose taken from the event. oneWay is true only when the event says one way.

04Limits and legal points

The template was built for Italy: labels and emails in Italian, place search limited to Italy and the Europe/Rome time zone, all to be changed for your country. It applies a single rate per kilometre, whereas tax mileage scales (such as France's barème kilométrique) depend on things like engine power and yearly distance: have your accountant validate the rate and the calculation. The public Nominatim and OSRM services are free but limited (no heavy use, your app must identify itself, no service guarantee). Your calendar content is sent to OpenAI (GDPR). Requires an n8n version with data tables.

05In short

When does the agent run, and what does it produce?
Trigger: On the 1st of every month at 7 am (cron). Output: Monthly Excel file in Dropbox + Gmail draft for the accountant + email summary of points to check.
What stays under your control?
Test mode by default: the agent builds the Excel and emails you the summary, with no draft for the accountant and no table writes. Pick a past month for the trial, then switch to live mode. Even in live mode, the email to your accountant stays a draft that you review and send yourself. Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).
How much does it cost and how long does setup take?
Estimated cost: n8n: €0 self-hosted or from €20/month (Starter, billed annually) + OpenAI API calls (gpt-4.1-mini in the template); OpenStreetMap: no key needed; Google Calendar, Dropbox and Gmail: existing accounts. Setup time: ≈ 2 h (estimate; the author quotes about 15 minutes of setup), difficulty "advanced". Tools: n8n – Schedule Trigger, n8n – Google Calendar (via HTTP Request), n8n – Basic LLM Chain, n8n – OpenAI Chat Model, OpenStreetMap Nominatim (usage policy), OSRM (routing), n8n – Convert to File, n8n – Dropbox, n8n – Data tables, n8n – Gmail.

Answers taken from this recipe · updated 29 October 2026

06Source

https://n8n.io/workflows/21739-build-monthly-mileage-reimbursement-reports-from-google-calendar-with-openai-and-dropbox/

07Related recipes

Same category or same connected tools.

All recipes in "Small business & freelancers" →

→ monthly newsletter

3 agents en vrai.
Every month.

Three reproducible, sourced autonomous agents. No hype, no "top 100 tools". One-click unsubscribe.