02 · Current Flow

How tasks happen today

Cron schedules in n8n call the ClawBot FastAPI worker on a single VPS. The worker pulls contacts from HubSpot or Airtable, runs prompts, applies guardrails, and writes drafted messages to task_queue_sales for human approval. No event-driven triggers from Airtable. No webhooks between callers.

01
n8n Cron
scheduleTrigger fires (every X hrs/days)
🔌
02
HTTP POST
Basic auth URL → 187.77.29.73:8788
⚙️
03
Pipeline
/pipeline/list or /pipeline/orders
🧠
04
Draft + Guardrails
Bot prompt + 48+ rules + suppression
📥
05
Queue
Write to task_queue_sales (awaits approval)
Endpoints

Two verbs · sixteen callers

/pipeline/list

HubSpot-sourced · 13 workflows

Body: {list_id, playbook_id, source_workflow, enrich, [limit]}

HubSpot list_id drives the contact set. 7661 is shared by Close Lost, Deals Follow Up, Cross-Sell and Stale Contacts — they differ only by playbook_id.

/pipeline/orders

Airtable-sourced · 3 workflows

Body: {playbook_id, source_workflow, [view_id]}

Airtable view_id drives the order set. Used for rebooking and order-followup flows that depend on internal CRM state, not HubSpot lists.

POST http://clawbot:MTuh-F6t8VVES9hGjWZaDuLhd-2NQicO@187.77.29.73:8788/pipeline/list Content-Type: application/json { "list_id": "7661", "playbook_id": "recXXXXXXXXXXX", "source_workflow": "n8n-wf-id-here", "enrich": true, "limit": 25 }
Playbook Catalog

16 active playbooks

Source of truth: Workflows & Automations SSOT · tbl38RfIpWTRJKyiQ. Owner split: Jess 13 · Danny 3. Only TQ-01 is marked Active; the rest run in prod while flagged In Development or Spec Ready.

CodeEndpointSourceOwnerStatus
TQ-01/pipeline/ordersAirtable viewJessActive
RB-01/pipeline/ordersAirtable viewJessIn Dev
OF-01/pipeline/ordersAirtable viewJessIn Dev
CL-01 Close Lost/pipeline/listHubSpot 7661JessIn Dev
DF-01 Deals Follow Up/pipeline/listHubSpot 7661JessIn Dev
CS-01 Cross-Sell/pipeline/listHubSpot 7661JessIn Dev
SC-01 Stale Contacts/pipeline/listHubSpot 7661JessIn Dev
COLD-FAC-01 Facilities/pipeline/listHubSpot listDannySpec Ready
COLD Sustainability/pipeline/listHubSpot listDannyTrigger empty
COLD Procurement/pipeline/listHubSpot listDannyTrigger empty
+ 6 more · Jess/pipeline/listHubSpot listsJessIn Dev

SSOT desync

15 of 16 playbooks show Status: In Development or Spec Ready while Enabled=True and a cron is firing in production. Two COLD playbooks (Procurement, Sustainability) have empty Trigger and Approval fields. Reviewing dashboards alone will under-report what’s live.

Auth

One credential, embedded in every URL

All 16 callers use HTTP Basic auth embedded directly in the request URL. No abstracted n8n credential, no HTTPS, no rotation history.

Pattern

URL-embedded Basic

http://clawbot:MTuh-F6t8VVES9hGjWZaDuLhd-2NQicO@187.77.29.73:8788/pipeline/list

User clawbot · password is the same fixed token in every workflow. Timeout: 60s.

Implications

Rotation = touch 16 workflows

Rotating the password requires editing each n8n workflow JSON individually. There is no central credential vault. HTTP (not HTTPS) means the token travels in plaintext to 187.77.29.73.

Mitigation tracked in Risks · R-04 and the Phase F2 milestone in Roadmap.

What n8n actually does

Three roles · zero business logic

n8n is timer + HTTP client + low-code router. The drafting brain (prompts, guardrails, bot selection) lives in ClawBot FastAPI. Migrating these flows to a backend deletes n8n without losing logic.

Role 1 · 16 workflows

Cron scheduler for ClawBot

scheduleTrigger fires every X hrs/days → POST /pipeline/list or /pipeline/orders with HTTP Basic in URL. No transform. Just timer + auth.

Replaceable by: NestJS @Cron decorator + Secrets Manager. 1 day of work.

Role 2 · ~8 workflows

Event router for Operational Tasks

Receives webhooks (Gmail, forms, Slack) → parses → writes Airtable robin_tasks with PAT. Has logic: email parsing, rule-based routing.

Replaceable by: NestJS controllers + class-validator. 3-5 days.

Role 3 · misc

Integration glue

HubSpot ↔ Airtable sync, WhatsApp notifications, ad-hoc syncs. Mix of cron + webhook. Lowest priority, highest variety.

Replaceable by: NestJS services per integration. 1-2 weeks.

Why migrate

n8n today = 16 workflows that each duplicate the same HTTP Basic URL with the password in plaintext. Rotating credentials = editing 16 JSONs by hand. No central logging, no retry queue, no version control. Moving cron + router into the Hub v2 backend (NestJS) consolidates auth, gets git-based diffs, and lets the same team that ships Hub v2 own the schedules.