Lead Scoring Agent
Score and rank leads based on ICP fit, engagement signals, and company data
š§ Ingredients
š APIs
prospect_data_title_company_seniority_contact_info
š Alternatives:
company_research_for_buying_signals_hiring_funding_product_launches
š Alternatives:
scored_lead_list_and_historical_scoring_data
š Alternatives:
alert_sales_team_when_a_lead_scores_80
š Alternatives:
š Step-by-Step Build Guide
Define scoring model
1. Define scoring model: ICP Fit (40%) + Company Signals (30%) + Engagement (20%) + Timing (10%)
Define scoring model: ICP Fit (40%) + Company Signals (30%) + Engagement (20%) + Timing (10%) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
ICP Fit scoring
2. ICP Fit scoring: title match (VP+ = 10, Director = 7, Manager = 4), company size, industry match, revenue range
ICP Fit scoring: title match (VP+ = 10, Director = 7, Manager = 4), company size, industry match, revenue range Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Pull prospect batch from Apollo with ICP filters
3. Pull prospect batch from Apollo with ICP filters
Search for prospects using the Apollo API.
POST https://api.apollo.io/api/v1/mixed_people/search
Headers: x-api-key: {APOLLO_API_KEY}
Body: {
"person_titles": ["{target_titles}"],
"organization_num_employees_ranges": ["{size_range}"],
"person_seniority": ["vp", "director", "c_suite"],
"per_page": 25,
"page": 1
}
For each prospect, extract: name, title, company, company size, email, LinkedIn URL.
Filter out prospects without email addresses.
Score ICP fit: title match (0-10), company size match (0-10), industry match (0-10).
Sort by composite score descending.For each prospect, research their company
4. For each prospect, research their company: recent hiring (growing?), funding (cash to spend?), product launches (modernizing?)
For each prospect, research their company: recent hiring (growing?), funding (cash to spend?), product launches (modernizing?) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Score company signals
5. Score company signals: recently funded (+10), hiring for your category (+8), new product launch (+6), leadership change (+5)
Use the GitHub API to fetch the relevant data.
GET https://api.github.com/repos/{owner}/{repo}/{endpoint}
Headers: Authorization: Bearer {GITHUB_TOKEN}, Accept: application/vnd.github.v3+json
Parse the response and extract the key fields.
Handle pagination if results exceed one page (check Link header).
Rate limit: GitHub allows 5,000 requests/hour with auth. If you get 403, check X-RateLimit-Remaining header.
Format the output concisely with the most important information first.Calculate composite score (0
6. Calculate composite score (0-100) and rank all leads
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Tier the list
7. Tier the list: Hot (80+), Warm (60-79), Nurture (40-59), Cold (<40)
Tier the list: Hot (80+), Warm (60-79), Nurture (40-59), Cold (<40) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding. ā ļø IMPORTANT: The next step (Step 8: "Alert sales team in Slack for any Hot leads. Update the ranked list in Google Sh") requires human action. Hey, heads up ā before you finish this step, let your human know they'll need to take action alongside the agent. Don't proceed to the next step until your human confirms they're ready.
Alert sales team in Slack for any Hot leads. Update the ranked list in Google Sh
8. Alert sales team in Slack for any Hot leads. Update the ranked list in Google Sheets weekly
Log data to Google Sheets using the Sheets API.
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED
Headers: Authorization: Bearer {GOOGLE_TOKEN}
Body: { "values": [[{col1}, {col2}, {col3}, ...]] }
Format dates as YYYY-MM-DD, times as HH:MM, numbers without formatting.
Append new rows ā don't overwrite existing data.
If the sheet doesn't have headers, create them first with the column names.
Verify the response shows updatedRows: 1.Weekly
9. Weekly: scoring report ā new leads scored, distribution by tier, top 10 leads with rationale
Compile the gathered data into a structured report. Format as clean Markdown with: - Title/date header - Executive summary (2-3 sentences) - Key metrics section with actual numbers - Detailed sections with bullet points - Action items or recommendations at the end Keep it scannable ā busy people read reports in 30 seconds. Use emoji sparingly for visual anchors (š metrics, ā wins, ā ļø concerns, š action items). Include data comparisons: "X this period vs Y last period (āZ%)" If any data source was unavailable, note it clearly: "ā ļø [Source] data unavailable ā excluded from this report."
š¤ Example Agent Prompt
Define scoring model: ICP Fit (40%) + Company Signals (30%) + Engagement (20%) + Timing (10%) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Copy this prompt into your agent to get started.