Skip to Content

Fixing OAuth Expiry and Dead APIs in Blog Pipelines

How I moved queue state into native Odoo ORM and swapped dead image APIs for Cloudflare Workers AI.

Table of contents

No titles in the blog post

3 min read 78 views
Ready to read aloud (zero-cost browser voice)
QUICK REACTION

I woke up last month to find an automated publishing pipeline had stopped moving without throwing a single loud error. When I traced the logs, nothing exotic had broken: a Google Sheets OAuth refresh token had quietly expired after its testing window timed out, and an external image endpoint was returning 404 and 429 responses after an upstream model deprecation.

That failure taught me a clean lesson about automation design. Every extra third-party credential broker sitting in the middle of a workflow creates another silent failure mode. Instead of patching another token reminder onto the same fragile setup, I stripped the external moving parts out and rebuilt the pipeline around tools I already controlled.

Step 1: Moving Queue State Out of Spreadsheets Into Odoo ORM

Google Sheets is convenient for quick manual edits, yet using it as the state machine for automated publishing meant one expired OAuth token froze the entire workflow. Inside my human-governed publishing pipeline and Odoo blog extensions, moving queue state straight into ORM fields fixed that dependency overnight.

Storing drafts, subtitles, tags, and review flags inside the database gives each run atomic commits. If a node fails midway, the staging step leaves a clear trace right next to the record instead of stalling behind an expired third-party OAuth flow.

Step 2: Pinning LLM Endpoints and Pruning Workflow Logs

Self-hosted workflow engines like n8n run fast while database logs stay small, yet weeks of verbose execution telemetry quietly bloat SQLite storage. Adding a simple retention cleanup kept container I/O responsive without extra orchestration tools.

On the model side, I stopped pointing prompts at generic floating aliases. Pinning tested identifiers such as gemini-2.5-flash kept structured JSON outputs predictable across batches so downstream formatters did not choke on surprise schema shifts.

Most automation bugs are not exotic code problems. They come from chaining too many outside accounts into one job without an owner.

Step 3: Edge Cover Generation Without Extra Storage Hops

Sending generated images through multi-hop SSH scripts or bloated external APIs introduced both cost and brittle failure points. Routing image generation through Cloudflare Workers AI let me pull clean 16:9 output directly in memory, resize with Pillow to 1200px JPEG, and upload straight into ir.attachment.

Removing brittle external tokens, pinning explicit model IDs, and keeping state close to the database turned a silent recurring outage into a boring, predictable workflow I rarely have to touch. Browse more practical breakdowns on the engineering blog or test your stack posture with CoquiScanner.

EXECUTIVE ARCHITECTURE & ADVISORY View Interactive Resume (Ramon Rios Jr.) ↗
Hiring for a Senior / Principal Architect or Technical Leader?

Paste your Job Description to generate a tailored 2-page ATS resume, honest role alignment brief, and matched case studies in seconds.

Need Hands-On Architecture, Cloud, or AI Systems Delivery?

Book a focused architecture & strategy session covering migrations, infrastructure consolidation, or guardrailed AI pipelines.

Archive

Comments

Sign in to leave a comment
Extending Odoo Blogs Natively Without App Bloat
Shipping persistent votes, multi-part series navigation, audio playback, and JSON-LD in one clean addon.