Disclaimer: This content is for informational purposes only and is not financial, legal, or professional advice. It may include AI-generated material and inaccuracies. Use at your own risk. See our Terms of Use.

n8n + Claude + WordPress REST API: An AI Pipeline That Drafts 30 Posts a Day Without Tripping Rate Limits

n8n + Claude + WordPress REST API: An AI Pipeline That Drafts 30 Posts a Day Without Tripping Rate Limits

n8n + Claude + WordPress REST API: An AI Pipeline That Drafts 30 Posts a Day Without Tripping Rate Limits

Quick Answer

  • An AI content pipeline chains three parts: n8n (the orchestrator), the Claude Messages API (the writer), and the WordPress REST API (the publisher), with every post created as a draft for human review.
  • n8n’s HTTP Request node calls Claude with a system prompt, parses the JSON response, then POSTs to /wp-json/wp/v2/posts using an Application Password.
  • You avoid rate-limit errors by queuing jobs, adding exponential backoff on HTTP 429, and spacing requests under your Anthropic tier’s per-minute token budget.
  • Duplicate posts are prevented by checking the slug with a GET ?slug= query before any write, so a re-run never publishes the same article twice.

A content pipeline sounds like infrastructure for a 50-person team. It is not. Three open building blocks, wired in an afternoon, can take a topic list and return reviewable WordPress drafts.

This walkthrough uses n8n for orchestration, Claude for generation, and the WordPress REST API for delivery. Every architectural choice below is about one thing: getting volume without breaking rules or duplicating posts.

The throughput target here is roughly 30 drafts a day on a single workflow. That number is not a hard limit; it is the comfortable ceiling before rate limits and review capacity, not the API, become the real constraint.

Treat the whole system as a draft factory with a human gate at the end. The automation handles the tedious assembly, and a person still decides what ships, which is the arrangement search engines and readers both reward.

What is an AI content pipeline, and why route it through n8n?

An AI content pipeline is an automated chain that turns an input (a keyword or brief) into a finished draft without manual copy-paste between tools. n8n is the orchestrator that connects each step.

n8n is a fair-code workflow automation tool you can self-host. It ships with a generic HTTP Request node, webhook and cron triggers, and a queue mode for parallel execution.

The appeal over a single script is visibility. Each node shows its input and output, so when Claude returns malformed JSON or WordPress rejects a payload, you see exactly which step failed and why.

Pro Tip: Run n8n in queue mode with Redis once you cross a few concurrent jobs. The default single-process mode blocks the whole workflow while one long Claude call finishes, which throttles your real throughput more than any API limit.

What is an AI content pipeline, and why route it through n8n?

How do you connect Claude to n8n?

You connect Claude through n8n’s HTTP Request node pointed at the Anthropic Messages API endpoint, https://api.anthropic.com/v1/messages. The node holds your API key as a credential, never in the workflow body.

The request carries three required headers: x-api-key, anthropic-version, and content-type: application/json. The body specifies a model, a max-tokens limit, a system prompt, and the user message built from your brief.

The system prompt is where article quality lives. It defines voice, banned phrases, heading rules, and an explicit instruction to return structured output.

Ask Claude to return a JSON object with title, slug, html, and meta_description fields. A predictable shape lets the next n8n node map values directly into the WordPress payload.

Set max_tokens high enough to fit a full article without truncation. If the response cuts off mid-tag, the HTML breaks and WordPress renders a half-finished post, so leave headroom above your longest expected draft.

One detail saves hours of debugging: instruct the model to emit raw JSON with no markdown fences. A response wrapped in a code block fails the parser, and an explicit “no backticks” line in the system prompt removes that failure mode.

Pipeline stagen8n nodeWhat it does
TriggerCron / WebhookPull the next brief from a Google Sheet or database row
GenerateHTTP Request → ClaudeSend system prompt + brief, receive JSON article
DedupeHTTP Request → WordPressGET ?slug= to confirm the post does not exist
PublishHTTP Request → WordPressPOST as status: draft for review

How do you push drafts to WordPress with the REST API?

You push drafts by sending a POST to /wp-json/wp/v2/posts with a JSON body that sets status to draft. WordPress returns the new post ID and edit link on success.

Authentication uses an Application Password, a WordPress core feature since version 5.6. You generate one under Users → Profile, then send it as HTTP Basic auth over HTTPS, separate from the login password.

The minimum body needs title, content, and status. Add slug, excerpt, and categories (an array of category IDs) to land the post in the right cluster.

Category IDs trip up first-time builders. The REST API wants numeric term IDs, not category names, so fetch them once from /wp-json/wp/v2/categories and store the mapping in your n8n workflow instead of hard-coding guesses.

Test the call against a staging site before pointing it at production. A LocalWP install or a dev subdomain lets you confirm the auth, payload, and category mapping all work without risking a single stray draft on the live site.

Pro Tip: Set status: draft as a hard default in the n8n node, not a variable. A single typo that flips a batch to publish can push 30 unreviewed posts live before you notice, and unpublishing them in bulk is far more work than reviewing a draft queue.

How do you connect Claude to n8n?

How do you stop the pipeline from tripping rate limits?

You stop rate-limit errors by respecting your Anthropic usage tier’s per-minute request and token ceilings, then spacing calls so a batch never spikes past them. The API returns HTTP 429 when you exceed a limit.

Per Anthropic’s published documentation, the Messages API enforces separate limits on requests per minute, input tokens per minute, and output tokens per minute, scaled by your usage tier. Long articles burn the token budget faster than the request budget.

The fix is a retry node with exponential backoff. On a 429, wait, then retry with a longer delay each time, honoring the retry-after header when present.

