Content Repurposing Pipeline
[To Build] ·
agent__content-repurposer· Claude Sonnet 4.6
Automatically transforms an approved blog post into platform-ready variants: social media posts (per platform), an email newsletter draft, and ads copy. Each format is produced as a separate child activity that flows through the standard review and approval workflow.
Related: Blog Writer · Social Post Writer · Email Writer · Content Repurposer Agent · Social Publishing · Credits · Content Toolkit Overview
Overview
| Function | Transform an approved blog post into social, email, and ads content variants |
| Type | Worker — Content |
| Status | To Build |
| Priority | P1 — Table-Stakes |
| Queue | agent__content-repurposer |
| Concurrency | 4 |
| Timeout | 6 min |
| Est. cost / task | ~$0.40 per format |
| Credits | 0.5 cr per repurposed format |
| Plan | Pro+ |
Why This Is Needed
Every content type in Leadmetrics is currently created from scratch — blog posts, social posts, and emails are independent agent runs that start from a brief, not from each other. This misses the natural leverage point: a published blog post already contains all the information, angles, and key claims that social posts and emails need. Repurposing multiplies output per credit spent and keeps messaging consistent across channels.
What Gets Repurposed
| Source | Target Format | Agent Involved | Output |
|---|---|---|---|
| Published blog post | Social post — LinkedIn | content-repurposer | Professional long-form post, key takeaways format |
| Published blog post | Social post — Instagram | content-repurposer | Short punchy text + image brief for designer |
| Published blog post | Social post — Facebook | content-repurposer | Mid-length conversational post |
| Published blog post | Social post — X | content-repurposer | Thread (3–5 tweets) |
| Published blog post | Email newsletter | content-repurposer | Full newsletter: subject line, preview text, body sections, CTA |
| Published blog post | Google Ads copy | content-repurposer | 3 headline + description RSA variants |
| Published blog post | Meta Ads copy | content-repurposer | 2 ad set variants with hook, body, CTA |
The tenant selects which formats to repurpose into when triggering the pipeline. All selected formats run as parallel jobs.
How It Differs From Writing From Scratch
The content-repurposer agent is not a general writer. It receives the full published blog post as source material and is instructed to:
- Extract the core argument, key claims, and CTA from the post
- Select the 3–5 most shareable insights
- Reformat for the target channel’s tone, length, and engagement style
- Do not introduce new claims, statistics, or arguments not present in the source post
This keeps messaging consistent across channels and ensures the social post or email reflects the exact content that was reviewed and approved.
Trigger Conditions
Automatic Trigger (primary)
When a BlogPost transitions to published status:
BlogPost.status → "published"
↓
Activity Planner checks tenant's repurposing configuration:
- Which formats are enabled for auto-repurpose?
- Does the tenant have enough credits?
↓
Creates one child Activity per enabled format
- activityType: 'social_post' | 'email' | 'google_ad' | 'meta_ad'
- parentActivityId: blog post activity ID
- repurposeSourceId: BlogPost.id
↓
Enqueues agent__content-repurposer job per formatManual Trigger (on-demand)
“Repurpose” button on the blog detail page → format selector modal → triggers the same child Activity creation flow for selected formats only.
Input Contract
interface ContentRepurposerInput {
tenantId: string;
blogPostId: string;
// Source content
sourcePost: {
title: string;
metaDescription: string;
bodyMarkdown: string;
primaryKeyword: string;
publishedUrl?: string;
};
// Target format for this job
targetFormat: RepurposeFormat;
// Per-format configuration
platform?: 'linkedin' | 'instagram' | 'facebook' | 'x'; // required when targetFormat is 'social_post'
emailAudienceId?: string; // Mailchimp audience ID, if connected
campaignId?: string;
}
type RepurposeFormat =
| 'social_post'
| 'email_newsletter'
| 'google_ads'
| 'meta_ads';Output Contract
interface ContentRepurposerOutput {
tenantId: string;
blogPostId: string; // source
targetFormat: RepurposeFormat;
platform?: string;
// Populated based on targetFormat:
socialPost?: {
captionText: string;
hashtags: string[];
imageBrief?: string; // description for social-post-designer if image is needed
};
emailNewsletter?: {
subjectLine: string;
previewText: string;
bodyMarkdown: string; // sections mapped from blog H2s
ctaText: string;
ctaUrl: string;
};
googleAds?: {
headlines: string[]; // max 30 chars each, 3–5 variants
descriptions: string[]; // max 90 chars each, 2–3 variants
finalUrl: string;
};
metaAds?: {
variants: {
hook: string; // first sentence / pattern interrupt
body: string; // 2–4 sentences
cta: string; // call to action label
}[];
};
}Child Activity States
Each repurposed format becomes a standard Activity that follows the normal review workflow:
generated → dm_review → dm_approved → client_review → client_approved → [published]For social posts, client_approved triggers the Social Publishing scheduled delivery.
For emails, client_approved triggers the Mailchimp push if a Mailchimp channel is connected.
Dashboard UI
Blog Detail Page:
- “Repurpose” button in the blog post action bar (visible when post is
published) - Clicking opens a format selector modal:
- Checkboxes for each format (Social: LinkedIn, Instagram, Facebook, X; Email Newsletter; Google Ads; Meta Ads)
- Pre-selects formats that are auto-configured in tenant repurposing settings
- Shows credit cost preview: “3 formats selected = 1.5 cr”
- “Start Repurposing” button
Repurposed Content Panel (blog detail page):
- Shows all child activities linked to this blog post
- Status badges per format (Generating → Review → Approved → Published)
- Click-through to the individual social/email/ads activity
Tenant Settings — Repurposing Configuration:
- Toggle per format: enable/disable auto-repurpose on blog publish
- Default platforms to repurpose into
- Require human approval before publishing repurposed content (default: on)
Key Design Decisions
| Decision | Choice | Rationale |
|---|---|---|
| One job per format | Separate BullMQ job per target format | Allows parallel generation; individual format failures do not block others |
| Source-constrained prompt | Agent instructed not to introduce new claims | Repurposed content must stay faithful to the approved blog; prevents drift |
| Same HITL workflow | Repurposed activities go through dm_review → client_review | Repurposed content may be lower-stakes but DM review catches tone/format issues before client sees them |
| Credits per format | 0.5 cr per format (not 0 or bundled with blog) | Repurposing is a real inference call with real cost; bundling would erode the blog credit value |
| Platform ordering | LinkedIn first → Instagram → Facebook → X | Longest to shortest format; the agent naturally narrows its focus in this order |
Implementation Phases
Phase 1 — Core Worker + Social Posts
- Create
docs/agents/content-repurposer.md(agent doc) - Add
content-repurposertoAgentRoletype union inpackages/queue/src/types.ts - Add
ContentRepurposerInput/ContentRepurposerOutputtypes - Create
packages/agents/src/workers/content-repurposer.worker.ts - Seed system prompt for
content-repurposerinpackages/db/src/seed.ts - Add
parentActivityId+repurposeSourceIdfields toActivitymodel (migration) - Hook
publishedstatus transition inapps/api/src/routers/blog.tsto check auto-repurpose config and enqueue jobs - “Repurpose” button + format selector modal in blog detail page
Phase 2 — Email + Ads Formats
- Extend
ContentRepurposerInput.targetFormatto includeemail_newsletter,google_ads,meta_ads - Add email newsletter + ads variants to the content-repurposer agent system prompt
- Wire email output to create an
EmailActivityrecord (same model as email-writer output) - Wire ads output to create
GoogleAdActivity/MetaAdActivityrecords
Phase 3 — Settings + Auto-Config
- Tenant settings page: repurposing configuration (auto-formats, approval toggle)
- Store per-tenant repurpose config in
TenantSettingsJSON field - Activity Planner: read repurpose config before auto-enqueuing on blog publish