Skip to content

Repository files navigation

content-pipeline

A ProAgentStore scheduled content generation agent. Runs daily at 6am UTC, picks a topic from your configured list, generates content via Workers AI, and stores it in R2.

What it does

  • Cron — fires daily at 6am UTC, picks the least-recently-used topic, generates content, stores JSON in R2
  • Topic management — add/list topics via API; round-robin selection ensures even coverage
  • Configurable — content type (blog/social/newsletter), tone, length, target audience, and AI model are all runtime-configurable without redeploying
  • R2 storage — each generated piece is a JSON object in pags-content-pipeline bucket under content/<timestamp>-<id>
  • DurableObject — stores topics list, config, and a content ID→R2 key index

API

POST /topics body: { "text": "..." } → add a topic
GET /topics → list all topics
GET /content ?limit=20&cursor=... → list generated content (newest first)
GET /content/:id → get a single piece by ID
GET /config → view current config
PUT /config body: { ...config fields } → update config (partial patch)

Config fields

FieldTypeDefaultOptions
contentTypestringblogblog, social, newsletter
tonestringprofessionalprofessional, casual, witty, inspirational, educational
lengthstringmediumshort (~150w), medium (~400w), long (~800w)
targetAudiencestringgeneral audienceany string
modelstring@cf/meta/llama-3.3-70b-instruct-fp8-fastany Workers AI chat model

Development

pnpm install
pnpm dev

To trigger the cron locally:

curl "http://localhost:8787/__scheduled?cron=0+6+*+*+*"

Deploy

Push to main — GitHub Actions deploys automatically via wrangler deploy.

First deploy: create the R2 bucket beforehand:

wrangler r2 bucket create pags-content-pipeline

Quick start

# 1. Add some topics
curl -X POST https://content-pipeline.proagentstore.online/topics \
-H 'Content-Type: application/json' \
-d '{"text": "The future of remote work in 2026"}'
curl -X POST https://content-pipeline.proagentstore.online/topics \
-H 'Content-Type: application/json' \
-d '{"text": "Why async communication beats meetings"}'# 2. Configure for your use case
curl -X PUT https://content-pipeline.proagentstore.online/config \
-H 'Content-Type: application/json' \
-d '{"contentType": "newsletter", "tone": "casual", "targetAudience": "startup founders"}'# 3. List generated content after the cron fires
curl https://content-pipeline.proagentstore.online/content

About

Scheduled content generation agent. Picks topics daily, generates blog drafts, social posts, or newsletters via Workers AI, and stores them in R2.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages