Skip to content
Back to skills

121 Campaigns Erd 9da1c770

ASecurity

Pre-built data model for Salesforce Campaigns using `flowchart LR` format with color coding and relationship indicators.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 11, 2026
businesspythonbashnode

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 121-campaigns-erd_9da1c770 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 121 Campaigns Erd 9da1c770?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 121 Campaigns Erd 9da1c770
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-121-campaigns-erd-9da1c770/badge)](https://www.skillsdirectory.com/skills/tools-only-121-campaigns-erd-9da1c770)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Campaigns Data Model Template

Pre-built data model for Salesforce Campaigns using `flowchart LR` format with color coding and relationship indicators.

## Objects Included

| Object | Type | Description |
|--------|------|-------------|
| Campaign | STD | Marketing campaigns |
| CampaignMember | STD | Campaign responses (Lead/Contact) |
| CampaignMemberStatus | STD | Status values per campaign |
| CampaignInfluence | STD | Attribution to opportunities |
| Lead | STD | Potential customers |
| Contact | STD | Existing contacts |
| Opportunity | STD | Influenced deals |

---

## Query Org Metadata (Recommended)

Enrich diagram with live org data:

```bash
python3 ~/.claude/plugins/marketplaces/sf-skills/sf-diagram-mermaid/scripts/query-org-metadata.py \
    --objects Campaign,CampaignMember,CampaignInfluence,Lead,Contact,Opportunity \
    --target-org myorg
```

---

## Mermaid Template (Preferred)

Left-to-right flowchart with color coding.

```mermaid
%%{init: {"flowchart": {"nodeSpacing": 50, "rankSpacing": 80}} }%%
flowchart LR
    %% ═══════════════════════════════════════════════════════════════
    %% CAMPAIGNS DATA MODEL
    %% LEGEND: LK = Lookup (-->), MD = Master-Detail (==>)
    %% Colors: Blue = Standard, Orange = Custom, Green = External
    %% ═══════════════════════════════════════════════════════════════

    %% Core Campaign Objects
    Campaign["Campaign<br/>(count)"]
    CampaignMember["CampaignMember<br/>(count)"]
    CampaignMemberStatus["CampaignMemberStatus<br/>(count)"]

    %% Attribution
    CampaignInfluence["CampaignInfluence<br/>(count)"]

    %% Related Objects
    Lead["Lead<br/>(count)"]
    Contact["Contact<br/>(count)"]
    Opportunity["Opportunity<br/>(count)"]

    %% Relationships - Campaign to Members
    Campaign ==>|"MD"| CampaignMember
    Campaign ==>|"MD"| CampaignMemberStatus
    Lead -->|"LK"| CampaignMember
    Contact -->|"LK"| CampaignMember

    %% Relationships - Attribution
    Campaign -->|"LK"| CampaignInfluence
    Contact -->|"LK"| CampaignInfluence
    Opportunity -->|"LK"| CampaignInfluence

    %% Campaign Hierarchy
    Campaign -.->|"Parent"| Campaign

    %% Primary Campaign Source
    Campaign -->|"LK"| Opportunity

    %% Standard Objects - Sky Blue
    style Campaign fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style CampaignMember fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style CampaignMemberStatus fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style CampaignInfluence fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style Lead fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style Contact fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style Opportunity fill:#bae6fd,stroke:#0369a1,color:#1f2937
```

---

## Key Concepts

### Campaign Hierarchy
- Campaigns support **Parent Campaign** self-lookup
- Enables rollup reporting across campaign groups
- Max hierarchy depth: 5 levels

### CampaignMember Polymorphism
- CampaignMember links to **either** Lead OR Contact (not both)
- Uses `LeadId` or `ContactId` lookup fields
- Status tracked via CampaignMemberStatus

### Campaign Influence Models
| Model | Description |
|-------|-------------|
| **Primary Campaign Source** | First-touch attribution (Opportunity.CampaignId) |
| **Campaign Influence 1.0** | Manual influence records |
| **Customizable Campaign Influence** | Multi-touch with weighted attribution |

---

## Simplified Version (Core Objects Only)

For presentations focusing on core campaign flow:

```mermaid
%%{init: {"flowchart": {"nodeSpacing": 50, "rankSpacing": 80}} }%%
flowchart LR
    Campaign["Campaign"]
    CampaignMember["CampaignMember"]
    Lead["Lead"]
    Contact["Contact"]

    Campaign ==>|"MD"| CampaignMember
    Lead -->|"LK"| CampaignMember
    Contact -->|"LK"| CampaignMember

    style Campaign fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style CampaignMember fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style Lead fill:#bae6fd,stroke:#0369a1,color:#1f2937
    style Contact fill:#bae6fd,stroke:#0369a1,color:#1f2937
```

---

## ASCII Fallback

```
┌─────────────────────────────────────────────────────────────────────────────┐
│  CAMPAIGNS DATA MODEL (L→R)                                                  │
│  Legend: LK = Lookup (-->), MD = Master-Detail (==>)                        │
└─────────────────────────────────────────────────────────────────────────────┘

                              ┌─────────────────────┐
                         ┌───>│ CAMPAIGN_MEMBER     │<─── LK ──┬──────────────┐
                         │ MD │     (count)         │          │              │
                         │    └─────────────────────┘          │              │
┌──────────────┐         │                                ┌────┴─────┐   ┌────┴─────┐
│   CAMPAIGN   │─────────┤                                │   LEAD   │   │ CONTACT  │
│   (count)    │         │    ┌─────────────────────┐     │ (count)  │   │ (count)  │
└──────┬───────┘         └───>│ CAMPAIGN_MEMBER_    │     └──────────┘   └────┬─────┘
       │                   MD │ STATUS (count)      │                         │
       │ Parent               └─────────────────────┘                         │
       ▼                                                                      │
┌──────────────┐              ┌─────────────────────┐                         │
│   CAMPAIGN   │── LK ───────>│ CAMPAIGN_INFLUENCE  │<──── LK ────────────────┤
│   (parent)   │              │     (count)         │                         │
└──────────────┘              └──────────┬──────────┘                         │
                                         │                                    │
                                         │ LK                                 │
                                         ▼                                    │
                              ┌─────────────────────┐                         │
                              │    OPPORTUNITY      │                         │
                              │      (count)        │                         │
                              └─────────────────────┘
```

---

## Key Relationships Summary

| Parent | Child | Type | Behavior |
|--------|-------|------|----------|
| Campaign | CampaignMember | MD | Cascade delete |
| Campaign | CampaignMemberStatus | MD | Cascade delete |
| Lead | CampaignMember | LK | Optional (polymorphic) |
| Contact | CampaignMember | LK | Optional (polymorphic) |
| Campaign | CampaignInfluence | LK | Attribution link |
| Campaign | Opportunity | LK | Primary Campaign Source |
| Campaign | Campaign | LK | Parent Campaign (hierarchy) |

---

## Limits & Considerations

| Limit | Value |
|-------|-------|
| Campaign hierarchy depth | 5 levels |
| CampaignMembers per campaign | No hard limit (LDV consideration) |
| CampaignInfluence records | Depends on attribution model |

---

## Best Practices

1. **Use `flowchart LR`** - Left-to-right flow for readability
2. **Keep objects simple** - Name + record count only
3. **Replace `(count)` placeholders** - With actual counts from query
4. **Add LDV indicator** - For objects >2M records: `LDV[~4M]`
5. **Color code object types** - Blue=Standard, Orange=Custom, Green=External

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.