I expected to write a note about moving SkyJourney’s data processing from Laravel to Cloudflare Workers. That isn’t what the history says. The one piece of processing that moved went the other way, from a Worker back into Laravel. The Worker I added afterwards replaced nothing. It does a job Laravel can’t do safely.
So this note is about where the line ended up, and why.
v1: parsing email at the edge
SkyJourney users can forward a booking confirmation to an address, and the flights appear in their logbook. The first version, in March 2025, did everything in an Email Worker, with a small Workers AI model pulling the flights out. Laravel only had to save them. It looked tidy, and it had problems:
- The model was small. Asked politely for “only JSON”, it doesn’t always return only JSON, and there was no error path.
- Airline emails are messy. Some booking details come as PDF attachments, and many emails use old charsets. All of that needs proper libraries.
- The interesting logic ran where I couldn’t test it alongside the rest. Deciding that a parsed flight is a duplicate needs the user’s flights. Those live in Laravel.
v2: the Worker forwards bytes, Laravel reads them
In June 2026 parsing moved into Laravel, with a queued job and a model call that switched from Workers AI to Claude Haiku the same day.
The Worker went from parsing emails to two decisions. First, is the sender real? It checks the authentication results that Cloudflare’s own mail routing adds. If the check fails, the message is dropped quietly rather than bounced, because a bounce would go to the forged address, the person being impersonated.
Second, it hands Laravel the message exactly as it arrived, so the backend’s parser sees the original charset. If the backend can’t take it, the sender gets a bounce, not silence.
That turned out to be the right shape for an edge function. It sits where email arrives, makes one decision with information only it has, and passes the bytes on untouched.
Where a Worker does earn its place
In October I added “Ask your logbook”, where a model writes SQL to answer questions about your own flights. Running model-written SQL against the main MySQL database, even read-only and even with a filter, means trusting that every query keeps its filter on the user. I didn’t want to rely on that.
A SQLite-backed Durable Object per user removes the question. Each one holds a copy of one person’s flights, so even a perfectly malicious query can only see that person’s flights. Here the Durable Object isn’t a performance trick. It is the security boundary. Its own note covers the rest.
Laravel stays the source of truth
Everything stateful or rule-heavy stayed in Laravel: auth, quotas, currency rates, conversation history and account deletion. The Worker’s copy is explicitly disposable. It is built in full the first time a user asks, then kept current by pushing only what changed. If it ever drifts, the next question notices and it gets rebuilt. Nothing there has to be perfect, only cheap.
The column list is a contract between the JavaScript Worker and the PHP backend, with a schema version both sides must agree on. On a mismatch, the copy drops its tables and asks for a rebuild, and the rule is to deploy the backend first.