marketingAI
A production full-stack AI marketing SaaS that combines Pydantic AI generation, human approval controls, durable job execution, and Cloudflare-hosted web and API services.
Project Context & Scope
- Company
- Roads Consulting Group US
- Role
- Automation Engineer / Full-Stack AI Lead
- Period
- Nov 2025 – Jul 2026
- Scope
- Full-stack AI SaaS, human approval workflows & cloud operations
Problem & Operational Bottleneck
Marketing workflows crossed AI generation, brand context, approvals, publishing, and channel integrations. Fragmented scripts could not provide one auditable path from request to reviewed output and asynchronous delivery.
Constraints & Requirements
- Human approval remained mandatory before publishing or external replies
- Long-running generation jobs required durable queue and failure states
- Brand context and structured outputs had to remain consistent across tools
- Production traffic had to move safely across web, API, queue, database, and object storage
System Architecture Lifecycle
Authenticated product requests enter Cloudflare-hosted web and FastAPI services
Cloudflare Queues records and dispatches long-running generation work
Typed dependencies and structured tools produce a reviewable result
Operators review generated content before external publication or replies
Approved work is delivered while PostgreSQL retains operational state
Detailed architecture diagram illustrating stages and transition safeguards for marketingAI.
System Architecture & Ownership
Built a React and TypeScript web application with a Python FastAPI backend and Pydantic AI agents. The current production topology runs web and API services in Cloudflare Containers, dispatches asynchronous work through Cloudflare Queues, and persists data and media in Neon PostgreSQL and R2.
Engineering Decisions & Rationale
- Used Pydantic AI for typed dependencies, structured outputs, and explicit tool contracts.
- Kept approval state and job history durable in PostgreSQL while Cloudflare Queues handles asynchronous dispatch and dead-letter routing.
- Containerized the web and API services and migrated the production runtime to Cloudflare while retaining documented rollback paths.
Reliability, Retries & Safeguards
- Pydantic request, response, and agent-output schemas make invalid states visible at service boundaries.
- Logfire and OpenTelemetry traces connect application requests to agent execution.
- Cloudflare Queues and its dead-letter queue preserve asynchronous job outcomes for recovery.
- Human-in-the-loop approval gates prevent generated content from publishing automatically.
Evidence & Production Outcomes
Shipped and maintained in live production at marketingai.roadscg.com, supporting multi-agent marketing generation workflows with strict schema safety and low-latency edge delivery.
Reflection & Engineering Learnings
The platform made a broader lesson concrete: agent complexity must be matched by explicit approval states, durable job records, and observable service boundaries.
Need a similar automation system?
Let's review your operational bottlenecks and design a reliable production pipeline.
AI Marketing Creative Engine
An AI creative pipeline for Listing Profit that reduced campaign turnaround from four hours to five minutes and approximate unit cost from $300 to $8 through retryable n8n orchestration, structured outputs and automated QA gates.
Open-Source AI ToolingAgent Bridge
A public MIT-licensed, local-first coordination protocol for durable messaging, shared tasks, and bounded handoffs between terminal AI agents.