n8n’s queue mode helps here too. Instead of firing 30 requests at once, the queue meters them so concurrent calls stay inside your token-per-minute ceiling.

Read the rate-limit headers Anthropic returns on every response. They report how much of each budget remains and when it resets, which lets your workflow slow down before it hits a hard 429 rather than after.

Batch size is the lever most people miss. Processing briefs in small groups with a short pause between groups smooths the token curve, so the same 30 drafts complete without a single retry instead of stalling on a burst.

According to Anthropic’s published documentation, hitting a rate limit returns a 429 response, and clients should implement graceful retries with backoff rather than retrying immediately, which only deepens the backlog.

How do you prevent duplicate posts on re-runs?

You prevent duplicates by querying the target slug before every write. A GET /wp-json/wp/v2/posts?slug=your-slug returns an empty array if the post does not exist, and a populated one if it does.

Wire an n8n IF node after that check. If the array has any items, skip generation and move to the next brief. If it is empty, proceed to the Claude call and the POST.

This slug guard is your idempotency key. Re-running the same brief list becomes safe, because the pipeline writes each article exactly once no matter how many times the workflow fires.

The same pattern protects against partial failures. If the workflow crashes after generating ten of thirty drafts, you simply run it again, and the slug check skips the ten that already exist while finishing the rest.

Warning: Do not rely on the post title for deduplication. WordPress happily creates two posts with identical titles and auto-appends -2 to the second slug, so a title-only check will silently let duplicates through. Always match on the explicit slug.

How do you push drafts to WordPress with the REST API?

How much does it cost to run, and where do the tokens go?

The cost comes almost entirely from Claude’s input and output tokens, billed per million tokens at rates that vary by model. n8n self-hosted and the WordPress REST API add no per-call fee.

Output tokens dominate the bill for long articles, because a 2,000-word draft is several thousand output tokens while the prompt is usually smaller. Choosing a faster, cheaper model for routine drafts and a stronger model for pillar pieces controls spend.

System prompt length matters more than it looks. A large reusable prompt is sent on every single call, so trimming it from verbose to tight reduces input tokens across the entire batch.

Prompt caching changes this math when your system prompt is stable. Reusing a cached prefix across calls cuts the input cost of the repeated portion, which is exactly the part that otherwise scales linearly with batch size.

Track spend per draft, not just per month. Logging the token counts each response returns into your n8n run data turns cost into a number you can audit, so a sudden jump points you at the brief or model that caused it.

Token bucketDriven byHow to reduce it
Input tokensSystem prompt + brief, sent every callTighten the system prompt; pass briefs as short structured fields
Output tokensArticle lengthCap max_tokens; reserve premium models for pillars

What guardrails keep AI-assisted drafts review-safe?

The core guardrail is the draft-only rule: the pipeline never sets status: publish, so a human approves every post in the WordPress draft queue before it reaches readers. This satisfies Google’s preference for human oversight of AI-assisted content.

Per Google Search Central guidance, content is judged on quality and helpfulness regardless of how it is produced, but low-effort, unreviewed automation at scale risks being treated as spam. A review step is what separates a content pipeline from a content cannon.

Add a second guardrail for compliance. If any post carries an affiliate link, the FTC requires a clear disclosure, so bake a disclosure block into the template rather than trusting each draft to include it.

A third guardrail is fact-checking. Drafts can state confident numbers that no source supports, so a review pass that strips or softens unverifiable claims protects both accuracy and the trust signals search engines weigh.

Pro Tip: Have the Claude node also return JSON-LD Article schema as a separate field, then write it into a custom field your theme outputs in the head. You get structured data on every draft without a second API round trip.

Key Takeaway

A reliable pipeline is three nodes and two safety checks: n8n triggers, Claude writes structured JSON, WordPress receives a draft, a slug query blocks duplicates, and backoff handles 429s. Volume is the easy part. Drafts-only review and slug-based idempotency are what keep that volume from becoming a cleanup project.

Frequently asked questions

Do I need to self-host n8n, or can I use the cloud version?

Both work for this pipeline. Self-hosted n8n gives you queue mode with Redis and no execution caps, which matters at higher volume. The cloud version is faster to start and still supports HTTP Request nodes to Claude and WordPress.

Can I use the same setup with the OpenAI or Gemini APIs instead of Claude?

Yes. The only node that changes is the generate step, since n8n’s HTTP Request node can call any REST endpoint. You swap the URL, headers, and body shape, while the WordPress publish and slug-dedupe nodes stay identical.

How do I add a featured image to the draft?

Upload the image first with a POST to /wp-json/wp/v2/media, which returns a media ID. Then set featured_media to that ID in the post payload. It is two requests, so account for both against your rate budget.

Will Google penalize content drafted this way?

Per Google Search Central guidance, AI-assisted content is not penalized for being AI-assisted; it is judged on quality and helpfulness. The risk is publishing unreviewed, thin output at scale, which the draft-only review step is designed to prevent.

What happens if Claude returns broken JSON?

Add a parsing node with error handling right after the Claude call. If the JSON fails to parse, route the item to an error branch that logs the brief and retries once, so one malformed response never stalls the whole batch.


Last updated: 2026-06-03. Written and maintained by the DesignCopy editorial team, which builds and runs AI content automation pipelines across production WordPress sites.

About The Author

DesignCopy

The DesignCopy editorial team covers the intersection of artificial intelligence, search engine optimization, and digital marketing. We research and test AI-powered SEO tools, content optimization strategies, and marketing automation workflows — publishing data-driven guides backed by industry sources like Google, OpenAI, Ahrefs, and Semrush. Our mission: help marketers and content creators leverage AI to work smarter, rank higher, and grow faster.

en_USEnglish