Content Queue
The content queue is a holding pen. When jekcms generates a post automatically — from bulk AI generation, an n8n workflow, or an API call — the draft lands in content_queue instead of posts. An editor reviews it, approves it, and only then does it move into the live post table and (optionally) publish.
This separation exists for one reason: automated output needs a human gate. AI drafts are wrong often enough that auto-publishing is risky even when the model is good. The queue is that gate.
What the content_queue table holds
One row per pending item. Key columns:
id— queue item IDsource— where it came from (bulk,n8n,api,manual)source_ref— batch ID, workflow run ID, or API token IDtitle,content,excerpt— the draft payloadsuggested_category_id,suggested_tags— AI-proposed metadatastatus—pending,approved,rejected,publishedcost_cents— generation cost (for bulk/api sources)created_at,reviewed_at,reviewed_by
Approved items get copied into posts and linked back via posts.from_queue_id — you can always trace a live post back to its queue origin.
Submission sources
Bulk generation
Every item in a bulk batch writes to the queue when it finishes. See [Bulk generation](/docs/automation/bulk-generation).
n8n workflows
An n8n flow can POST to /api/v1/queue/submit with a Bearer token carrying the queue:write scope. Useful for external pipelines — scrape trending topics in n8n, run them through OpenAI, push the result into the queue for review.
Manual
Queue → Add manually opens a simplified editor. Use this when you want someone (a freelance writer, a team member without full publish rights) to drop drafts for your review without giving them direct access to posts.
Queue admin UI
Open admin/content-queue.php. Filters across the top: source, status, date range, cost range, category.
Each row has:
- Preview — opens the draft in a modal (read-only)
- Edit — full editor with all fields
- Approve — moves to
postsas draft (or published, depending on settings) - Reject — marks
rejected, keeps the row for audit - Bulk select — approve/reject multiple at once (useful after a 50-item batch)
The approval flow runs basic sanity checks first — minimum word count, required fields present, no broken shortcodes. Items that fail sanity are highlighted with a warning icon; you can still approve them, but the UI makes sure you notice.
Auto-publish rules
Under Queue → Settings → Auto-publish rules you can define filters that let specific queue items skip manual review. Each rule has:
- Source filter — apply only to items from
bulk/n8n/api - Category constraint — only auto-publish items suggesting one of these categories
- Time window — publish only within specific hours (e.g., 9am–5pm weekdays, avoid overnight spam storms)
- Minimum word count — ignore items shorter than N words
- Maximum cost — skip anything that cost more than $X to generate (sanity limit on runaway generations)
Rules are evaluated top-to-bottom; first match wins. Rules are opt-in and start disabled. Turn them on only when you've reviewed enough batches to trust the template.
If a queue item matches an auto-publish rule, the scheduler moves it to posts with status published and fires the post.published webhook exactly as if you'd hit Publish manually.
Export / import for backup
Queue → Tools → Export produces a JSONL file (one queue row per line). Useful for:
- Off-host archive — keep a copy of everything the AI ever drafted, approved or not, for future retraining
- Migration — pull the queue from a staging install into production after a new site launch
- Debugging — share a specific item with support without exposing DB access
Import runs the reverse, with a strict schema check. Items that already exist (matching by source + source_ref) are skipped unless you tick Overwrite on conflict.
Retention
By default the queue retains every row forever — approved items keep the link to their published post, rejected items stay for audit. If you generate thousands per month, you can set automatic pruning under Queue → Settings → Retention (e.g., "delete rejected items older than 90 days"). Approved items are never auto-pruned because posts.from_queue_id depends on them.
Practical flow
- Bulk batch runs overnight, 40 items land in the queue
- Morning review: open the queue, filter
source = bulk, sort by cost descending - Spot-check the three most expensive items (most likely to be over-elaborated)
- Approve the good ones in bulk, edit the mediocre, reject the broken
- Scheduled publish trickles them out across the week