> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketing Workflows

> Automate content distribution, campaign management, and marketing operations.

## Multi-Channel Content Distribution

Automatically adapt and distribute new content across multiple marketing channels with platform-optimized messaging.

### How It Works

**Trigger**: Webhook from CMS when new blog post is published

**Workflow:**

1. **HTTP Request**: Fetch full blog post content
2. **Agent**: Generate platform-specific versions
   * LinkedIn post (professional, 1300 chars)
   * Twitter thread (5 tweets, engaging)
   * Email newsletter snippet (150 words)
   * Instagram caption (short, with hashtags)
3. **Parallel Actions**:
   * Post to LinkedIn
   * Schedule Twitter thread
   * Add to newsletter draft
   * Create Instagram post draft
4. **Action**: Update content calendar with distribution status
5. **Send Notification**: Confirm distribution complete

### Configuration Example

**HTTP Request Node:**

```text theme={null}
Method: GET
URL: {{trigger.output.post_url}}
Headers:
  - Authorization: Bearer YOUR_CMS_TOKEN
```

**Agent Node (Generate Social Content):**

```text theme={null}
Model: GPT-4
Instructions: Create platform-optimized content from this blog post:

**Original Post:**
Title: {{http_request.output.title}}
Content: {{http_request.output.content}}
Key Points: {{http_request.output.summary}}

Generate versions for each platform:

1. **LinkedIn**: Professional post highlighting key insights (max 1300 chars)
2. **Twitter Thread**: 5 engaging tweets with hooks and insights
3. **Email Newsletter**: Compelling 150-word snippet with CTA
4. **Instagram**: Short caption (max 125 chars) with 5 relevant hashtags

Maintain the core message but adapt tone and format for each platform.

Structured Output:
{
  "linkedin_post": "string",
  "twitter_thread": ["string"],
  "email_snippet": "string",
  "instagram_caption": "string",
  "instagram_hashtags": ["string"]
}
```

**Action Node (Post to LinkedIn):**

```text theme={null}
Integration: LinkedIn
Action: Create Post
Content (Manual): {{agent.output.structured.linkedin_post}}
```

**Action Node (Schedule Twitter Thread):**

```text theme={null}
Integration: Twitter/Buffer
Action: Schedule Thread
Tweets (Manual): {{agent.output.structured.twitter_thread}}
Schedule: Next available time slot
```

**Send Notification:**

```handlebars theme={null}
📢 **Content Distributed Successfully**

Blog post "{{http_request.output.title}}" has been distributed across all channels.

**Channels:**
✅ LinkedIn - Posted
✅ Twitter - Scheduled
✅ Email - Added to next newsletter
✅ Instagram - Draft created

**Engagement tracking** will be available in 24 hours.
```

### Benefits

* Content reaches all platforms within minutes of publishing
* Platform-optimized messaging (not copy-paste)
* Consistent multi-channel presence
* Saves 2-3 hours per blog post
* Better engagement through tailored content

***

## Campaign Lead Nurturing

Automatically send personalized nurture emails to leads based on their behavior and engagement.

### How It Works

**Trigger**: Scheduled daily at 10 AM

**Workflow:**

1. **HTTP Request**: Fetch leads in nurture stage from CRM
2. **Loop**: For each lead
   * **HTTP Request**: Get lead's engagement history
   * **Agent**: Analyze behavior and choose appropriate content
   * **Condition**: Determine next action
     * Engaged recently → Send educational content
     * No engagement → Send re-engagement offer
     * High engagement → Alert sales for handoff
   * **Action**: Send personalized email
   * **Action**: Update CRM with activity
   * **Delay**: 3 seconds (rate limiting)
3. **Send Notification**: Daily summary

### Configuration Example

**HTTP Request Node (Fetch Leads):**

```text theme={null}
Method: GET
URL: https://api.yourcrm.com/leads
Query Parameters:
  - stage: nurture
  - active: true
Headers:
  - Authorization: Bearer YOUR_CRM_TOKEN
```

**Loop Node:**

```text theme={null}
Input Array: {{http_request.output.leads}}
Loop Variable: lead
Max Iterations: 200
```

**HTTP Request Node (Inside Loop - Get Engagement):**

```text theme={null}
Method: GET
URL: https://api.yourcrm.com/leads/{{lead.id}}/engagement
Headers:
  - Authorization: Bearer YOUR_CRM_TOKEN
```

