Skip to content

Instantly share code, notes, and snippets.

@jlantz
Created January 16, 2026 17:35
Show Gist options
  • Select an option

  • Save jlantz/ef51cff0f12177e12f29fa9fb08e53e0 to your computer and use it in GitHub Desktop.

Select an option

Save jlantz/ef51cff0f12177e12f29fa9fb08e53e0 to your computer and use it in GitHub Desktop.
Demo recipe produced by `snowfakery-mcp`
```yaml
- snowfakery_version: 3
# ============================================================================
# Salesforce Sandbox Population Recipe
# ============================================================================
# Creates realistic test data with random ratios of related records:
# - Campaigns (5)
# - Accounts (10) with random Contacts (1-5), Opportunities (0-4)
# - OpportunityContactRoles (1-2 per Opportunity)
# - CampaignMembers (0-2 per Contact/Lead)
# - Leads (5-15 standalone)
# ============================================================================
# === CAMPAIGNS (created first so CampaignMembers can reference them) ===
- object: Campaign
nickname: MarketingCampaign
count: 5
fields:
Name: ${{fake.bs}} Campaign
Type:
random_choice:
- Email
- Webinar
- Conference
- Advertisement
- Direct Mail
Status:
random_choice:
- choice:
probability: 30%
pick: Planned
- choice:
probability: 40%
pick: In Progress
- choice:
probability: 30%
pick: Completed
StartDate:
date_between:
start_date: -180d
end_date: +30d
EndDate:
date_between:
start_date: +31d
end_date: +365d
IsActive:
random_choice:
- choice:
probability: 70%
pick: true
- choice:
probability: 30%
pick: false
BudgetedCost:
random_number:
min: 5000
max: 100000
ExpectedRevenue:
random_number:
min: 10000
max: 500000
Description:
fake: paragraph
# === ACCOUNTS with nested CONTACTS, OPPORTUNITIES, and OCRs ===
- object: Account
count: 10
fields:
Name:
fake: company
Description:
fake: catch_phrase
Industry:
random_choice:
- Technology
- Healthcare
- Finance
- Manufacturing
- Retail
- Education
- Energy
Type:
random_choice:
- Prospect
- Customer - Direct
- Customer - Channel
- Partner
BillingStreet:
fake: street_address
BillingCity:
fake: city
BillingState:
fake: state_abbr
BillingPostalCode:
fake: postalcode
BillingCountry: United States
Phone:
fake: phone_number
Website:
fake: uri
NumberOfEmployees:
random_number:
min: 10
max: 50000
AnnualRevenue:
random_number:
min: 100000
max: 50000000
Rating:
random_choice:
- Hot
- Warm
- Cold
friends:
# --- Contacts per Account (random 1-5) ---
- object: Contact
nickname: AccountContact
count:
random_choice:
- choice:
probability: 20%
pick: 1
- choice:
probability: 40%
pick: 2
- choice:
probability: 25%
pick: 3
- choice:
probability: 10%
pick: 4
- choice:
probability: 5%
pick: 5
fields:
Salutation:
random_choice:
- Mr.
- Ms.
- Dr.
FirstName:
fake: first_name
LastName:
fake: last_name
Email:
fake: company_email
Phone:
fake: phone_number
MobilePhone:
fake: phone_number
Title:
random_choice:
- CEO
- CFO
- CTO
- VP of Sales
- Director of Marketing
- Manager
- Senior Developer
- Business Analyst
Department:
random_choice:
- Executive
- Sales
- Marketing
- Engineering
- Finance
- Operations
Birthdate:
date_between:
start_date: -60y
end_date: -25y
MailingStreet:
fake: street_address
MailingCity:
fake: city
MailingState:
fake: state_abbr
MailingPostalCode:
fake: postalcode
MailingCountry: United States
AccountId:
reference: Account
friends:
# CampaignMembers linking Contacts to Campaigns (random 0-2 per contact)
- object: CampaignMember
count:
random_choice:
- choice:
probability: 40%
pick: 0
- choice:
probability: 35%
pick: 1
- choice:
probability: 25%
pick: 2
fields:
CampaignId:
random_reference: Campaign
ContactId:
reference: AccountContact
Status:
random_choice:
- Sent
- Responded
- Attended
# --- Opportunities per Account (random 0-4) ---
- object: Opportunity
nickname: AccountOpportunity
count:
random_choice:
- choice:
probability: 15%
pick: 0
- choice:
probability: 30%
pick: 1
- choice:
probability: 30%
pick: 2
- choice:
probability: 15%
pick: 3
- choice:
probability: 10%
pick: 4
fields:
Name: ${{Account.Name}} - ${{fake.bs}} Opportunity
CloseDate:
date_between:
start_date: -60d
end_date: +180d
Amount:
random_number:
min: 5000
max: 500000
StageName:
random_choice:
- choice:
probability: 15%
pick: Prospecting
- choice:
probability: 15%
pick: Qualification
- choice:
probability: 20%
pick: Needs Analysis
- choice:
probability: 15%
pick: Proposal/Price Quote
- choice:
probability: 10%
pick: Negotiation/Review
- choice:
probability: 15%
pick: Closed Won
- choice:
probability: 10%
pick: Closed Lost
Probability:
random_number:
min: 10
max: 90
LeadSource:
random_choice:
- Web
- Phone Inquiry
- Partner Referral
- Purchased List
- Other
Type:
random_choice:
- New Customer
- Existing Customer - Upgrade
- Existing Customer - Replacement
- Existing Customer - Downgrade
Description:
fake: paragraph
AccountId:
reference: Account
CampaignId:
random_reference: Campaign
friends:
# OpportunityContactRole linking Opportunity to Contacts (1-2 per opp)
- object: OpportunityContactRole
count:
random_choice:
- choice:
probability: 60%
pick: 1
- choice:
probability: 40%
pick: 2
fields:
OpportunityId:
reference: AccountOpportunity
ContactId:
random_reference: Contact
Role:
random_choice:
- Decision Maker
- Evaluator
- Executive Sponsor
- Economic Buyer
- Technical Buyer
- Influencer
IsPrimary:
random_choice:
- choice:
probability: 40%
pick: true
- choice:
probability: 60%
pick: false
# === LEADS (standalone, not tied to Accounts) ===
- object: Lead
count:
random_choice:
- choice:
probability: 30%
pick: 5
- choice:
probability: 40%
pick: 10
- choice:
probability: 30%
pick: 15
fields:
Salutation:
random_choice:
- Mr.
- Ms.
- Dr.
FirstName:
fake: first_name
LastName:
fake: last_name
Email:
fake: email
Phone:
fake: phone_number
MobilePhone:
fake: phone_number
Company:
fake: company
Title:
random_choice:
- CEO
- Director
- Manager
- Analyst
- Developer
- Consultant
Industry:
random_choice:
- Technology
- Healthcare
- Finance
- Manufacturing
- Retail
LeadSource:
random_choice:
- Web
- Phone Inquiry
- Partner Referral
- Purchased List
- Other
Status:
random_choice:
- choice:
probability: 40%
pick: Open - Not Contacted
- choice:
probability: 30%
pick: Working - Contacted
- choice:
probability: 15%
pick: Closed - Converted
- choice:
probability: 15%
pick: Closed - Not Converted
Rating:
random_choice:
- Hot
- Warm
- Cold
AnnualRevenue:
random_number:
min: 50000
max: 10000000
NumberOfEmployees:
random_number:
min: 5
max: 5000
Street:
fake: street_address
City:
fake: city
State:
fake: state_abbr
PostalCode:
fake: postalcode
Country: United States
Description:
fake: paragraph
friends:
# CampaignMembers for Leads (random 0-2 per lead)
- object: CampaignMember
count:
random_choice:
- choice:
probability: 50%
pick: 0
- choice:
probability: 30%
pick: 1
- choice:
probability: 20%
pick: 2
fields:
CampaignId:
random_reference: Campaign
LeadId:
reference: Lead
Status:
random_choice:
- Sent
- Responded
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment