Skip to content

Pipeline Flows

All flows are orchestrated with Prefect 3.x and defined in src/pipeline/.

Flow Overview

Flow Trigger Description
generate_briefs Manual Creates article briefs from backlog items
produce_article Manual Full lifecycle: research, write, quality gates, review
batch_produce Manual Parallel article production with bounded concurrency
publish_articles Manual Publishes approved articles to WordPress as drafts
research_news_scan Weekly (Sun 6AM UTC) Scans RSS feeds, triages relevance, writes digests
check_cornerstone_updates Periodic Updates cornerstone articles with new satellite content

Article Production Flow

The produce_article flow is the core pipeline. It chains the following steps:

graph TD
    A[Brief] --> B[Researcher]
    B --> C[Writer]
    C --> D[Quality Gates]
    D --> E{All pass?}
    E -->|No| F[Synthesis]
    F --> G[Rewrite]
    G --> D
    E -->|Yes| H[Ready for Review]

Quality gates run in parallel:

  • Factuality Checker — validates medical claims against research dossier
  • SEO Optimizer — checks keyword density, heading structure, meta descriptions
  • Readability — evaluates reading level and clarity

The synthesis agent reconciles feedback from all quality gates. If any gate fails, the writer rewrites the article (up to 3 iterations).

Research News Flow

The research_news_scan flow runs weekly:

  1. Feed scanning — fetches RSS feeds from configured medical journals
  2. Triage — AI classifies each item's relevance to tinnitus
  3. Digest writing — produces a summary article from relevant items
  4. Cornerstone check — flags cornerstone articles that may need updating

Deployment Configuration

Flows are deployed via prefect.yaml at the repository root. See Deployment for setup instructions.