**Agent Node (Inside Loop - Analyze & Choose Content):**

```text theme={null}
Model: GPT-4
Instructions: Analyze this lead's engagement and recommend next nurture action:

**Lead Info:**
- Name: {{lead.name}}
- Company: {{lead.company}}
- Role: {{lead.role}}
- Industry: {{lead.industry}}
- Signup Date: {{lead.created_at}}

**Engagement History:**
- Email Opens (last 30 days): {{http_request.output.email_opens}}
- Link Clicks: {{http_request.output.link_clicks}}
- Last Activity: {{http_request.output.last_activity_date}}
- Content Interests: {{http_request.output.topics_viewed}}

**Available Content:**
- Educational: Product guides, case studies
- Promotional: Limited-time offers, demos
- Re-engagement: Special incentives

Determine:
1. Engagement level (high/medium/low)
2. Best content type to send
3. Personalized email subject and preview

Structured Output:
{
  "engagement_level": "high|medium|low",
  "recommended_content_type": "string",
  "email_subject": "string",
  "email_preview": "string (2 sentences)",
  "ready_for_sales": "boolean"
}
```

**Condition Node (Inside Loop):**

```handlebars theme={null}
If Ready for Sales Handoff: {{ agent.output.structured.ready_for_sales === true }}
Else if High Engagement: {{ agent.output.structured.engagement_level === "high" }}
Else if Low Engagement: {{ agent.output.structured.engagement_level === "low" }}
Else Medium Engagement: {{ true }}
```

**Action Node (High Engagement Path - Send Educational Content):**

```text theme={null}
Integration: Email Platform
Action: Send Email
To: {{lead.email}}
Subject (Manual): {{agent.output.structured.email_subject}}
Template: Educational Template
Personalization:
  - Name: {{lead.name}}
  - Company: {{lead.company}}
  - Content: Based on {{agent.output.structured.recommended_content_type}}
```

**Action Node (Low Engagement Path - Re-engagement):**

```text theme={null}
Integration: Email Platform
Action: Send Email
To: {{lead.email}}
Subject (AI Prompt): Create an attention-grabbing subject line about {{agent.output.structured.recommended_content_type}} for {{lead.role}} at {{lead.company}}
Template: Re-engagement Template
```

**Send Notification (Sales Handoff Path):**

```handlebars theme={null}
🔥 **Lead Ready for Sales**

{{lead.name}} from {{lead.company}} is showing high engagement.

**Engagement Metrics:**
- Email Opens: {{http_request.output.email_opens}}
- Link Clicks: {{http_request.output.link_clicks}}
- Last Activity: {{http_request.output.last_activity_date}}

**AI Recommendation:**
{{agent.output.structured.email_preview}}

**Action:** Assign to sales rep for immediate follow-up.
```

**Action Node (Update CRM):**

```text theme={null}
Integration: Your CRM
Action: Update Lead
Lead ID: {{lead.id}}
Fields:
  - last_nurture_date: {{trigger.output.timestamp}}
  - engagement_level: {{agent.output.structured.engagement_level}}
  - stage: {{agent.output.structured.ready_for_sales ? 'sales_qualified' : 'nurture'}}
```

**Send Notification (After Loop):**

```handlebars theme={null}
📬 **Daily Nurture Campaign Complete**

**Summary:**
- Leads Processed: {{loop.total}}
- Educational Content Sent: {{code.educational_count}}
- Re-engagement Sent: {{code.reengagement_count}}
- Sales Handoffs: {{code.handoff_count}}

Check CRM for detailed activity.
```

### Benefits

* Personalized nurture at scale
* No leads forgotten or ignored
* Automatic sales handoff for hot leads
* Data-driven content selection
* Saves 15+ hours per week on manual nurture

## Next Steps

<CardGroup cols={2}>
  <Card title="Sales Workflows" icon="chart-line" href="/en/_internal/product/workflows/use-cases/sales">
    Lead qualification and sales automation
  </Card>

  <Card title="Finance Workflows" icon="dollar-sign" href="/en/_internal/product/workflows/use-cases/finance">
    Invoice and expense automation
  </Card>

  <Card title="Agent Node" icon="brain" href="/en/using-langdock/workflows/nodes/agent-node">
    Generate personalized content with AI
  </Card>

  <Card title="Loop Node" icon="rotate" href="/en/using-langdock/workflows/nodes/loop-node">
    Process multiple leads efficiently
  </Card>
</CardGroup>
