Back to Playbooks

Document Your Salesforce Config

Document
~10 minutes per play

Salesforce orgs accumulate undocumented configuration over time: assignment rules, automation, CPQ logic, entitlement processes. Run one command to extract config and metadata into structured artifacts that AI can synthesize into documentation.

The Black Hole Problem

Every Salesforce org has undocumented "black holes" — assignment rules, Process Builder flows, validation rules that nobody remembers creating. Autopilot Plays extract this config into machine-readable formats (CSV, JSON) plus narrative scaffolds that AI can synthesize into client-ready documentation.

Available Documentation Plays

CPQ Configuration

Products, pricebooks, quotes, validation rules, flows. Detects SBQQ managed package.

g-gremlin autopilot play run document_cpq

Lead Routing

Assignment rules, territories, queues, lead-related flows and triggers.

g-gremlin autopilot play run document_lead_routing

Case Routing

Case assignment, entitlements, SLAs, escalation rules, omni-channel config.

g-gremlin autopilot play run document_case_routing

Renewals Process

Contracts, assets, renewal opportunities, subscription objects.

g-gremlin autopilot play run document_renewals

Revenue Process

Opportunity stages, forecasting config, approval processes, stage-related automation.

g-gremlin autopilot play run document_revenue_process

Example Prompt

Run the document_cpq play to extract our Salesforce CPQ configuration.

I need the full extract including legacy automation (workflow rules, process builder)
so we can audit what's actually in production before migration.

How Each Play Works

1

Verify Org

Confirm connection to target Salesforce org via SF CLI

2

Extract Data

Pull records via SOQL (products, pricebooks, quotes, etc.)

3

Retrieve Metadata

Fetch validation rules, flows, triggers from SF metadata API

4

Build Inventory

Generate metadata_inventory.md summarizing what was extracted

5

Flag Risks

Create risks_and_edge_cases.md with automated risk flags

6

Document Gaps

Generate coverage_gaps.md listing what's NOT captured

After you paste this prompt, Claude Code:
Running
$ g-gremlin autopilot play list
5 documentation plays available. All credentials configured.
Running
$ g-gremlin autopilot play run document_cpq -p include_legacy_automation=true
Starting play: document_cpq (v1.1.0)

"Verifying Salesforce org connection and extracting CPQ configuration..."

Running
$ sf org display --json > artifacts/document_cpq/20250110_120000/org_info.json
Org verified: production (user: [email protected])
Running
$ g-gremlin sfdc query --soql "SELECT Id, Name, ProductCode, IsActive FROM Product2 LIMIT 1000"
Extracted 847 products to products.csv
Running
$ g-gremlin sfdc query --soql "SELECT Id, Pricebook2Id, Product2Id, UnitPrice FROM PricebookEntry LIMIT 2000"
Extracted 1,523 pricebook entries to pricebook_entries.csv
Running
$ sf project retrieve start --metadata ValidationRule:Quote.* --output-dir metadata/
Retrieved 12 Quote validation rules
Running
$ sf project retrieve start --metadata Flow:*Quote* --output-dir metadata/
Retrieved 8 Quote-related flows
Running
$ sf project retrieve start --metadata WorkflowRule:Quote.* --output-dir metadata/
Retrieved 3 legacy workflow rules (flagged for review)
Running
$ g-gremlin sfdc describe --object SBQQ__Quote__c
SBQQ detected: Salesforce CPQ managed package installed

Play complete. Artifacts written to artifacts/document_cpq/20250110_120000/

Output Structure

artifacts/document_cpq/20250110_120000/
org_info.jsonConnected Salesforce org details
metadata_inventory.mdSummary of all extracted data and metadata
final_doc.mdDocumentation skeleton for AI synthesis
risks_and_edge_cases.mdAutomated risk flags and data quality checks
coverage_gaps.mdWhat's NOT captured by this play
run_summary.jsonMachine-readable execution log with step results
products.csvProduct catalog (max 1000 records)
pricebook_entries.csvPricebook entries (max 2000 records)
metadata/Retrieved SF metadata (flows, validations, triggers)

Example Results

847
Products extracted
12
Validation rules
8
Flows retrieved
3
Legacy workflows

The RevOps Win: Extract → Interrogate → Synthesize

Run the play, ask AI to find problems, then publish audience-specific documentation.

1. Extract

Run the play to pull all config, metadata, and automation into structured artifacts.

2. Interrogate

Ask AI to analyze what works well, what's broken, and where inefficiencies sit.

3. Synthesize

Generate audience-specific docs in Notion: Sales users, Admins, and a Roadmap.

Step 2: Interrogate Prompt
Analyze the CPQ artifacts in ./artifacts/document_cpq/20250110_120000/

Tell me:
1. What's working well in our CPQ setup?
2. What's broken or misconfigured?
3. Where are the inefficiencies that slow down sales?
4. What validation rules are too strict or too loose?
5. Are there orphaned products or unused pricebooks?
Step 3: Synthesize Prompt
Based on your analysis, create three Notion documents using g-gremlin docs publish:

1. **CPQ Guide for Sales** — How to create quotes, common errors, tips for faster approvals

2. **CPQ Admin Reference** — Validation rules, automation, pricebook structure, known issues

3. **CPQ Improvement Roadmap** — Key fixes needed to make quoting faster, more resilient, and easier for sales

Publish all three to Notion with g-gremlin docs publish.

The RevOps Win

In 30 minutes, you go from "I have no idea how CPQ is configured" to three published documents stakeholders can actually use. Sales knows how to quote. Admins know what's configured. Leadership has a roadmap. You look like a hero.

Optional Extraction Flags

New in v1.1: Enable additional extraction with parameter flags.

-p include_legacy_automation=trueExtract Workflow Rules and Process Builder metadata
-p include_apex=trueRetrieve Apex triggers and classes (large extraction)
-p include_permissions=trueRetrieve Permission Sets, Profiles, and Sharing Rules

Try Documentation Plays

Start with the quickstart guide, then run documentation plays on your Salesforce org.

Playbook: Document Your Salesforce Config | Deal Desk | FoundryOps