{
  "schema_version": "1.0.0",
  "id": "hunter-work-email-to-sheet",
  "title": "Find a work email and write it back to Sheets",
  "category": "scraping-enrichment",
  "difficulty": "beginner",
  "featured": true,
  "description": "For each prospect row with a name and company domain, ask Hunter for the work email and its confidence, and write both back to the same row.",
  "tags": [
    "hunter",
    "google-sheets",
    "enrichment",
    "prospecting",
    "outreach"
  ],
  "apps": [
    "Google Sheets",
    "Code by Zapier",
    "Hunter"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Google Sheets",
    "event": "New Spreadsheet Row",
    "kind": "polling",
    "title": "New prospect row",
    "why": "Fires for each new row added to the To enrich tab. Paste or import names and domains; each row is looked up once.",
    "config": {
      "Drive": "My Google Drive",
      "Spreadsheet": "Prospects",
      "Worksheet": "To enrich"
    },
    "outputs": [
      "row_number",
      "full_name",
      "company",
      "domain",
      "source"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "name",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Split the full name",
      "why": "Hunter wants first and last name separately. This handles \"Dr. Maria van der Berg\" and \"OKAFOR, Dana\" without a helper column.",
      "code": {
        "language": "javascript",
        "module": "split-name",
        "file": "code/split-name.js"
      },
      "input_data": {
        "full_name": "{{trigger.full_name}}"
      },
      "outputs": [
        "first_name",
        "last_name",
        "display_name"
      ]
    },
    {
      "key": "hunter",
      "kind": "search",
      "app": "Hunter",
      "event": "Find Email",
      "title": "Ask Hunter for the work email",
      "why": "Looks up the most likely address at the domain and Hunter's confidence score. A miss is not an error, so the row is still updated.",
      "fields": {
        "Domain": "{{trigger.domain}}",
        "First Name": "{{name.first_name}}",
        "Last Name": "{{name.last_name}}",
        "Should this step be considered a \"success\" when nothing is found?": "Yes"
      },
      "outputs": [
        "email",
        "score",
        "position",
        "verification_status",
        "_zap_search_was_found_status"
      ]
    },
    {
      "key": "update",
      "kind": "action",
      "app": "Google Sheets",
      "event": "Update Spreadsheet Row",
      "title": "Write the result back to the row",
      "why": "Writes the email, score, and a status into the same row, so the sheet shows which prospects are ready.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Prospects",
        "Worksheet": "To enrich",
        "Row": "{{trigger.row_number}}",
        "Columns": {
          "first_name": "{{name.first_name}}",
          "last_name": "{{name.last_name}}",
          "email": "{{hunter.email}}",
          "hunter_score": "{{hunter.score}}",
          "hunter_status": "{{hunter.verification_status}}",
          "found": "{{hunter._zap_search_was_found_status}}",
          "enriched_at": "{{meta.human_now}}"
        }
      },
      "outputs": [
        "id",
        "row_number"
      ]
    }
  ]
}
