🔥 0
0
Lesson 7 of 10 25 min +225 XP

Marketing Content Generation Crew

E-commerce marketing demands constant content creation - email campaigns, social posts, ad copy, influencer briefs. Creating all this while maintaining brand consistency across channels is a massive challenge.

Let's build a Marketing Content Crew that generates cohesive, channel-optimized marketing content.

The Marketing Content Challenge

5-7
Channels to manage
20+
Content pieces per campaign
72%
Marketers struggle with content

Marketing Crew Architecture

┌───────────────────────────────────────────────────────────────────────┐
│                    MARKETING CONTENT CREW                             │
│                                                                       │
│                    ┌──────────────────┐                               │
│                    │    Campaign      │                               │
│                    │   Strategist     │                               │
│                    └────────┬─────────┘                               │
│                             │                                         │
│           ┌─────────────────┼─────────────────┐                       │
│           ▼                 ▼                 ▼                       │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐                │
│  │    Email     │  │   Social     │  │   Paid Ad    │                │
│  │   Writer     │  │   Content    │  │  Copywriter  │                │
│  └──────────────┘  └──────────────┘  └──────────────┘                │
│           │                 │                 │                       │
│           └─────────────────┼─────────────────┘                       │
│                             ▼                                         │
│                    ┌──────────────────┐                               │
│                    │  Brand Review    │                               │
│                    │    Editor        │                               │
│                    └──────────────────┘                               │
└───────────────────────────────────────────────────────────────────────┘

Complete Implementation

Step 1: Marketing Tools

from crewai import Agent, Task, Crew, Process
from crewai.tools import tool
from typing import List, Dict
import json

@tool("Campaign Brief Builder")
def get_campaign_brief(campaign_id: str) -> str:
    """
    Retrieves campaign brief and objectives.

    Args:
        campaign_id: Campaign identifier

    Returns:
        JSON with campaign goals, target audience, products, and timeline.
    """
    brief = {
        "campaign_id": campaign_id,
        "campaign_name": "Spring Running Launch 2025",
        "objective": "Drive sales of CloudWalk Pro Running Shoes",
        "goals": {
            "primary": "Generate 500 sales in first 2 weeks",
            "secondary": "Build email list by 1,000 subscribers",
            "awareness": "Reach 500,000 impressions on social"
        },
        "product": {
            "name": "CloudWalk Pro Running Shoes",
            "price": "$129.99",
            "key_features": [
                "CloudFoam cushioning",
                "8.5 oz lightweight",
                "40-hour battery (for connected features)",
                "Reflective safety details"
            ],
            "unique_value_prop": "Lightweight cushion that protects joints without slowing you down"
        },
        "target_audience": {
            "primary": "Recreational runners, 28-45, suburban, health-conscious",
            "secondary": "Work-from-home professionals seeking active lifestyle",
            "pain_points": [
                "Joint pain from running",
                "Heavy shoes cause fatigue",
                "Safety concerns for evening runs"
            ],
            "motivations": [
                "Stay fit and healthy",
                "Stress relief through running",
                "Training for first 5K/10K"
            ]
        },
        "brand_voice": {
            "tone": "Energetic, encouraging, expert but approachable",
            "style": "Active voice, direct, benefit-focused",
            "avoid": ["Aggressive sales language", "Technical jargon", "Cliches"]
        },
        "timeline": {
            "launch_date": "2025-04-01",
            "content_due": "2025-03-25",
            "channels": ["Email", "Instagram", "Facebook", "Google Ads", "TikTok"]
        },
        "offers": {
            "launch_discount": "15% off with code SPRINGRUN",
            "free_shipping": "Orders over $75",
            "guarantee": "60-day no-questions return"
        }
    }

    return json.dumps(brief, indent=2)


