Build Guide

Codex for Sales Pipeline Prioritization

The workflow that tells your AEs what to work first, with the math behind why.

Codex for Sales Pipeline Prioritization
Codex for Sales Pipeline Prioritization

The Workflow

Every Monday morning, your AEs face the same question. Of 80 open opportunities, which 10 deserve focus this week? The standard answer is "whichever is closing this month plus whichever the VP mentioned in the last 1:1," which is fine if you have 12 deals and bad if you have 80.

A Codex prioritization workflow runs Sunday night, reads every open opportunity, scores against a combined rubric, and writes a ranked list to a Notion page each AE checks Monday morning. The math is transparent. The rationale is one line per opportunity. The action recommendation is concrete.

For the broader Codex setup, see OpenAI Codex CLI Guide for GTM Teams. For the same pattern on Claude Code, swap codex exec for claude -p.

Step 1: Define the Scoring Rubric

Five categories with weights. Customize the weights to your sales cycle and rep behavior.

Customer-side activity (30 points). Replies in last 14 days (10), demo attendance (8), proposal engagement (8), executive engagement (4).

Deal stage and close date (25 points). Stage progression (10), close date within 30 days (10), no slip in last 30 days (5).

ICP fit and account size (20 points). Account scores 7+ on your ICP rubric (10), account size matches your sweet spot (10).

Buying signals (15 points). New funding in last 90 days (5), relevant job posting in last 14 days (5), tech stack change toward your category (5).

Owner-driven activity (10 points). Owner logged calls or sent emails in last 7 days (5), multi-threaded (4+ contacts engaged) (5).

The total caps at 100. Store the rubric in rubric.json so you can tune weights without changing the workflow code.

Step 2: Wire the MCP Servers

Three connections. CRM (HubSpot or Salesforce) for opportunity, contact, activity data. Enrichment (Clay) for firmographic and signal data on associated accounts. Output destination (Notion or Slack).

The CRM MCP needs read access to opportunities, contacts, activities, and any custom properties referenced in the rubric. See HubSpot MCP setup or Salesforce MCP setup for the wiring.

Codex configures these in config.toml with the same patterns as Claude Code's .mcp.json. See Codex MCP HubSpot for the specific syntax.

Step 3: Write the Prompt

Structured for codex exec.

Role. "You are a pipeline prioritization agent. You read open opportunities, score each one against the rubric in rubric.json, and write a ranked list to the Notion 'Weekly Pipeline' database."

Steps. 1. Read all open opportunities (not Closed Won, Closed Lost, or archived). 2. For each opportunity, read the associated company, contacts, and recent activity. 3. Score each category from the rubric. Sum to a total score. 4. Generate a one-line rationale citing the highest-weight contributing factors. 5. Recommend a next action (call this contact, send this email, escalate to leader, deprioritize). 6. Write the result to the Notion database with: opportunity_id, score, tier, rationale, next_action, owner. 7. Post a summary to each AE's Slack DM at 7 AM Monday.

Output format. Notion database properties match the schema you've set up. Tier A is 75+, Tier B is 50-74, Tier C is 25-49, Tier D is below 25. Include the rubric score breakdown per category in a collapsed section per opportunity for AEs who want the math.

Stopping conditions. Stop after processing all open opportunities or 500 records, whichever is less.

Step 4: Test on Real Opportunities

Run the workflow on 50 real open opportunities. Compare the agent's ranking to what your top AE would rank these. The first run is usually 60 to 70% match. The misses are tuning data.

Common first-run failures: weighting recent activity too heavily and missing dormant high-value opps. Weighting deal stage too heavily and missing earlier-stage deals with strong signals. Weighting ICP fit too lightly and ranking poor-fit accounts that happen to be active.

Adjust the rubric weights based on the misses. Rerun on the same 50 opportunities. Repeat until the agent's ranking matches your AE's intuition on most opps. That's the calibration the workflow needs before shipping to the team.

