Branch8

How to Build a Content Automation Pipeline With AI: Step-by-Step

Matt Li
Matt Li
March 17, 2026
12 mins read
Technology
How to Build a Content Automation Pipeline With AI

Key Takeaways

  • Combine N8n, OpenAI API, and a headless CMS for end-to-end content automation
  • Always include a human review step to catch AI hallucinations and cultural missteps
  • Use structured JSON output from the LLM to avoid brittle text parsing
  • Add localization as a discrete pipeline step for multi-market Asian operations
  • A 100-article-per-month pipeline costs under $135 in platform fees

Quick Answer: A content automation pipeline combines an LLM (like OpenAI's GPT-4o or Anthropic Claude) with a workflow orchestrator (N8n, Make, or custom code) and a headless CMS to generate, review, and publish content at scale. This tutorial walks through building one end-to-end using N8n, the OpenAI API, Google Sheets for editorial planning, and Strapi as the publishing target — a stack that a small team can deploy in under a week.

What Is a Content Automation Pipeline and Why Does It Matter?

A content automation pipeline is a series of connected steps that take a content brief from ideation through AI-assisted drafting, human review, and final publication — with minimal manual handoffs between stages. Instead of a writer opening ChatGPT in a browser tab, pasting a prompt, copying the result into a Google Doc, then manually uploading to a CMS, the pipeline handles orchestration, formatting, metadata generation, and publishing via APIs.

The business case is straightforward: a regional e-commerce brand publishing across five Southeast Asian markets might need 200+ product descriptions, blog posts, and landing pages per month. Without automation, that requires a large content team. With a well-built pipeline, a two-person editorial team can review and approve output that would otherwise require eight to ten writers.

This is particularly relevant for companies operating across Asia-Pacific markets. Branch8 works with clients in Hong Kong, Singapore, Taiwan, Vietnam, Malaysia, Indonesia, and the Philippines — each market often requiring localized content. A pipeline that handles translation and cultural adaptation as discrete, automatable steps can compress weeks of work into days.

What Are the Prerequisites?

Before starting, make sure you have the following:

N8n instance
DetailsSelf-hosted or N8n Cloud Starter plan
CostFree to $24 per month
OpenAI API key
DetailsGPT-4o access with billing enabled
CostPay per token, roughly $2.50 per 1M input
Google Sheets
DetailsUsed as the editorial planning layer
CostFree with Google account
Strapi v5 instance
DetailsHeadless CMS as publishing target
CostFree self-hosted or Strapi Cloud
Basic API knowledge
DetailsUnderstanding of REST, JSON, webhooks
CostN/A
Node.js 18+
DetailsFor any custom function nodes in N8n
CostFree

You should also have a Slack workspace or similar messaging tool if you want approval notifications, though that is optional.

Expected Outcome After This Tutorial

You will have a working pipeline that:

  1. Reads content briefs from a Google Sheet
  2. Generates a draft using GPT-4o with structured prompts
  3. Generates SEO metadata (title, description, slug)
  4. Sends a Slack notification for human review
  5. On approval, publishes the content to Strapi via its REST API
  6. Marks the row in Google Sheets as "Published"

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 1: How Do You Structure the Editorial Planning Sheet?

Open Google Sheets and create a sheet named Content Pipeline with these columns:

A
Field Name`brief_id`
PurposeUnique identifier like BRIEF-001
B
Field Name`target_keyword`
PurposePrimary SEO keyword
C
Field Name`content_type`
Purposeblog, product, landing-page
D
Field Name`target_market`
PurposeSG, TW, VN, MY, ID, PH, HK
E
Field Name`tone`
Purposeprofessional, casual, technical
F
Field Name`word_count_target`
PurposeNumeric target like 1500
G
Field Name`status`
Purposequeued, drafted, review, published
H
Field Name`draft_url`
PurposeFilled by pipeline after drafting
I
Field Name`published_url`
PurposeFilled after CMS publish

Populate a few rows with status set to queued. This sheet becomes your single source of truth.

Expected outcome: A structured editorial calendar that the automation can query programmatically.

Step 2: How Do You Set Up the N8n Workflow Trigger?

In N8n, create a new workflow. Add a Schedule Trigger node that runs every hour (or use a Webhook node if you want on-demand execution).

For the schedule trigger, configure it as:

1{
2 "rule": {
3 "interval": [
4 {
5 "field": "hours",
6 "hoursInterval": 1
7 }
8 ]
9 }
10}

Next, add a Google Sheets node:

  • Operation: Read rows
  • Document ID: Your spreadsheet ID from the URL
  • Sheet Name: Content Pipeline
  • Filters: status equals queued

This pulls only briefs that have not yet been processed.

Expected outcome: Every hour, N8n fetches all rows with status = queued and passes them downstream as individual items.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 3: How Do You Build the AI Prompt Template?

Add a Code node (JavaScript) after the Google Sheets node. This transforms each row into a structured prompt:

1const items = $input.all();
2const results = [];
3
4for (const item of items) {
5 const d = item.json;
6
7 const systemPrompt = `You are a content writer for a company operating across Asia-Pacific markets. Write in a ${d.tone} tone. Target market: ${d.target_market}. Do not use clichés like "game-changing" or "revolutionary". Use specific examples and data where possible.`;
8
9 const userPrompt = `Write a ${d.content_type} article targeting the keyword "${d.target_keyword}".
10Target word count: ${d.word_count_target} words.
11Include:
12- An engaging introduction
13- 3-5 H2 sections with substantive content
14- A conclusion with a clear call to action
15
16Format the output as JSON with these fields:
17- "title": string (under 70 characters)
18- "body": string (markdown formatted)
19- "meta_title": string (under 60 characters)
20- "meta_description": string (under 155 characters)
21- "slug": string (URL-safe kebab-case)`;
22
23 results.push({
24 json: {
25 ...d,
26 system_prompt: systemPrompt,
27 user_prompt: userPrompt
28 }
29 });
30}
31
32return results;

Why Structured JSON Output Matters

Asking the LLM to return JSON rather than free-form text means downstream nodes can parse fields directly without regex extraction. OpenAI's response_format parameter enforces this.

Expected outcome: Each queued brief is now paired with a tailored system and user prompt.

Step 4: How Do You Call the OpenAI API for Content Generation?

Add an HTTP Request node configured as follows:

  • Method: POST
  • URL: https://api.openai.com/v1/chat/completions
  • Authentication: Header Auth with Authorization: Bearer YOUR_API_KEY
  • Content-Type: application/json

Set the request body:

1{
2 "model": "gpt-4o",
3 "response_format": { "type": "json_object" },
4 "temperature": 0.7,
5 "max_tokens": 4096,
6 "messages": [
7 {
8 "role": "system",
9 "content": "{{ $json.system_prompt }}"
10 },
11 {
12 "role": "user",
13 "content": "{{ $json.user_prompt }}"
14 }
15 ]
16}

Use N8n expressions (the {{ }} syntax) to inject the prompts from the previous node.

Handling Rate Limits

If you are processing more than 10 briefs per batch, add a Wait node (set to 3 seconds) between iterations to avoid hitting OpenAI's rate limits on Tier 1 accounts. Alternatively, use the Split In Batches node with a batch size of 3.

Expected outcome: The OpenAI API returns a JSON object for each brief containing title, body, metadata, and slug.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 5: How Do You Parse and Validate the AI Output?

Add another Code node to extract the generated content from OpenAI's response and validate it:

1const items = $input.all();
2const results = [];
3
4for (const item of items) {
5 const raw = item.json;
6
7 // Parse the content from OpenAI's response structure
8 const content = JSON.parse(
9 raw.choices[0].message.content
10 );
11
12 // Validation checks
13 const wordCount = content.body.split(/\s+/).length;
14 const titleLength = content.title.length;
15
16 const validationErrors = [];
17
18 if (wordCount < raw.word_count_target * 0.7) {
19 validationErrors.push(
20 `Word count ${wordCount} is below 70% of target ${raw.word_count_target}`
21 );
22 }
23
24 if (titleLength > 70) {
25 validationErrors.push(
26 `Title is ${titleLength} chars, exceeds 70 limit`
27 );
28 }
29
30 if (!content.slug || content.slug.includes(' ')) {
31 validationErrors.push('Invalid slug format');
32 }
33
34 results.push({
35 json: {
36 brief_id: raw.brief_id,
37 target_market: raw.target_market,
38 generated: content,
39 validation_errors: validationErrors,
40 is_valid: validationErrors.length === 0
41 }
42 });
43}
44
45return results;

Add an IF node after this to branch the workflow: valid items proceed to the review step; invalid items get routed to an error-handling branch that logs the issue and sets the Google Sheet row status to error.

Expected outcome: Only content that passes validation moves forward. Failed generations are flagged for manual attention.

Step 6: How Do You Add a Human Review Step?

Full automation without human oversight is risky — hallucinated facts, off-brand tone, or cultural missteps (especially important when publishing across multiple Asian markets) can damage credibility.

Add a Slack node that sends a review message:

1{
2 "channel": "#content-review",
3 "text": "New draft ready for review",
4 "blocks": [
5 {
6 "type": "section",
7 "text": {
8 "type": "mrkdwn",
9 "text": "*Brief:* {{ $json.brief_id }}\n*Title:* {{ $json.generated.title }}\n*Market:* {{ $json.target_market }}\n*Word Count:* {{ $json.generated.body.split(' ').length }}"
10 }
11 },
12 {
13 "type": "actions",
14 "elements": [
15 {
16 "type": "button",
17 "text": { "type": "plain_text", "text": "Approve" },
18 "action_id": "approve_content",
19 "value": "{{ $json.brief_id }}"
20 },
21 {
22 "type": "button",
23 "text": { "type": "plain_text", "text": "Reject" },
24 "action_id": "reject_content",
25 "value": "{{ $json.brief_id }}"
26 }
27 ]
28 }
29 ]
30}

Create a separate N8n workflow with a Webhook node that receives Slack interactive message callbacks. When a reviewer clicks "Approve," this second workflow triggers the publishing step.

Approval Workflow Configuration

In your Slack app settings:

  1. Go to Interactivity & Shortcuts
  2. Set the Request URL to your N8n webhook URL, e.g. https://your-n8n.example.com/webhook/slack-approval
  3. Slack will POST the button action to this endpoint

Expected outcome: Reviewers get a Slack notification with a preview and one-click approve or reject buttons.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 7: How Do You Publish to Strapi via API?

In the approval workflow, after receiving the Slack callback, add an HTTP Request node to create the content entry in Strapi:

  • Method: POST
  • URL: https://your-strapi.example.com/api/articles
  • Authentication: Bearer token (Strapi API token)
1{
2 "data": {
3 "title": "{{ $json.generated.title }}",
4 "slug": "{{ $json.generated.slug }}",
5 "body": "{{ $json.generated.body }}",
6 "meta_title": "{{ $json.generated.meta_title }}",
7 "meta_description": "{{ $json.generated.meta_description }}",
8 "target_market": "{{ $json.target_market }}",
9 "publishedAt": null
10 }
11}

Setting publishedAt to null creates the entry as a draft in Strapi v5. If you want it immediately live, set it to the current ISO timestamp.

Then add a Google Sheets node to update the original row:

  • Operation: Update row
  • Matching Column: brief_id
  • Fields to Update: statuspublished, published_url → the Strapi entry URL

Expected outcome: Approved content is created as a draft in Strapi, and the editorial sheet reflects the updated status.

Step 8: How Do You Add Multi-Market Localization?

For teams publishing across multiple Asian markets, add a localization step between generation and review. Insert another HTTP Request node calling the OpenAI API with a translation and adaptation prompt:

1# Pseudocode for the prompt logic
2system_prompt = """
3You are a localization specialist for the {target_market} market.
4Translate and culturally adapt the following content.
5Do not just translate literally — adjust examples, idioms,
6and references to be relevant to {target_market} readers.
7Maintain the same JSON structure.
8"""

For markets like Taiwan (Traditional Chinese), Vietnam (Vietnamese), or Indonesia (Bahasa Indonesia), this step converts the English draft into a localized version. The key is the instruction to adapt, not just translate — a product comparison referencing Black Friday deals would need different seasonal references for Southeast Asian markets.

Taiwan
LanguageTraditional Chinese
Common Adaptation NeedsLocal payment methods, seasonal events
Vietnam
LanguageVietnamese
Common Adaptation NeedsMobile-first formatting, local brands
Indonesia
LanguageBahasa Indonesia
Common Adaptation NeedsReligious and cultural calendar references
Singapore
LanguageEnglish
Common Adaptation NeedsSinglish tone option, SGD pricing
Philippines
LanguageEnglish or Filipino
Common Adaptation NeedsLocal marketplace references

Expected outcome: Each content piece can be forked into market-specific versions without separate manual writing processes.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

What Does the Complete Pipeline Architecture Look Like?

Here is the full workflow sequence:

1pipeline_stages:
2 1_trigger:
3 type: schedule
4 interval: hourly
5 2_fetch_briefs:
6 type: google_sheets_read
7 filter: status equals queued
8 3_build_prompts:
9 type: code_node
10 output: system_prompt and user_prompt per brief
11 4_generate_content:
12 type: http_request
13 target: openai_chat_completions
14 model: gpt-4o
15 5_validate:
16 type: code_node
17 checks: word_count, title_length, slug_format
18 6_localize:
19 type: http_request
20 target: openai_chat_completions
21 condition: if target_market is not EN
22 7_human_review:
23 type: slack_notification
24 actions: approve or reject
25 8_publish:
26 type: http_request
27 target: strapi_rest_api
28 9_update_sheet:
29 type: google_sheets_update
30 fields: status and published_url

What Are Common Issues and How Do You Troubleshoot Them?

Problem: OpenAI Returns Malformed JSON

Symptom: The Code node throws SyntaxError: Unexpected token when parsing.

Fix: Even with response_format: { type: "json_object" }, the model occasionally wraps output in markdown code fences. Add a cleanup step:

1let raw = item.json.choices[0].message.content;
2// Strip markdown code fences if present
3raw = raw.replace(/^```json\n?/, '').replace(/\n?```$/, '');
4const content = JSON.parse(raw);

Problem: Rate Limit Errors (429)

Symptom: HTTP 429 from OpenAI with rate_limit_exceeded.

Fix: Use the Split In Batches node with batch size 2 and a 5-second Wait node between batches. For high-volume pipelines (50+ briefs per day), consider upgrading to OpenAI Tier 2 or higher.

Problem: Strapi Rejects the Payload

Symptom: HTTP 400 with ValidationError from Strapi.

Fix: Check that all required fields in your Strapi content type are included in the payload. Common issues:

  1. The slug field must be unique — add a timestamp suffix if needed
  2. The body field must match the expected field type (Rich Text vs. Markdown)
  3. Strapi v5 requires the data wrapper object — v4 payloads will not work

Problem: Slack Buttons Stop Working

Symptom: Clicking Approve or Reject shows "This didn't work" in Slack.

Fix: Slack interactive message callbacks expire after 3 seconds if the webhook does not respond with HTTP 200. Make sure your N8n webhook node sends an immediate response. In N8n, set the webhook's Response Mode to "Immediately" rather than "When last node finishes."

Problem: Content Sounds Generic Across Markets

Symptom: Localized content reads like direct translation with no local flavor.

Fix: Improve the localization prompt with market-specific instructions. Include 2-3 examples of the desired tone and local references. For better results, use Claude 3.5 Sonnet for localization tasks — it tends to produce more natural-sounding translations for Asian languages than GPT-4o in our testing.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

How Do You Measure Pipeline Performance?

Track these metrics to evaluate and improve your pipeline over time:

Draft acceptance rate
How to MeasureApproved drafts divided by total
TargetAbove 70%
Average review time
How to MeasureTime from Slack notification to action
TargetUnder 4 hours
Cost per article
How to MeasureAPI tokens plus human review time
TargetUnder $3 for 1500-word post
Publish throughput
How to MeasureArticles published per week
Target5x pre-pipeline baseline
Error rate
How to MeasureFailed generations per batch
TargetUnder 10%

Add a Google Sheets logging node that records timestamps at each stage. After a month of data, you will have clear visibility into bottlenecks.

How Can You Extend This Pipeline Further?

Once the core pipeline works, consider these additions:

  1. SEO scoring integration — Add a node that calls the DataForSEO API or a similar tool to score the generated content against the target keyword before review
  2. Image generation — Chain a DALL-E 3 or Midjourney API call to generate a featured image based on the article title
  3. A/B title testing — Generate 3 title variants per brief and let the reviewer pick, or use a meta-title testing tool post-publish
  4. Analytics feedback loop — After 30 days, pull Google Analytics or Plausible data back into the sheet to correlate AI-generated content performance with prompts used
  5. Multi-CMS publishing — Add parallel HTTP Request nodes to publish the same content to Shopify (for product pages), WordPress, and Strapi simultaneously

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

What Is the Realistic Cost Breakdown?

For a mid-size operation producing 100 articles per month at approximately 1,500 words each:

OpenAI API (GPT-4o)
Monthly Estimate$40 to $80
N8n Cloud Starter
Monthly Estimate$24
Strapi Cloud (Starter)
Monthly Estimate$29
Slack (free tier)
Monthly Estimate$0
Human review labor (20 hrs)
Monthly EstimateVaries by market
**Total platform cost**
Monthly Estimate**$93 to $133**

Compare this to the cost of producing 100 articles manually with freelance writers at $50 to $150 per article, and the pipeline pays for itself in the first week.

The trade-off is upfront setup time (typically 20-40 hours for a developer to build and test) and ongoing prompt refinement. This is not a "set it and forget it" system — expect to tune prompts monthly as you learn what the LLM handles well and where human writers still add irreplaceable value.

Next Steps

If you are running content operations across multiple Asian markets and want to build a production-grade content automation pipeline — one that handles localization, editorial governance, and multi-CMS publishing — Branch8 can help. Our teams across Hong Kong, Singapore, Taiwan, and Vietnam have built these pipelines for e-commerce brands and SaaS companies scaling content across the region. Reach out at branch8.com to discuss your content automation requirements and get a technical scoping session.

FAQ

Platform costs for a pipeline producing 100 articles per month run approximately $93 to $133, covering OpenAI API usage (GPT-4o), N8n Cloud, and Strapi hosting. The largest variable cost is human review time, which varies by market. This compares favorably to $5,000-$15,000 per month for equivalent freelance writing.