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:
- The cloud CAN think. The "credential lives on one Mac" premise was wrong:
claude setup-token mints a long-lived subscription credential that can live
in cloud secrets. Still never a metered key. The "cloud never thinks" principle below is kept as
history — it no longer holds.
- Email capture → option B: the Gmail read-only login token moves into Cloudflare
secrets; a scheduled Worker polls. (Not the inbound-mail subdomain.)
- Where AI thinks → inline in the Worker — the same pattern as Sparkle, the invoice
Worker this architecture copies: classify, score, draft, and chat run as direct Claude calls
from the Worker on the subscription token. No queue for the Mac, no container. This also
unblocks chat (Decision 5) with instant answers.
- Truth → the Cloudflare database only. The nightly GitHub mirror is dropped; repo
files seed the database once and become history.
- Console → option A: a real app on the Worker behind the same team login as this docs
site, living in the sales-machine repo (out of propflow-docs). Static page publishes until parity.
- Unchanged: nothing outbound moves without a human yes.
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
AReceive, 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.
BMove 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.
CKeep 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
ASplit 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.
BBridge 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.
CUse 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
AD1 (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.
BGit 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
ARebuild 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.
BKeep 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).
AShip 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.
BCarve 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.
CDefer 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
| Fact | State |
| Account + zone | One account, propflowai.co on the free plan; DNS mostly points at Vercel |
| Docs site | Already a Cloudflare Pages project behind Cloudflare Access — the login pattern v2 reuses |
| Deploy path | GitHub Actions with a stored token; this Mac currently can't deploy directly (fine — CI is the right path anyway) |
| API token on this Mac | DNS/tunnels only — a new scoped token is needed for Workers/D1 work |
| Plan needed | Workers 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
- The live DNS test for inbound mail, then the Workspace auto-copy rule (unblocks 1A).
- The Worker + database skeleton, deployed from GitHub, with the nightly git export.
- Email ingest moves to the cloud clock — the watcher we shipped this week, re-homed.
- Second signal source: the daily read of the team transcript channel — when Sean says
"I'll follow up with X" in a meeting, it becomes a task on the platform.
- The board as a real app: drag saves, approval queue, live records.
Until the cloud clock exists, the email watcher stays run-on-demand — nothing
gets scheduled on the Mac.