Step 5: Schedule and Watch

Schedule the workflow for Sunday at 11 PM PT so the ranked list is ready Monday morning before stand-up.

0 23 * * 0 cd ~/gtm-agents && codex exec "prioritize the open pipeline" >> logs/pipeline.log 2>&1

Monitor two metrics weekly. Score-conversion correlation. Pull closed deals from the last 90 days. What was their average score on the workflow's ranking the week before they closed? If high scores correlate with closed-won, the workflow is working. AE adoption. Are AEs actually working the top of the list? If not, the rationale and next-action fields need to be clearer or more useful.

What to Do When the Workflow Disagrees with Your VP

Eventually the workflow ranks an opportunity low that your VP wants prioritized. Two options.

Update the rubric. If the VP's reason is generalizable (executive-engaged deals always get a bump), add a weight for it. The workflow updates and the next ranking reflects the new rule.

Mark a manual override. Add a "priority_override" boolean to the opportunity that the workflow respects. Use sparingly, since the whole point of automation is consistency. If overrides accumulate, the rubric needs an update.

For broader pipeline workflows, see managing AI SDRs and the agent fleet pattern.

Authoritative References

For Codex CLI and codex exec, see OpenAI's Codex CLI documentation. For the underlying pipeline review framework, see Salesforce's pipeline management resources.

Frequently Asked Questions

What does a Codex pipeline prioritization workflow output?

A stack-ranked list of accounts your team should focus on this week, with a score, a one-line rationale, and a recommended next action per account. The workflow reads your CRM, scores accounts against a combined rubric (deal stage, recent activity, buying signals, ICP fit), and writes the ranked list to a Notion page or Slack channel. AEs work the top of the list first. The rank refreshes weekly or daily depending on cadence.

How is this different from a CRM-native lead score?

Three differences. The Codex workflow combines signals across systems (CRM activity, enrichment data, buying signals from job posts and funding) rather than just CRM behavior. It scores against your specific weights rather than a vendor's generic model. And it produces narrative rationale ('Tier A because: 3 high-intent reps engaged in last 14 days plus new VP Sales hired') rather than a black-box number. CRM-native scoring is easier to ship. The Codex workflow is more useful once it's tuned.

How long does the prioritization workflow take to build?

Three to five working days for a GTM Engineer comfortable with Codex. Day one: AGENTS.md and MCP wiring. Day two: the scoring rubric and the prompt. Day three: testing on 50 real opportunities and tuning the weights. Day four: the output format (Notion or Slack) and the cron schedule. Day five: ship to the team and iterate on AE feedback. The tuning continues over months as you learn which scores correlate with actual conversion.

What weights should I assign to pipeline prioritization signals?

Start with these and tune from there. Recent customer-side activity (replies, demo attendance): 30 points. Deal stage and close date proximity: 25 points. ICP fit and account size: 20 points. Buying signals (job postings, funding, tech changes): 15 points. Owner-driven activity (calls logged, emails sent): 10 points. The exact split depends on your sales cycle length and the signals your reps actually trust. After two months of running the workflow, adjust the weights based on which scores predicted closed-won deals.

Can Codex pipeline prioritization replace a sales analyst?

Not entirely. The workflow handles the repetitive scoring and ranking, which is 60 to 70% of a sales analyst's time on pipeline review. A human analyst still owns the strategic work: tuning the rubric quarterly, investigating anomalies, building executive-facing reports, and partnering with revenue ops on forecast accuracy. The workflow frees the analyst to focus on the strategic 30 to 40% instead of doing the repetitive 60 to 70% by hand.

Source: State of GTM Engineering Report 2026 (n=228). Salary data combines survey responses from 228 GTM Engineers across 32 countries with analysis of 3,342 job postings.

Get the Weekly Pulse

Salary shifts, tool intel, and job market data for GTM Engineers. Weekly playbooks for pipeline management and AI workflows.