@tool("Channel Performance Data")
def get_channel_performance(channel: str) -> str:
    """
    Retrieves historical performance data for a marketing channel.

    Args:
        channel: Marketing channel (email, instagram, facebook, google_ads)

    Returns:
        JSON with performance metrics and best practices.
    """
    performance_data = {
        "email": {
            "average_open_rate": "24.5%",
            "average_ctr": "3.2%",
            "best_send_times": ["Tuesday 10am", "Thursday 2pm"],
            "top_performing_subjects": [
                "Your [benefit] starts now",
                "Last chance: [offer] ends tonight",
                "[First name], this is for you"
            ],
            "optimal_length": "150-200 words",
            "cta_best_practices": "Single clear CTA, button preferred"
        },
        "instagram": {
            "average_engagement": "4.2%",
            "best_post_times": ["Mon-Fri 11am-1pm", "Evenings 7-9pm"],
            "top_performing_formats": ["Reels", "Carousel", "Stories"],
            "hashtag_strategy": "5-10 relevant hashtags, mix popular and niche",
            "caption_length": "125-150 characters (before 'more')",
            "visual_guidelines": "Bright, lifestyle imagery, show product in use"
        },
        "facebook": {
            "average_engagement": "2.8%",
            "best_post_times": ["Wed-Fri 1-4pm"],
            "top_performing_formats": ["Video", "Carousel ads"],
            "targeting_notes": "Lookalike audiences perform 2x better",
            "ad_copy_length": "40-80 characters headline, 125 chars primary text"
        },
        "google_ads": {
            "average_ctr": "3.8%",
            "quality_score_avg": 7.2,
            "top_converting_keywords": [
                "cushioned running shoes",
                "lightweight running shoes",
                "comfortable running shoes"
            ],
            "headline_max": "30 characters",
            "description_max": "90 characters",
            "best_practices": "Include price, promotion, and clear CTA"
        }
    }

    return json.dumps(performance_data.get(channel.lower(), {}), indent=2)


@tool("Competitor Ads Research")
def get_competitor_ads(category: str) -> str:
    """
    Retrieves competitor advertising examples.

    Args:
        category: Product category to research

    Returns:
        JSON with competitor ad copy examples and strategies.
    """
    competitor_ads = {
        "nike": {
            "headline": "Just Do It. Your run is waiting.",
            "primary_text": "The Nike Pegasus 41 delivers the responsive ride you need to tackle any distance.",
            "cta": "Shop Now",
            "strategy": "Emotional inspiration, brand heritage"
        },
        "adidas": {
            "headline": "Impossible Is Nothing",
            "primary_text": "Ultraboost Light. Our lightest Ultraboost ever. 30% lighter foam, 100% energy return.",
            "cta": "Get Yours",
            "strategy": "Technical innovation, performance data"
        },
        "brooks": {
            "headline": "Run Happy",
            "primary_text": "The Ghost 15 gives you soft, smooth cushioning that feels great from first step to final mile.",
            "cta": "Find Your Fit",
            "strategy": "Comfort focus, running journey"
        },
        "insights": {
            "common_themes": ["Lightweight", "Cushioning", "Energy return"],
            "differentiation_opportunity": "Safety features (reflective) underemphasized",
            "avoid": "Don't directly compare to competitors"
        }
    }

    return json.dumps(competitor_ads, indent=2)

Step 2: Define Marketing Agents

# Agent 1: Campaign Strategist
campaign_strategist = Agent(
    role="Marketing Campaign Strategist",

    goal="Develop a cohesive campaign strategy and messaging framework "
         "that guides all content creation across channels",

    backstory="""You are a senior marketing strategist with experience at
    leading DTC brands. You've launched campaigns generating $10M+ in revenue.

    Your strategic approach:
    - Start with the customer, not the product
    - Define one core message that flexes across channels
    - Create emotional connection, then support with logic
    - Ensure every piece drives toward the campaign goal

    You create the strategic foundation that makes all content cohesive.""",

    tools=[get_campaign_brief],
    verbose=True
)


# Agent 2: Email Marketing Writer
email_writer = Agent(
    role="Email Marketing Specialist",

    goal="Create email campaigns that drive opens, clicks, and conversions "
         "while building lasting customer relationships",

    backstory="""You are an email marketing expert who has written
    campaigns with 40%+ open rates and 8%+ click rates. You understand
    that email is personal communication.

    Your email philosophy:
    - Subject line is 80% of success
    - Write to one person, not a list
    - Value before ask
    - Clear, single CTA per email
    - Mobile-first design thinking

    You write emails people actually want to open.""",

    tools=[get_channel_performance],
    verbose=True
)


# Agent 3: Social Media Content Creator
social_creator = Agent(
    role="Social Media Content Strategist",

    goal="Create engaging social content that builds community, "
         "drives engagement, and supports campaign goals",

    backstory="""You are a social media expert who has grown accounts
    from zero to 100K+ followers. You understand each platform's unique
    culture and algorithm.

    Your social philosophy:
    - Stop the scroll first, sell second
    - Native content beats ads
    - Engagement is a conversation, not a broadcast
    - Trends matter but brand consistency matters more
    - Each platform has its own language

    You create content that people actually engage with.""",

    tools=[get_channel_performance],
    verbose=True
)


