The AI Agency Operating System: Sales, CRM & Ops Automation with n8n + Claude
- Client:
- AnvilEight (our own agency)
- Industry:
- Lead Generation | B2B SaaS
- Duration:
- 2024 — ongoing
- Team:
- 2 engineers
Most of our case studies are about client systems. This one is about our own. AnvilEight runs its entire commercial engine — winning work on a freelance marketplace, running the sales CRM, and monitoring company health — on roughly 40 production n8n workflows with Anthropic Claude as the reasoning layer. Three subsystems form a closed loop: an AI-scored proposal engine, a zero-touch sales CRM, and a daily company-health digest — every scoring rule validated against the system's own analytics, and human hours spent only where judgment is actually needed.
THE CHALLENGE
Three connected problems, one root cause: the people who should be building and selling were spending hours a day on repetitive operational work.
The marketplace grind
Winning work on Upwork means reviewing dozens of postings a day, deciding which are worth the bid fee, writing a tailored proposal for each, and tracking what happened afterwards. The economics are brutal — our own later analysis showed that ~65–75% of all marketplace jobs never hire anyone at all, so every proposal sent to a "dead" job is pure wasted money and effort.
Deals dying in the inbox
Inbound leads arrived by email, got a reply, and then lived only in someone's head. Multi-stakeholder threads, attachments with requirements, weeks of context — none of it landed in the CRM unless someone copied it there. A promising negotiation nobody touched for a week was a deal quietly dying.
The morning ops ritual
- Verify last night's backups actually ran
- Check who's on the bench, who's on leave
- Chase timesheets — missing hours mean delayed invoices
- Review the proposal funnel and stale deals
- All of it stitched together from 6+ separate tools, every single workday
OUR APPROACH
One automation nervous system built on self-hosted n8n with Claude as the reasoning layer — three subsystems forming a closed loop: the proposal engine wins work, the CRM tracks every conversation, and the daily digest reads both their outputs back to leadership. Every subsystem reports into a shared error-alerting workflow.
Design principles
- "AI judges, code decides" — the LLM extracts and rates; deterministic, reviewable code applies every threshold and veto
- Human-in-the-loop at the decision point — a person feeds the intake and sends every proposal; a logged one-word override beats the system when gut feeling says so
- Everything is measured — skipped jobs are stored with their full score breakdown, so the system knows how right it was to say no
- Simulate before production — rule changes are replayed against the full historical corpus before they touch a live workflow
SOLUTION 1 — THE AI-SCORED PROPOSAL ENGINE
There is no fragile job-feed scraper. A team member browsing the marketplace saves the job page and drops the HTML file into a private Telegram bot — a deliberately human-in-the-loop intake. The bot then triple-mines that single file: the visible job card becomes clean Markdown for the AI to read; the page's hidden framework data payload yields 30+ structured facts the eye would skip (client spend, hire rate, payment verification, bids, invites); and even the notification sidebar is harvested — "proposal viewed" entries flip tracking flags on past proposals for free.
Three-stage scoring
- LLM scoring (Claude Sonnet) — classifies the job into one of two service tracks, rates deliverable fit on a calibrated scale, applies text-pattern vetoes, and extracts ~15 raw facts under an explicit "extract, don't compute" rule
- Deterministic enrichment — a reviewable code node computes the effective hourly rate even for fixed-price jobs and evaluates hard arithmetic vetoes: an effective-rate floor, stale postings, clients who post but never hire, geography filters
- Decision — one interpretable formula produces Apply/Skip, plus a strict multi-condition boost flag (posting freshness, effective rate, client spending and hiring history) that identifies the ~6–10% of jobs worth paid bid boosts
Cover letters under a style contract
For jobs that pass, one of two persona agents (Claude Opus) writes the cover letter: 150–200 words, a fixed six-part structure, an opening that mirrors the client's own words, exactly one credibility line and one metric-backed hook, a "specific gotcha the client likely hasn't considered," ~14 banned AI-tell phrases, and a closing self-check that ends "Could NOT apply to 10 different jobs." The verdict lands back in Telegram within seconds; the human pastes, adjusts, and submits — keeping final authority.
Outcomes track themselves
- Hourly GraphQL sync of every submitted proposal into PostgreSQL — ~40 fields each
- A 2-hourly room watcher flips reply/hire flags and has archived 3,700+ client messages
- A Monday funnel email reports view, reply, hire, boost, dead and veto rates over 8 weeks and 6 months
- Even authentication self-heals — a cron workflow refreshes the marketplace OAuth token every 2 hours
SOLUTION 2 — THE ZERO-TOUCH SALES CRM
Every email a lead sends — or receives — lands in the Notion CRM, summarized, filed, and linked, without anyone touching it. A Gmail poller discovers relevant mail through two complementary paths (lead-tagged threads plus a per-contact search across every active contact's recent mail), and each message passes a three-layer dedup with at-most-once semantics before any AI runs.
- Contacts upsert themselves — every participant on a thread becomes a CRM contact; a previously-Cc'd stakeholder who later writes directly lands on the same deal, not a duplicate
- Deals upsert themselves — a three-way lookup resolves each message to its one open deal; Won/Lost deals are excluded, so a returning client correctly opens a fresh one
- AI writes the CRM behind an information firewall — Claude Haiku logs a one-sentence, verb-first summary per message; Claude Sonnet maintains two rolling contexts, deliberately split: the contact page holds relationship intelligence and is forbidden from project details, the deal page holds scope, budget and constraints and is forbidden from relationship notes
- Attachments file themselves — an importance heuristic drops signature images and calendar invites; real documents upload to Google Drive and render as an AI-titled, icon-tagged Files & Links section
- Nothing goes stale silently — any open deal untouched for 7+ days is flagged and floated to the top of the daily digest
Engineering the cost curve
- Model tiering — summaries and titling on Haiku; only the two rolling-context rewriters use Sonnet
- Scope the window, not the schedule — cutting the search window from 180 days to 14 and relaxing the poll cadence delivered ~16× less idle API churn with zero missed messages
- AI never runs on no-ops — pleasantries and scheduling emails cost zero writes
SOLUTION 3 — THE DAILY COMPANY HEALTH DIGEST
One message every weekday at 8:00 AM tells leadership exactly how the business is doing — before the first coffee. A cron trigger fans out to seven data streams in parallel and merges everything into one formatted Telegram message:
- Backups — the workflow doesn't trust backup jobs' own reporting: it lists the objects in two cloud buckets and asserts that yesterday's exact date-stamped artifact exists for each of 8 services. Silent backup failure became structurally impossible
- Bench & leaves — engineers active but unassigned today, who's off now and in the next 14 days, from the internal HR GraphQL API
- Timesheets — hours from per-employee Google Sheets plus Azure DevOps. Every employee formats their sheet differently, so Claude acts as a schema-inference layer: it emits a column mapping, then deterministic code does the arithmetic
- Sales funnel & pipeline — yesterday's and this week's proposal stats live from PostgreSQL, and the CRM's active deals with stale ones flagged on top
Around the digest sit the automations that close the loop: a monthly client-hours confirmation email before invoicing, AI CV screening scored against the job description, a Telegram task front-door, and a shared error funnel every production workflow reports into.
Resilience by design
- Per-source error isolation — a dead API blanks only its own section
- Every external call retries with backoff
- Graceful degradation — a partial digest always ships at 08:00
MEASURED, NOT GUESSED — THE ANALYTICS LOOP
Vetoed and skipped jobs are stored with their full score breakdown too, so the system can measure how right it was to say no. A monthly dead-rate analysis turns outcomes into scoring-rule changes, and an offline replay harness re-scores the entire historical corpus with a candidate rule set — reporting exactly how many hires it would have lost — before any parameter touches production. What the loop caught (all real):
- A pricing experiment, detected and reversed — a +30% bid experiment showed its cohort's view rate collapsing ~7.6pp worse than the market-wide decline, with zero hires. Rolled back on data, not gut feeling
- Vetoes with measured precision — the veto rules run at 76–82% precision, with false positives counted monthly against the economics
- Boost that actually pays — the boosted cohort converts replies to hires at 37.5% vs 7.9% for everything else — a 5–7× hire-rate lift
- Scoring v2, cut over safely — a simpler rubric shipped behind backward-compatible shadow fields; the next monthly analysis confirmed it held the dead rate while nearly doubling selectivity (apply rate 46% → 23%) — the same hires from half the connects spend
RESULTS & SCALE
3,400+ jobs AI-scored → ~1,300 proposals → 14 contracts won (live production
data, July 2026)
5–7× hire-rate lift on boosted proposals; dead-proposal waste cut
13.8pp
100% of lead email auto-filed into the CRM with AI summaries and rolling
context
6+ systems → 1 daily message; 8 backup artifacts verified every morning
Business results
- Proposal decisions cut from ~30 minutes of manual work to seconds of review
- ~52% of clients who viewed a proposal replied
- Selectivity nearly doubled (apply rate 46% → 23%) at equal hire volume — half the bid spend
- ~3–5 hours of manual checking eliminated per week (internal estimate), plus failed backups, idle engineers and dying deals caught the morning they happen
Engineering scale
- ~40 production workflows; ~260 digest runs a year
- 3,700+ marketplace messages auto-archived
- 1,000+ / 226 / 160+ saved revisions on the three core workflows — continuous hardening
- 100% success across the retained execution history
TECHNICAL CHALLENGES SOLVED
Challenge 1 — Timesheets nobody formats the same way
Problem: hours arrive as spreadsheet serial dates, day-fractions, or per-project strings — a different layout per employee.
Solution: Claude inspects each sheet and emits a column mapping; deterministic code does the arithmetic. Cheap, auditable, robust to any layout an employee invents.
Challenge 2 — Changing scoring rules without gambling production
Problem: a bad threshold change silently costs real hires.
Solution: the offline replay harness re-scores the full historical corpus with the candidate rules first — changes ship only when the simulation clears the bar.
Challenge 3 — Never processing the same email twice
Problem: pollers, webhooks and multi-path discovery mean the same message can arrive many ways.
Solution: a three-layer dedup — a message-level seen-registry marked before processing, one contact per email, one open deal per lead.
Challenge 4 — Making always-on AI affordable
Problem: naive polling plus LLM calls on every message burns tokens on no-ops.
Solution: model tiering, a scoped discovery window (~16× less idle churn), and escape hatches so unchanged context costs zero writes.
TECHNICAL DETAILS
Roughly 40 production workflows on a self-hosted n8n instance, composed from small single-purpose sub-workflows with scheduled, webhook and Telegram triggers, cursor-paginated API loops, and a shared error-workflow every flow reports into. Claude is tiered by task: Opus for cover letters and full proposal documents (extended thinking), Sonnet for job scoring and CRM context synthesis, Haiku for high-volume summaries and titling — all with strict structured outputs.
Technologies used
- Orchestration: n8n (self-hosted) | sub-workflow composition | shared error routing
- AI: Anthropic Claude — Opus | Sonnet | Haiku | structured outputs with auto-fixing parsers
- Data: PostgreSQL | Notion (CRM, config, token vault) | n8n Data Tables (dedup registries)
- Integrations: Upwork GraphQL API | Gmail | Google Drive / Docs / Sheets | Google Cloud Storage | Azure DevOps | internal HR GraphQL API | Telegram Bot API | SMTP
- Patterns: human-in-the-loop override | "AI judges, code decides" | AI schema inference | three-layer dedup | offline replay before production | model tiering
THE OUTCOME
The compounding effect is the real product: the agency wins work, tracks every conversation, and audits itself daily at near-zero marginal head-count cost — the humans only make the judgment calls the system routes to them. Every scoring rule, threshold and experiment is validated against measured outcomes; failed experiments are killed on data and documented in code.
For AnvilEight it is also the product demo: the systems we sell to clients are the systems we trust to run our own company. When we propose an AI-scored pipeline, a zero-touch CRM, or an operations digest, we're describing something that has already made us money.
FREQUENTLY ASKED QUESTIONS
Can AI automation really run a company's sales and operations?
Much of it, yes — with humans kept at the decision points. AnvilEight runs its own commercial engine on roughly 40 production n8n workflows with Claude as the reasoning layer: marketplace jobs are AI-scored, cover letters drafted, every lead email filed into the CRM automatically, and company health verified every morning. People make only the judgment calls the system routes to them — every proposal is still reviewed and sent by a human.
How do you keep a human in control of the AI's decisions?
Through a strict "AI judges, code decides" separation: the LLM extracts facts and rates fit, deterministic code applies every threshold and veto, and the verdict is a recommendation a person acts on. Proposals are pasted and submitted by a human, a one-word override can force past the scoring for gut-feel jobs, and every override is logged and measured like everything else.
How is an always-on AI system kept reliable and affordable?
Cost is engineered, not hoped for: fast, cheap models handle high-volume summaries while stronger models are reserved for work that compounds; AI is never invoked when a message brings nothing new; and tightening the discovery window and poll cadence cut idle API churn roughly 16-fold with zero missed messages. Reliability comes from per-source error isolation, automatic retries with backoff, and graceful degradation — the retained execution history shows a 100% success rate.
Can AnvilEight build a system like this for my business?
Yes — this is the same stack we sell: self-hosted n8n orchestration, Claude as the reasoning layer, and senior Python engineering underneath. Typical subsystems are lead scoring and proposal generation, a zero-touch CRM that files every email itself, and a daily operations digest that watches backups, timesheets, and pipeline. We run our own agency on it — the strongest proof we can offer.
Contact
Want an operating system like this for your business?
We build accountable AI automation on senior Python engineering — and we run our own company on it. See our AI automation services and Python automation services, or get in touch.
Contact us