Turn referral and out-of-office replies into new leads
Finds Instantly replies that name someone else or say the lead left, finds the person's email with Hunter, and adds them to a campaign.
Outcome
A table of every referral, departure and out-of-office reply with the person it points to and what was done.
A work email for each person those replies point to, where the reply gives one or Hunter finds one.
Each person a lead referred you to added to your referral campaign with who referred them, and each successor or colleague added to your new-contacts campaign, after your approval.
The original leads marked Wrong Person or Out of Office in Instantly.
How it works
- 1
Pull new replies
InstantlyList the received emails in
campaign, newest first, and stop atsince. Keep each email's lead email address, the domain of that address and the reply text, and read each lead's name and company name from its Instantly lead record, a read-only call. - 2
Sort the replies
TypeSafe AISend each reply's text as the state with a choice
kindof referral (names someone else to talk to), left_company (says the lead no longer works there), away_with_contact (out of office, naming a colleague to contact meanwhile), away (out of office, naming no one) and other. Keep each reply's kind and its confidence. - 3
Read out the people
Your agentShow the user the replies whose kind confidence is below
min_confidence, and keep the kind the user picks. From each referral, left_company and away_with_contact reply, copy the named person's full name, and their email when the reply gives one. Keep each name with the lead who named them and the kind of reply. - 4
Find successors
HunterFor each left_company reply that names nobody, up to
max_lookups, list the people Hunter has found at the lead's company domain. Keep the person whose position best matchessuccessor_titles, with their name and email. - 5
Find the other emails
HunterFor each named person still without an email, within what is left of
max_lookups, look up their work email from their name and the company domain. Keep the emails Hunter finds; list the rest as not found. - 6
Add the referrals
InstantlyAfter the user approves the list, add each person named in a referral reply to
referral_campaignwith their name, company andreferred_byset to the name of the lead who referred them. - 7
Add the other contacts
InstantlyAfter the user approves, add each successor and each colleague named in an away reply to
successor_campaignwith their name and company. - 8
Close out the original leads
InstantlySet each left_company lead to Wrong Person and each away or away_with_contact lead to Out of Office.
You'll be asked for
The Instantly campaign whose replies to read, by name
e.g. Q4 founders
When the last run ended, so only newer replies are read
e.g. 2026-09-28 09:00 UTC
The Instantly campaign for people a lead referred you to, set up once with a `referred_by` custom variable in its first email
e.g. Referrals
The Instantly campaign for successors and colleagues named in away replies, whose copy claims no referral
e.g. New contacts
The titles to look for when a lead has left
e.g. VP Sales, Head of Sales
How sure Jev must be before its answer is used without you
e.g. 0.8
The most Hunter lookups in one run, since lookups spend Hunter credits
e.g. 50
The file your agent runs
referral-reply-leads.md
Turn referral and out-of-office replies into new leads
Finds Instantly replies that name someone else or say the lead left, finds the person's email with Hunter, and adds them to a campaign.
Set up the tools below, then run the steps in order for the user, carrying each step's results into the next. The run is done when the user has the outcome below.
Outcome
- A table of every referral, departure and out-of-office reply with the person it points to and what was done.
- A work email for each person those replies point to, where the reply gives one or Hunter finds one.
- Each person a lead referred you to added to your referral campaign with who referred them, and each successor or colleague added to your new-contacts campaign, after your approval.
- The original leads marked Wrong Person or Out of Office in Instantly.
Inputs
Ask the user for these before you start.
campaign: the Instantly campaign whose replies to read, by name, e.g. Q4 founderssince: when the last run ended, so only newer replies are read, e.g. 2026-09-28 09:00 UTCreferral_campaign: the Instantly campaign for people a lead referred you to, set up once with areferred_bycustom variable in its first email, e.g. Referralssuccessor_campaign: the Instantly campaign for successors and colleagues named in away replies, whose copy claims no referral, e.g. New contactssuccessor_titles: the titles to look for when a lead has left, e.g. VP Sales, Head of Salesmin_confidence: how sure Jev must be before its answer is used without you, e.g. 0.8max_lookups: the most Hunter lookups in one run, since lookups spend Hunter credits, e.g. 50
Set up
Instantly (tool:instantly/list-emails, tool:instantly/add-leads-to-campaign, tool:instantly/update-lead-interest-status)
Use the API.
- Base URL: https://api.instantly.ai
- List emails:
GET /api/v2/emails - Add leads to a campaign:
POST /api/v2/leads/add - Set a lead's interest status:
POST /api/v2/leads/update-interest-status - Auth: send the header
Authorization: Bearer $INSTANTLY_API_KEY - Get a key: https://app.instantly.ai/app/settings/integrations
Notes:
- List emails: Pass
email_type=receivedfor replies andcampaign_idto narrow them to one campaign. Page withlimit, up to 100, andstarting_after, set to the previous response'snext_starting_after. - Add leads to a campaign: Leads added to an active campaign can start receiving its emails: confirm the campaign first. Pass
campaign_idorlist_id, not both; the key needs theleads:createscope. - Set a lead's interest status:
interest_valueis a number: 1 interested, -1 not interested, 0 out of office, -2 wrong person, 2 meeting booked, 3 meeting completed, 4 won, -3 lost, -4 no show, or a custom status's value; null resets the lead to Lead. Needs an active paid plan.
Answer typed questions (TypeSafe AI, tool:typesafe/answer-typed-questions)
Use the API.
- Base URL: https://api.typesafe.ai
- Endpoint:
POST /v1/systemone - Auth: send the header
Authorization: Bearer $TYPESAFE_API_KEY - Get a key: https://console.typesafe.ai
Note: Put every question about one record in one request. GET /v1/models lists the models and is the cheapest check of a key; a request over the rate limit gets a 429 with a Retry-After header.
Note: Send state, model (jev-latest) and named questions, each with type, instructions and criteria: a choice maps labels to descriptions, a score lists its levels in order, a noul's is optional. Read a score by its most likely level; send unsure answers to a person.
Hunter (tool:hunter/search-domain, tool:hunter/find-email)
Use the first option your agent supports.
Notes:
- Search a domain for emails: Returns 10 emails by default; page through the rest with
limitandoffset. - Find a person's email: A search that finds nothing costs no credit; a found email is saved to your Hunter leads unless that is turned off. A
451means the person asked Hunter to stop processing their data: don't use it.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "hunter": { "url": "https://mcp.hunter.io/mcp" } } }
- Search a domain for emails: call the MCP tool
Domain-Search - Find a person's email: call the MCP tool
Email-Finder
API (official)
- Base URL: https://api.hunter.io/v2
- Search a domain for emails:
GET /domain-search - Find a person's email:
GET /email-finder - Auth: send the header
X-API-Key: $HUNTER_API_KEY - Get a key: https://hunter.io/api-keys
Before step 1, confirm access to each service with its cheapest read-only call, like a list or a search. Never send or change anything to test access.
Steps
- Pull new replies with List emails (Instantly). List the received emails in
campaign, newest first, and stop atsince. Keep each email's lead email address, the domain of that address and the reply text, and read each lead's name and company name from its Instantly lead record, a read-only call. - Sort the replies with Answer typed questions (TypeSafe AI). Send each reply's text as the state with a choice
kindof referral (names someone else to talk to), left_company (says the lead no longer works there), away_with_contact (out of office, naming a colleague to contact meanwhile), away (out of office, naming no one) and other. Keep each reply's kind and its confidence. - Read out the people yourself. Show the user the replies whose kind confidence is below
min_confidence, and keep the kind the user picks. From each referral, left_company and away_with_contact reply, copy the named person's full name, and their email when the reply gives one. Keep each name with the lead who named them and the kind of reply. - Find successors with Search a domain for emails (Hunter). For each left_company reply that names nobody, up to
max_lookups, list the people Hunter has found at the lead's company domain. Keep the person whose position best matchessuccessor_titles, with their name and email. - Find the other emails with Find a person's email (Hunter). For each named person still without an email, within what is left of
max_lookups, look up their work email from their name and the company domain. Keep the emails Hunter finds; list the rest as not found. - Add the referrals with Add leads to a campaign (Instantly). After the user approves the list, add each person named in a referral reply to
referral_campaignwith their name, company andreferred_byset to the name of the lead who referred them. - Add the other contacts with Add leads to a campaign (Instantly). After the user approves, add each successor and each colleague named in an away reply to
successor_campaignwith their name and company. - Close out the original leads with Set a lead's interest status (Instantly). Set each left_company lead to Wrong Person and each away or away_with_contact lead to Out of Office.
Notes
Jev sorts replies but does not copy text out of them, so step 3 is the agent's own reading, done only for the referral, left_company and away_with_contact replies.
Your referral campaign's first email names who referred them, so only people named in a referral reply go to it. Replies are written by outsiders: in the approval list, flag any address outside the lead's company domain. Run it daily with since set to the previous run.
Rules
- Use only the services set up above. The read-only calls they need, like listing ids or polling for results, are fine.
- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
