One-Shot Scheduled Pipeline
Trendwire is intentionally built as a backend job, not a long-running web service. Cron, Docker Compose, or an operator invokes the CLI for a single run, while a non-blocking lock prevents overlapping executions.
Backend case study
Backend editorial intelligence for Reddit. Trendwire runs as a scheduled pipeline that turns Reddit activity, historical context, and LLM analysis into structured editorial briefs.

trendwire --slot morning --email
fetch -> classify -> synthesize
write -> persist -> deliverSystem overview
Trendwire is a scheduled Python pipeline for turning noisy Reddit activity into structured, reviewable briefs. It avoids a web-app dependency by running as a one-shot backend job with a lock file, clear output artifacts, and deployable Docker execution.
Readable editorial output for each published run.
Structured run data with takeaways, candidates, and source comments.
Optional delivery after primary files and database updates complete.
Pipeline capabilities
The pipeline keeps ingest, analysis, persistence, and delivery explicit so each stage can be inspected and extended.
Trendwire is intentionally built as a backend job, not a long-running web service. Cron, Docker Compose, or an operator invokes the CLI for a single run, while a non-blocking lock prevents overlapping executions.
The application supports scheduled multireddit snapshots and manual Texas-wide search runs behind a shared source strategy. It fetches posts and comments, normalizes them into internal models, and keeps source-specific output paths and run labels separate.
Two LLM passes classify posts and synthesize a brief from classified threads, notable comments, and historical context. Deterministic rule scoring highlights firsthand, professional, and specific comments before synthesis.
SQLite stores runs, posts, comments, classifications, rule scores, final flags, ranks, and snapshot metadata. Published runs can blend the current snapshot with archived hourly runs to surface persistent storylines.
Each run writes validated markdown and JSON artifacts atomically. Published runs can update an index, render email text and HTML, send through Mailgun, and post Slack notifications without changing the core pipeline result.
Architecture
The system keeps source discovery, analysis, persistence, and delivery as explicit stages so each run can be inspected, retried, and extended without changing the whole pipeline.
Slot, source, cleanup, and delivery flags
Multireddit snapshots or manual Texas search
Classification, rule scoring, and synthesis
Runs, posts, comments, ranks, and flags
Markdown, JSON, email, and Slack artifacts
Generated output
Backend work is still visual when the outputs are clear. This section shows the shape of the generated brief alongside the delivery artifacts produced by each run.
Subject: Texas Morning Brief
Comment context, link, and editorial note render from structured data.
Generated artifacts
.mdHuman-readable brief.jsonStructured run payload.email.htmlDelivery-ready HTML email.email.txtPlain text fallbackImplementation
The core keeps provider contracts narrow and orchestration readable. The snippets below show how the pipeline separates source data, analysis, and provider-specific LLM behavior.
pythonclassifications = classify_posts_with_retry(
provider,
[thread.post for thread in threads],
)
analysis = run_analysis(
provider,
AnalysisInputs(
threads=threads,
historical_context=historical_context,
classifications_override=classifications,
),
)pythonclass LLMProvider(Protocol):
def classify_posts(
self,
posts: list[IngestedPost],
) -> list[PostClassification]: ...
def synthesize(
self,
classified_posts: list[ClassifiedPost],
notable_comments: list[NotableCommentInput],
historical_context: HistoricalContext | None,
) -> SynthesisResult: ...Under the hood
Trendwire is a Python backend application designed for reliable scheduled execution:
Built for the real workflow
Westnode builds focused products, automations, and backend tools around the way a team actually works.