Lesson 3 of 5
Automating Content Generation
Estimated time: 8 minutes
Automating Content Generation
This is where the pipeline gets powerful. You'll create an OpenClaw agent that takes a content brief and generates a full blog post plus social media variants — all from a single trigger.
Building on Lesson 2
This lesson uses the content queue from the previous lesson. Make sure you have at least one idea brief saved to ~/.openclaw/content-queue/.
The Generation Pipeline
The agent processes your brief through three stages:
Content Brief Stage 1 Stage 2 Stage 3
┌────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ headline │────>│ Blog Post │────>│ Social Media │────>│ Newsletter │
│ summary │ │ (600-800w) │ │ Variants │ │ Paragraph │
│ key points │ │ │ │ (5 platforms) │ │ │
│ audience │ └──────────────┘ └──────────────┘ └──────────────┘
└────────────┘
Each stage uses the output of the previous one
Create the blog post generator
This agent takes a content brief and writes a full blog post:
openclaw agent add \
--name "Blog Writer" \
--message "You are an expert blog writer. Given a content brief, write a
polished blog post.
BRIEF:
{input}
RULES:
- 600-800 words
- Conversational but authoritative tone
- Start with a hook, not 'In this article...'
- Use subheadings (##) every 150-200 words
- Include one specific example or case study
- End with a clear call-to-action
- No fluff. Every paragraph should teach or persuade.
Output the blog post in Markdown format." \
--save-output "~/.openclaw/content-drafts/"
Test it with a brief from your queue:
openclaw queue next --dir ~/.openclaw/content-queue/ | \
openclaw agent run "Blog Writer"
Create the social media generator
This agent takes the blog post and creates platform-specific variants:
openclaw agent add \
--name "Social Variants" \
--message "You are a social media content expert. Given a blog post,
create variants for each platform.
BLOG POST:
{input}
Create these variants:
## Twitter/X Thread
- 5-7 tweets, each under 280 characters
- First tweet is the hook
- Last tweet links back to the blog
- Use line breaks for readability
## LinkedIn Post
- 1200-1500 characters
- Professional but human tone
- Open with a bold statement or question
- Use line breaks every 2-3 sentences
- End with a question to drive comments
## Instagram Caption
- Under 2200 characters
- More casual, story-driven
- Include 5 relevant hashtags at the end
- Use emoji sparingly (2-3 max)
## Facebook Post
- 300-500 characters
- Casual, shareable tone
- Ask a question to boost engagement
## Email Newsletter Paragraph
- 150-200 words
- Teaser that makes people click to read the full post
- Include a clear CTA button text
Output each variant with a clear heading." \
--save-output "~/.openclaw/content-drafts/"
Chain them into a pipeline
Now connect both agents into a single pipeline. When you drop an idea, everything generates automatically:
openclaw pipeline add \
--name "Content Pipeline" \
--steps "Blog Writer,Social Variants" \
--trigger "/publish" \
--input-dir "~/.openclaw/content-queue/" \
--output-dir "~/.openclaw/content-drafts/" \
--announce \
--channel telegram \
--to "CHAT_ID"
Now test the full pipeline:
openclaw pipeline run 'Content Pipeline'Pipeline flow
The pipeline passes output from each step to the next: brief → Blog Writer → blog post → Social Variants → all platforms. You don't need to manually copy anything between steps.
Review the output
Check what the pipeline generated:
ls ~/.openclaw/content-drafts/You'll see files organized by timestamp and type:
2024-01-15-ai-tools-small-biz/
├── blog-post.md
├── twitter-thread.md
├── linkedin-post.md
├── instagram-caption.md
├── facebook-post.md
└── newsletter-paragraph.md
Preview any file:
openclaw draft show --latestFine-Tuning Your Output
The default prompts produce good content, but you'll want to customize them for your brand voice. Here are the most impactful tweaks:
Add a voice guide to your blog writer:
openclaw agent edit "Blog Writer" --append-message "
VOICE GUIDE:
- Write like you're explaining to a smart friend over coffee
- Use 'you' more than 'we'
- Avoid jargon unless you immediately explain it
- Short paragraphs (3 sentences max)
- One idea per paragraph"
For maximum consistency, you can provide a reference document:
openclaw agent edit "Blog Writer" \
--context-file "~/.openclaw/brand-guide.md"
Your brand-guide.md might include:
- Words you always use / never use
- Sentence length targets
- Example paragraphs showing your ideal tone
- Formatting preferences (bullet lists vs. numbered lists, etc.)
The agent will reference this file on every run without you including it in the prompt each time.
Not every idea should be a blog post. Add type detection to your pipeline:
openclaw agent edit "Blog Writer" --prepend-message "
First, determine the best content type for this brief:
- If it's news/timely: write a short commentary (300 words)
- If it's educational: write a how-to post (600-800 words)
- If it's opinion: write a thought piece (500-600 words)
- If it's a list: write a listicle with clear numbering
Then write the content in the appropriate format."
What You Have Now
Your content pipeline generates:
- A full blog post from a rough idea
- 5 platform-specific social media variants
- An email newsletter paragraph
- All organized in a drafts folder for review
The next lesson covers how to schedule and publish this content across your actual platforms.
Why does the Social Variants agent receive the blog post instead of the original brief?