# Agent 4: Paid Advertising Copywriter
ad_copywriter = Agent(
    role="Performance Marketing Copywriter",

    goal="Create ad copy that drives clicks and conversions "
         "while maintaining strong quality scores",

    backstory="""You are a direct response copywriter specializing in
    paid advertising. You've written ads that generated $5M+ in
    attributed revenue.

    Your ad copy principles:
    - Every word must earn its place
    - Lead with benefit, not feature
    - Create urgency without manipulation
    - CTA tells them exactly what happens next
    - Test everything - write multiple variations

    You write ads that convert, not just impress.""",

    tools=[get_channel_performance, get_competitor_ads],
    verbose=True
)


# Agent 5: Brand Editor
brand_editor = Agent(
    role="Brand Consistency Editor",

    goal="Ensure all marketing content maintains brand voice, "
         "messaging consistency, and quality standards",

    backstory="""You are a brand guardian who has maintained consistency
    for major consumer brands. You catch what others miss.

    Your review criteria:
    - Brand voice consistency across all pieces
    - Message alignment with campaign strategy
    - Grammar, spelling, punctuation perfection
    - Legal/compliance check (claims, disclosures)
    - Platform appropriateness

    You make good content great and ensure brand integrity.""",

    tools=[get_campaign_brief],
    verbose=True
)

Step 3: Define the Marketing Workflow

# Task 1: Campaign Strategy
strategy_task = Task(
    description="""
    Develop the campaign strategy and messaging framework for: {campaign_id}

    Create:
    1. CAMPAIGN HOOK: One compelling sentence that captures the campaign
    2. KEY MESSAGES: 3-5 messages that support the hook
    3. PROOF POINTS: Features/benefits that back up each message
    4. CALL TO ACTION: Primary action we want customers to take
    5. URGENCY DRIVERS: Why act now

    Ensure the strategy can flex across all channels while
    maintaining a cohesive story.
    """,

    expected_output="""
    Campaign strategy document:
    - Campaign hook (1 sentence)
    - Key messages with proof points
    - Primary and secondary CTAs
    - Urgency drivers and FOMO elements
    - Channel-specific angle recommendations
    """,

    agent=campaign_strategist
)


# Task 2: Email Campaign
email_task = Task(
    description="""
    Create a 3-email launch sequence based on the campaign strategy.

    EMAIL 1 - ANNOUNCEMENT (Day -1):
    - Subject line (50 chars max) + 2 A/B variations
    - Preview text (90 chars)
    - Email body (150-200 words)
    - Primary CTA

    EMAIL 2 - SOCIAL PROOF (Day 3):
    - Subject line + 2 variations
    - Preview text
    - Email body featuring customer benefits
    - Primary CTA

    EMAIL 3 - LAST CHANCE (Day 7):
    - Subject line with urgency + 2 variations
    - Preview text
    - Email body emphasizing deadline
    - Primary CTA

    All emails should feel personal, not promotional.
    """,

    expected_output="""
    3-email sequence with:
    - Subject lines (3 variations each for A/B testing)
    - Preview text for each
    - Complete email body copy
    - CTA button text
    - Send time recommendations
    """,

    agent=email_writer,
    context=[strategy_task]
)


# Task 3: Social Media Content
social_task = Task(
    description="""
    Create social media content for Instagram and TikTok.

    INSTAGRAM (5 posts):
    1. Launch announcement carousel (3-5 slides)
    2. Product feature highlight reel concept
    3. Customer benefit story post
    4. Behind-the-scenes/brand story
    5. UGC encouragement post

    For each:
    - Visual concept description
    - Caption (under 150 chars before "more")
    - Full caption text
    - Hashtag set (8-10)
    - Best posting time

    TIKTOK (3 concepts):
    1. Hook-based product reveal
    2. "POV" running transformation
    3. Trending sound integration idea

    For each:
    - Video concept (15-30 seconds)
    - Script/dialogue
    - Hook (first 3 seconds)
    - Hashtags
    """,

    expected_output="""
    Social content package:
    - 5 Instagram posts with captions and hashtags
    - 3 TikTok video concepts with scripts
    - Posting calendar with optimal times
    - Visual direction for creative team
    """,

    agent=social_creator,
    context=[strategy_task]
)


