Workers
Publishing
Minute-level publisher. Scans an external content queue plus a workspace-scoped queue every minute, pulls due posts, fetches the video or image bytes from R2, posts via the unified-connector integration project, and persists publish events for the dashboard.
Updated today
Overview
At a glance
- Worker
ultron-publish- Trigger
* * * * *(every minute)- D1
ultron-publish-db- R2
ultron-publish-assets(transient buffer)- Connector project
- content_engine (siloed)
- Output
- One publish_events row per attempt, success or failure
The publisher is intentionally dumb. It does not pick what to post or when; that is the marketing swarm's job upstream. All it does is: at the right time, take a row, fetch its asset, push it to the channel via the connector, record the result.
Worker shape
wrangler.toml (key bindings)toml
Queue sources
| Source | How it is consumed |
|---|---|
| Workspace content_queue table | Per-row status pulled to 'sending' under a row-level lock. Status advances through 'sent' or 'failed'. |
| External content repo (read-only poll) | Every tick checks for new directories under content/youtube/queue/. Each new directory is enqueued as a row in content_queue. |
Note
The external repo is treated as an append-only feed. The worker only reads; it never writes back. New directories surface as queued rows whose payload references the path; the worker then fetches the actual bytes when the row's due time arrives.
Publishing flow
publish flowtxt
Supported channels
| Channel | Notes |
|---|---|
| YouTube | Long-form video uploads with title + description + tags. Supports unlisted scheduling via the connector. |
| Reels + carousels via the connector's Instagram graph API surface. Captions support hashtag lists. | |
| TikTok | Video upload via the connector. Caption with hashtags. |
| Native post (text + media). Page-level posts only in v1. | |
| X | Native post (text + media). Threaded posts post each message sequentially. |
| Subreddit post. Honours per-sub link / text constraints. |
Retries and dead-lettering
Warning
A failed post moves to status='failed' after three attempts. The dashboard surfaces failed rows; the operator chooses to retry, edit, or discard. No automatic eternal retries - failed publishes often indicate a connector auth lapse that needs human attention.
ultron-publish-db.publish_eventssql
File map
cf-workers/ultron-publish
wrangler.toml
src
index.tsscheduled() loop
poll.tsexternal-feed polling
publish.tsper-row publish path
channels
youtube.ts
instagram.ts
tiktok.ts
linkedin.ts
x.ts
reddit.ts
migrations
0001_content_queue.sql
0002_publish_events.sql