All workflows

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. 1

    Pull new replies

    Instantly

    List the received emails in campaign, newest first, and stop at since. 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. 2

    Sort the replies

    TypeSafe AI

    Send each reply's text as the state with a choice kind of 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. 3

    Read out the people

    Your agent

    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.

  4. 4

    Find successors

    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 matches successor_titles, with their name and email.

  5. 5

    Find the other emails

    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.

  6. 6

    Add the referrals

    Instantly

    After the user approves the list, add each person named in a referral reply to referral_campaign with their name, company and referred_by set to the name of the lead who referred them.

  7. 7

    Add the other contacts

    Instantly

    After the user approves, add each successor and each colleague named in an away reply to successor_campaign with their name and company.

  8. 8

    Close out the original leads

    Instantly

    Set 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 founders
  • since: when the last run ended, so only newer replies are read, e.g. 2026-09-28 09:00 UTC
  • referral_campaign: 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
  • successor_campaign: the Instantly campaign for successors and colleagues named in away replies, whose copy claims no referral, e.g. New contacts
  • successor_titles: the titles to look for when a lead has left, e.g. VP Sales, Head of Sales
  • min_confidence: how sure Jev must be before its answer is used without you, e.g. 0.8
  • max_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.

Notes:

  • List emails: Pass email_type=received for replies and campaign_id to narrow them to one campaign. Page with limit, up to 100, and starting_after, set to the previous response's next_starting_after.
  • Add leads to a campaign: Leads added to an active campaign can start receiving its emails: confirm the campaign first. Pass campaign_id or list_id, not both; the key needs the leads:create scope.
  • Set a lead's interest status: interest_value is 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.

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 limit and offset.
  • 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 451 means 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)

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

  1. Pull new replies with List emails (Instantly). List the received emails in campaign, newest first, and stop at since. 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 with Answer typed questions (TypeSafe AI). Send each reply's text as the state with a choice kind of 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 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.
  4. 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 matches successor_titles, with their name and email.
  5. 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.
  6. 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_campaign with their name, company and referred_by set to the name of the lead who referred them.
  7. 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_campaign with their name and company.
  8. 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.