# Task 4: Paid Advertising Copy
ads_task = Task(
    description="""
    Create paid advertising copy for Google and Facebook/Instagram ads.

    GOOGLE ADS (Search):
    Create 3 ad variations, each with:
    - Headline 1 (30 chars)
    - Headline 2 (30 chars)
    - Headline 3 (30 chars)
    - Description 1 (90 chars)
    - Description 2 (90 chars)

    FACEBOOK/INSTAGRAM ADS:
    Create 3 ad variations, each with:
    - Primary text (125 chars, 3 variations)
    - Headline (40 chars, 3 variations)
    - Description (30 chars)
    - CTA button recommendation

    Include the discount code and free shipping offer where appropriate.
    Focus on different angles: emotional, logical, urgency.
    """,

    expected_output="""
    Paid ad copy package:
    - 3 Google Search ad variations
    - 3 Facebook/Instagram ad variations
    - Recommended targeting notes
    - A/B testing priority recommendations
    """,

    agent=ad_copywriter,
    context=[strategy_task]
)


# Task 5: Brand Review
review_task = Task(
    description="""
    Review all marketing content for brand consistency and quality.

    Review criteria:
    1. BRAND VOICE: Does everything sound like our brand?
    2. MESSAGE ALIGNMENT: Is the core message consistent?
    3. QUALITY: Grammar, spelling, punctuation
    4. LEGAL: Any claims that need substantiation?
    5. PLATFORM FIT: Is content appropriate for each channel?

    For each piece:
    - Approve, or
    - Flag issues with specific corrections

    Provide an overall campaign readiness assessment.
    """,

    expected_output="""
    Brand review report:
    - Per-piece review status (Approved/Needs Revision)
    - Specific corrections needed
    - Brand consistency score (1-10)
    - Overall campaign readiness assessment
    - Final approval recommendation
    """,

    agent=brand_editor,
    context=[strategy_task, email_task, social_task, ads_task]
)

Step 4: Assemble the Marketing Crew

# Create the Marketing Content Crew
marketing_crew = Crew(
    agents=[
        campaign_strategist,
        email_writer,
        social_creator,
        ad_copywriter,
        brand_editor
    ],
    tasks=[
        strategy_task,
        email_task,
        social_task,
        ads_task,
        review_task
    ],
    process=Process.sequential,
    verbose=True
)


def generate_campaign_content(campaign_id: str) -> str:
    """Generate all marketing content for a campaign."""
    result = marketing_crew.kickoff(
        inputs={"campaign_id": campaign_id}
    )
    return result


# Run the marketing crew
if __name__ == "__main__":
    content = generate_campaign_content("CAMP-2025-SPRING")
    print("\n" + "="*60)
    print("MARKETING CAMPAIGN CONTENT")
    print("="*60)
    print(content)

Sample Output: Email Sequence

Email 1: Launch Announcement

Subject Lines (A/B Test):
  1. Your joints will thank you
  2. Run further. Feel better.
  3. [Name], your new running partner is here
Preview Text: Introducing CloudWalk Pro - cushion that doesn't slow you down

Hey [First Name],

Remember that feeling after a great run? Energized, accomplished, ready for anything.

Now imagine that feeling - without the joint pain the next morning.

Introducing CloudWalk Pro - our lightest cushioned running shoe yet. At just 8.5 oz with CloudFoam technology, you get protection without the weight that slows you down.

Launch week special: 15% off with code SPRINGRUN

Shop the Launch

Free shipping on orders over $75. 60-day no-questions returns.

Sample Output: Instagram Content

Instagram Post 1: Launch Carousel

Visual Concept:

Slide 1: Runner at sunrise, shoes prominent, text "Cushion without compromise"
Slide 2: Close-up CloudFoam tech, "Cloud-like protection"
Slide 3: Shoe on scale showing 8.5 oz, "Our lightest yet"
Slide 4: Runner in evening with reflective details visible, "See and be seen"
Slide 5: Product shot, "CloudWalk Pro | $129.99"

Caption:

Your run, protected. Introducing CloudWalk Pro - cushion that keeps up with you.

CloudFoam cushioning meets 8.5 oz lightweight design. Because you shouldn't have to choose between protection and performance. Link in bio for launch week pricing.

Hashtags:

#CloudWalkPro #RunningShoes #LightweightRunning #CushionedRun #SpringRunning #RunningCommunity #JointHealth #MorningRun #RunnerLife #AthleteEdge

Key Takeaways

  • Strategy first - Campaign strategist creates the foundation for all content
  • Channel specialization - Each channel has its own expert agent
  • A/B variations built-in - Multiple options for testing
  • Brand review ensures quality - Catches inconsistencies before launch
  • Cohesive story across channels - Same message, different executions

Next up: Competitor Analysis Agent Crew - Build agents that monitor and analyze competitor activities.

🧠 Quick Quiz

Test your understanding of this lesson.

1

Why does the Marketing Crew need separate agents for different channels?

2

What role does the Campaign Strategist agent play in the crew?

3

How should the crew handle A/B testing variations?

Customer Feedback Analysis Crew