Docs/Publishing Workflow

Publishing Workflow

The complete backend flow from article generation to a successful publish on WordPress or Shopify.

Understanding how articles move from generation to publication helps you debug issues and understand system behavior.

Background job architecture

RankWriting uses Trigger.dev async job queues for article generation, preventing frontend request timeouts.

Frontend submits → API Route creates article record
               → Triggers background job → Returns article_id immediately
                                       ↓
                             generate-article job
                             (research + RAG + AI writing)
                                       ↓
                             enhance-article job
                             (images + video insertion)
                                       ↓
                             Article status → "ready"

Article status lifecycle

Status Meaning
generating Background job is running
pending Text generated, awaiting media enhancement
ready Fully generated and ready to publish
published Successfully published to WordPress / Shopify
failed Generation failed — can be retried

Publishing to WordPress

Clicking Publish sends a POST /wp-json/wp/v2/posts request via the WordPress REST API. SEO fields are written simultaneously (compatible with Yoast SEO and RankMath).

Publishing to Shopify

Articles are written via the Shopify Admin API (POST /admin/api/blogs/{id}/articles) to your selected Blog.

Retry logic

Failed generation jobs are automatically retried up to 2 times. If all retries fail, the article status becomes failed. You can manually trigger a re-generation from the Posts list.