Skip to main content
AgentFlow uses OpenAI to evaluate every incoming lead against your qualification criteria and return a structured score, a confidence rating, and a recommended action — giving your team clear, consistent signal on where to focus first. All scoring logic runs on the server, so your OpenAI credentials and business rules never reach the browser.

How AI scoring works

When a lead arrives, AgentFlow assembles the available contact and intent data — name, company, message, source, and any enrichment you have configured — and sends it to OpenAI via a server-side API call. OpenAI evaluates the lead against the qualification dimensions you define and returns a structured JSON response. AgentFlow stores that response, updates the lead record, and surfaces the score in the operator dashboard for review or automated routing.
Every OpenAI call is made from AgentFlow’s server-side qualification boundary. Your API key and your scoring prompt are never exposed to the client or logged in browser-accessible storage. Treat your OpenAI key as a server secret and manage it through your deployment environment variables.

Understanding the score output

Each scored lead receives four fields in its qualification result:
FieldTypeDescription
scoreinteger (0–100)Overall qualification strength. Higher scores indicate stronger fit.
confidencestringhigh, medium, or low — how certain the model is given the available data.
summarystringA one-to-two sentence plain-language explanation of the score.
recommended_actionstringapprove, review, or reject — a suggested next step based on your thresholds.
Example score output:
{
  "score": 82,
  "confidence": "high",
  "summary": "Lead works at a mid-market SaaS company with a strong fit on company size and use-case alignment. Message indicates active budget and a defined timeline.",
  "recommended_action": "approve",
  "dimensions": {
    "company_fit": 85,
    "intent_strength": 90,
    "budget_signal": 75,
    "timeline_urgency": 78
  },
  "scored_at": "2024-11-14T09:32:11Z"
}

Configure AI qualification

1

Open Qualification Settings

In your AgentFlow operator dashboard, navigate to Settings → AI Qualification. This panel controls everything that shapes how leads are scored.
2

Define your ideal customer profile

In the Qualification Criteria field, describe your ideal customer in plain language. AgentFlow injects this context into every scoring prompt. Be specific: include target company sizes, industries, roles, budget ranges, and use cases your product is best suited for.
Ideal customers are founders or RevOps leads at B2B SaaS companies
with 10–200 employees. They are actively evaluating tools to automate
lead qualification or sales triage. Strong signals include mentioning
a specific pain point, a timeline, or a team size.
3

Configure scoring dimensions

Enable the scoring dimensions that matter most for your pipeline. AgentFlow can evaluate leads across:
  • Company fit — size, industry, and vertical match
  • Intent strength — how clearly the message signals purchase intent
  • Budget signal — any indicators of budget readiness or spending authority
  • Timeline urgency — whether the lead has a defined decision timeline
You can weight dimensions or disable those that are not relevant to your qualification process.
4

Set score thresholds

Define the numeric cutoffs that drive automatic routing decisions:
ThresholdDefaultBehavior
Auto-approve above75Leads at or above this score are marked approved and trigger handoff automatically.
Manual review between45–74Leads in this range are queued for operator review before handoff.
Auto-reject below45Leads below this score are marked rejected and receive no handoff.
Adjust these values based on your pipeline volume and operator capacity. Lower the auto-approve threshold if you want more leads reaching review; raise it to keep the queue focused on high-signal leads.
5

Save and test

Save your qualification settings, then submit a test lead through the demo intake form or via a direct webhook POST. Check the resulting lead record in the dashboard to confirm the score, confidence, and recommended action look right for the input you provided.

Tune your qualification criteria over time

Your scoring quality improves as you refine the qualification criteria to reflect real pipeline learnings. After your first batch of scored leads, review cases where the recommended action did not match your operators’ judgment:
  • Score too high for weak leads: Add negative signals to your criteria — for example, note that student emails, personal Gmail addresses, or companies under five employees are not a strong fit.
  • Score too low for strong leads: Add positive signals for use cases or job titles your ideal customers share, even if their message is brief.
  • Confidence consistently low: This usually means leads are arriving with too little data. Consider adding required fields to your intake form or enabling enrichment to give the model more signal to work with.
Run a calibration pass after every 50–100 scored leads. Compare AI recommended actions against actual operator decisions to identify where thresholds or criteria need adjustment.

Cost considerations

Every qualification call consumes OpenAI API tokens. The exact cost depends on how much data each lead carries and how detailed your qualification criteria are. A typical scoring call uses roughly 300–600 input tokens and 150–300 output tokens. Estimating monthly usage:
Monthly lead volumeEstimated token usageApproximate cost (GPT-4o)
500 leads~450,000 tokens~$1.80
2,000 leads~1,800,000 tokens~$7.20
10,000 leads~9,000,000 tokens~$36.00
These estimates are approximate and will vary with your criteria length and lead data richness. Monitor actual usage in your OpenAI dashboard and set a usage cap if you are operating with a fixed budget.
Control costs by:
  • Keeping your qualification criteria concise and focused
  • Filtering out obvious spam or incomplete submissions before they reach the scoring step
  • Caching scores for duplicate or near-duplicate submissions

Server-side safety

AgentFlow enforces a strict server-side boundary around all OpenAI interactions. Your API key is stored as a server-only environment variable and is never returned in API responses, embedded in client-side bundles, or logged in browser-accessible storage. The scoring prompt — which contains your proprietary qualification logic — is also evaluated exclusively on the server. This architecture means that even if a user inspects browser network traffic, they see only the lead submission and the returned score result, not the credentials or the logic that produced it.
Related concepts: