03 · Target

Where we’re going

Same business logic, hosted on managed AWS primitives instead of a single VPS. The goal isn’t a rewrite — it’s removing the SPOF, centralizing secrets and making schedule + queue state observable.

EventBridge
cron schedules · replaces n8n triggers
HubSpot
CRM source · unchanged
Airtable Views
order sources · unchanged
Secrets Manager
central auth · rotation policy
ECS Fargate
ClawBot worker · auto-scale · multi-AZ
RDS Postgres
audit + idempotency state
CloudWatch + OTel
traces · metrics · logs
SQS DLQ
failed pipeline retries
task_queue_sales
Airtable · still SSOT for approval
robin_tasks
unchanged surface
Approval UI
Airtable interface · same UX
Outbound Send
Gmail · WhatsApp · HubSpot
Migration deltas

What changes vs today

ConcernTodayTarget (F5)Phase
ComputeSingle VPS 187.77.29.73ECS Fargate · multi-AZF3
Schedulingn8n scheduleTrigger × 16EventBridge rulesF4
AuthURL-embedded BasicSecrets Manager + IAMF2
TransportHTTP plaintextHTTPS + ALBF3
State / auditAirtable onlyRDS Postgres + AirtableF3
RetriesNone · cron just re-firesSQS + DLQF4
ObservabilitySSH + tail -fCloudWatch + OTelF2
Secret rotationEdit 16 workflowsManaged rotation policyF2

Stays the same

Airtable remains the SSOT for approval state, bot definitions and guardrails. The migration is infrastructure-only — playbook logic, prompts and the human review surface don’t change.

Scheduler choice

EventBridge vs Hub v2 @Cron

Two viable paths to retire the 16 n8n cron triggers. The diagram above shows EventBridge for symmetry with the rest of AWS, but the team is converging on Hub v2's NestJS scheduler because that infra already exists.

Option A · default

Hub v2 NestJS @Cron

Schedules live in apps/api alongside Hub v2's existing modules. Auth via Secrets Manager (already wired). Logs/metrics via CloudWatch + OTel (already wired).

Pros: zero new infra, git-versioned schedules, one deploy pipeline.

Cons: couples scheduler uptime to Hub v2 API.

Effort: 1 day per batch of 5 callers. See Hub v2 → n8n migration.

Option B · fallback

EventBridge rules

16 EventBridge rules target the Fargate worker via SQS. Decouples scheduler from API.

Pros: survives Hub v2 outages, native retry, cross-account ready.

Cons: extra surface to monitor, Terraform churn per schedule edit.

Effort: 2-3 days plus IaC. Keep on the shelf for the day cross-service triggers matter.

Sequencing

Migration order is non-negotiable

01
F2 · Secrets + Observability
Move the URL-embedded password into Secrets Manager. Add CloudWatch + OTel before touching compute, so the cutover is measurable.
unblocks: F3, F4
02
F3 · Compute + Transport
Containerize the FastAPI worker. Stand up ECS Fargate behind ALB with HTTPS. Run dual (VPS + Fargate) for one week with shadow writes.
deprecates: 187.77.29.73:8788
03
F4 · Scheduling + Retries
Replace n8n cron with EventBridge rules. Add SQS + DLQ between scheduler and worker. n8n stays only for non-ClawBot workflows.
deprecates: 16 n8n cron triggers
04
F5 · Hardening
Multi-AZ verified, autoscaling tuned, runbooks complete, on-call rotation live. Decommission VPS.
exit: SPOF removed