Skip to main content

Case study · Production AI SaaS

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.

Company
Roads Consulting Group US
Role
Automation Engineer / Full-Stack AI Lead
Period
Nov 2025 – Jul 2026
Visit marketingai.roadscg.com
Illustrative approval queue, not real product data. Draft A moves from draft to needs review to approved. Draft B needs review and is waiting at the human review gate. The reply draft is still a draft.
  • Generated posts and external replies require approval

    Human approval remained mandatory before publishing or external replies.

  • Failed jobs are kept for recovery

    Cloudflare Queues and its dead-letter queue preserve asynchronous job outcomes for recovery.

  • Agent outputs use schemas

    Pydantic request, response, and agent-output schemas make invalid states visible at service boundaries.

  • Runs on Cloudflare (Containers, Queues, R2)

    Containerized web and API services run on Cloudflare while retaining documented rollback paths.

Execution flow

  1. 01RequestWeb & API ContainersAuthenticated product requests enter Cloudflare-hosted web and FastAPI services
  2. 02DispatchDurable Async JobCloudflare Queues records and dispatches long-running generation work
  3. 03AgentPydantic AI ExecutionTyped dependencies and structured tools produce a reviewable result
  4. 04Approval gateApprovalHuman Review GateOperators review generated content before external publication or replies
  5. 05DeliveryChannels & Audit TrailApproved work is delivered while PostgreSQL retains operational state
marketingAI Multi-Agent Execution Flow

Problem

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.

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.

Constraints

  • 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

Decisions

  1. Used Pydantic AI for typed dependencies, structured outputs, and explicit tool contracts.

  2. Kept approval state and job history durable in PostgreSQL while Cloudflare Queues handles asynchronous dispatch and dead-letter routing.

  3. Containerized the web and API services and migrated the production runtime to Cloudflare while retaining documented rollback paths.

How it stays safe

Reliability

  • 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.
  • React
  • TypeScript
  • Python
  • FastAPI
  • Pydantic AI
  • Docker
  • Cloudflare Containers
  • Cloudflare Queues
  • Neon PostgreSQL
  • R2

Evidence

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.

Outcome Summary: Delivered and maintained a live AI SaaS that unifies generation, approval, publishing, and operational workflows behind one auditable product surface.

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.

Discuss the bottleneck

Oliver Rubio · AI systems, automation and integrations

Systems Evidence & Production AI Engineering · Bogotá, Colombia · Open to Remote

© 2026 Oliver Rubio. Selected outcomes are attributed in their case studies. Built with React, TypeScript & Vite.