Sales Machine v2 — cloud architecture

Move the machinery off Fede's Mac and into our Cloudflare account, so the pipeline keeps itself true without a laptop being awake. Verified against Cloudflare's own docs and our actual account, 12 Aug 2026.

Decided 12 Aug 2026 — build underwayDecisions locked below

Decisions locked — 12 Aug 2026, evening

Fede reviewed this page live and decided everything. What changed from the proposal:

Shipped the same night: the build merged after an independent ten-finding review (all fixed, boot proven locally first), and the Worker is live — board with real drag-saves, approval queue, and the inline brain answering pipeline questions on the subscription token, verified end to end in production. Still to come: the Gmail secrets onto the Worker (then the hourly inbox watcher wakes), the pretty address under the docs domain with the team login, and the one-time CI deploy token. The interim address and sign-in token live with Fede.

Why now

Three forces, all hit this week: Fede doesn't want production jobs running on his Mac mini; the email watcher we just shipped needs a scheduled home; and the board's drag-and-drop still can't save because the console is a static page with no server behind it. One cloud home fixes all three, and we already pay for the account (propflowai.co is on Cloudflare DNS; the docs site already runs on Cloudflare Pages behind Cloudflare Access).

The one constraint that shapes everything

The AI brain stays on the Mac. Our hard rule says every AI call runs on the Claude subscription — never a metered key — and that credential lives on one Mac and refreshes hourly. Cloud servers have no allowed credential to think with.

So the design principle for v2: the cloud never thinks. It receives, stores, schedules, and shows. Anything needing judgment (scoring a call, drafting a proposal, classifying a message) becomes a job in a queue that Fede's Mac picks up when it's on. Nothing outbound moves without a human yes — that floor is unchanged.

Proposed shape

Email (auto-copy rule) · Slack transcripts · board drags
↓ arrive at
One Cloudflare Worker — the API + the hourly clock
↓ writes to
D1 database (prospects, stages, tasks) · R2 (raw emails, files) · Queues (thinking jobs for the Mac)
↓ shown by
The console as a live app — same design, gated by Cloudflare Access, drag saves for real
↓ mirrored to
GitHub, nightly — every change exported as a commit, so the audit trail stays a diff

Cost: the $5/month Workers Paid plan from day one (the free tier's 10-millisecond compute cap is unworkable). Everything at our scale — hundreds of records, a handful of users — fits comfortably inside what that $5 includes.

Decision 1 — how email gets captured

A
Receive, don't poll: a Cloudflare inbox address on a subdomain (e.g. crm@inbox.propflowai.co), auto-copied on prospect mail by a Google Workspace routing rule. A Worker fires per message with full content. The Gmail pull we shipped this week becomes the nightly double-check.Recommended
Instant, no password-fragile tokens in the cloud, byte-exact audit copy. One unknown: Cloudflare receiving on a subdomain while Google keeps the main domain's mail — docs don't address the mixed case. Needs a 30-minute live DNS test before we commit.
B
Move the Gmail password-less login token into Cloudflare secrets and poll from a scheduled Worker.
Works today, but dies silently if Fede changes his Google password, and Google's rules for the mail-reading permission add re-verification chores.
C
Keep pulls on the Mac, run by hand or by a session.
What we have now. Fine as a bridge, but it's the laptop-dependence we're trying to end.

Decision 2 — where the AI thinks

A
Split plane: cloud queues the thinking jobs, the Mac works them on the subscription and posts results back.Recommended
Needs no new permission and no credential leaves the Mac. Jobs wait patiently when the Mac sleeps; nothing breaks.
B
Bridge the subscription credential to the cloud on an hourly sync.
Ships a personal login to shared infrastructure — a policy call, not an engineering one, and it still breaks when the Mac sleeps.
C
Use a metered Claude API key in the cloud.
Forbidden by our own standing rule. Listed only for completeness — choosing this means changing the rule first.

Decision 3 — where the truth lives

A
D1 (Cloudflare's database) holds live truth; a nightly job exports everything back to the git repo as a commit.Recommended
Real multi-writer safety for the two paths that collide today (email moves a lead while someone drags the same card), while the repo keeps the reviewable, diffable history we rely on.
B
Git stays the only truth; the cloud writes by opening pull requests through the GitHub API.
Preserves today's model exactly, but every drag becomes a minutes-later merge — the board would still feel fake.

Decision 4 — what happens to the console

A
Rebuild it as a small live app on the Worker, behind the same Cloudflare Access login as the docs site: real drag-saves, the approval queue, live records. Keep publishing the static page until the app reaches parity.Recommended
This is the "Board as a real app" direction already chosen (option C in the UX decision) — v2 is what finally makes it buildable.
B
Keep the static page; add only a tiny save-endpoint for drags.
Smallest step, but the approval queue and live records stay unbuildable, and we maintain two half-systems.

Decision 5 — chat in the app (added 12 Aug, evening)

Fede wants Sean to get a ChatGPT-style experience inside the sales app — ask about any prospect, refine an outreach draft conversationally. This is the one feature that stresses Decision 2: a chat box wants answers in seconds, and the "cloud never thinks" model answers in minutes (a job queued to the Mac).

A
Ship chat as near-real-time when the Mac is on: a persistent worker on Fede's Mac holds a live connection to the cloud and answers chat jobs immediately; when the Mac is off, the chat says so and queues the question.Recommended
Honest about the constraint, no new permissions, and in practice the Mac is on during working hours — which is when Sean chats.
B
Carve out one exception to the subscription-only rule: a metered API key scoped to the chat surface only, with a hard monthly budget.
True always-on chat, but it changes a standing rule — your call, not a default.
C
Defer chat to v2.1; ship drafting as a reviewed queue first.
Least risk; Sean gets draft generation now and conversation later.

What we verified about our account today

FactState
Account + zoneOne account, propflowai.co on the free plan; DNS mostly points at Vercel
Docs siteAlready a Cloudflare Pages project behind Cloudflare Access — the login pattern v2 reuses
Deploy pathGitHub Actions with a stored token; this Mac currently can't deploy directly (fine — CI is the right path anyway)
API token on this MacDNS/tunnels only — a new scoped token is needed for Workers/D1 work
Plan neededWorkers Paid, $5/month — free tier's compute cap can't run this

Needs a live test Cloudflare receiving mail on a subdomain while Google Workspace keeps the main domain: the docs are silent on the mixed case. Test before betting on Decision 1A. Unverified the exact free-seat limit on Cloudflare Access.

What lands in v2, in order

Until the cloud clock exists, the email watcher stays run-on-demand — nothing gets scheduled on the Mac.

PropFlow Docs