Back to .md Directory

Marketing Campaign Pipeline

Defines a four-stage marketing pipeline with agent handoffs, data contracts, error handling, and activation commands.

May 2, 2026
0 downloads
1 views
ai agent claude workflow automation
View source

What this file does

Defines a four-stage marketing pipeline with agent handoffs, data contracts, error handling, and activation commands.

When to use it

  • Building an automated campaign creation workflow
  • Designing multi-agent handoffs with typed data contracts
  • Adding error recovery paths to agent pipelines
  • Integrating n8n or Claude Code for campaign orchestration

Assumes this stack

n8nClaude Code

Marketing Campaign Pipeline

Purpose: End-to-end campaign creation from research to performance analysis.

Pipeline Diagram

graph TD
    A[trend-researcher] -->|research_complete| B[content-creator]
    B -->|content_ready| C[social-media-strategist]
    C -->|campaign_launched| D[analytics-reporter]
    A -->|trend_not_found| E[extend_research]
    C -->|creative_rejected| F[brand-guardian]

Data Contracts

Stage 1 → Stage 2 Handoff

{
  "from_agent": "trend-researcher",
  "to_agent": "content-creator",
  "handoff_context": {
    "campaign_theme": "AI Productivity",
    "key_messages": ["Save 5 hours/week", "Focus on what matters"],
    "target_audience": "Knowledge workers, 25-45",
    "competitor_insights": "Gap in automation content",
    "content_angles": ["Tutorial", "Case study", "Thought leadership"]
  }
}

Stage 2 → Stage 3 Handoff

{
  "from_agent": "content-creator",
  "to_agent": "social-media-strategist",
  "handoff_context": {
    "content_assets": ["blog_post.md", "email_sequence.md", "social_posts.md"],
    "creative_brief": "Visual style guide + examples",
    "hashtag_recommendations": ["#productivity", "#aitools"],
    "optimal_posting_times": {"twitter": "9am", "linkedin": "12pm"}
  }
}

Stage 3 → Stage 4 Handoff

{
  "from_agent": "social-media-strategist",
  "to_agent": "analytics-reporter",
  "handoff_context": {
    "campaign_id": "CAMP-2024-Q1-001",
    "channels": ["twitter", "linkedin", "newsletter"],
    "spend": 5000.00,
    "raw_metrics": {"impressions": 500000, "clicks": 8500}
  }
}

Error Handling

AgentError TypeDetectionActionFallback
trend-researcherNo clear trendconfidence < 50%Extend researchUse evergreen topics
content-creatorBrand voice mismatchbrand_score < 8ReviseEscalate to brand-guardian
social-media-strategistPlatform rejectionpolicy_violationModify contentUse alternative platform
analytics-reporterData discrepancyvariance > 10%Reconcile sourcesFlag data issues

Activation

Claude Code:

Activate marketing-campaign-pipeline: plan campaign for [product launch]

n8n Import: Import integrations/n8n/marketing-campaign-workflow.json — configure social media API credentials.

Pipeline Sequence

trend-researcher → content-creator → social-media-strategist → analytics-reporter

Stage 1: Research & Insights (trend-researcher)

Input: Campaign objectives, target audience

Responsibilities:

  • Market trend analysis
  • Competitive research
  • Audience insights
  • Content angle identification

Output: Research brief, content themes, key messages

Handoff: Research insights to content-creator

Stage 2: Content Creation (content-creator)

Input: Research brief, campaign themes

Responsibilities:

  • Write campaign copy
  • Create blog content
  • Draft email sequences
  • Develop creative briefs

Output: Campaign content library

Handoff: Content assets to social-media-strategist

Stage 3: Distribution Strategy (social-media-strategist)

Input: Content assets, campaign goals

Responsibilities:

  • Platform-specific adaptation
  • Posting schedule
  • Paid promotion strategy
  • Influencer coordination

Output: Campaign execution plan, scheduled posts

Handoff: Campaign performance data to analytics-reporter

Stage 4: Performance Analysis (analytics-reporter)

Input: Campaign execution data, engagement metrics

Responsibilities:

  • ROI calculation
  • Channel performance comparison
  • Audience insights
  • Optimization recommendations

Output: Campaign report, learnings documentation

Triggers

  • Product launch
  • Seasonal campaign
  • Competitive response
  • Brand awareness initiative

Success Metrics

  • Reach and impressions
  • Engagement rate
  • Click-through rate
  • Conversion rate
  • Cost per acquisition
  • Campaign ROI

What's inside

Pipeline diagram, 4 stage descriptions, 3 data contracts, error table, activation instructions, triggers, success metrics

Change this for your project

  • Replace CAMP-2024-Q1-001 with your campaign ID format
  • Replace integrations/n8n/marketing-campaign-workflow.json with your workflow path
  • Replace #productivity and #aitools with your hashtags

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Worth borrowing

  • Error table with detection threshold and fallback per agent
  • Structured handoff contracts with typed fields per stage
  • Mermaid diagram showing both happy path and error branches

Related Documents