Global AI Network
Agent Template v1.0

Email Discovery Agent with Anymail Finder

Automate email discovery from Google Sheets leads, find verified contacts via Anymail Finder, and get instant Telegram alerts—all without manual work.

15+
Deployments
10m
Setup Time
Free
Pricing

Need custom configuration?

Our solution engineers can help you adapt this agent to your specific infrastructure and requirements.

Enterprise Grade Best Practices Production Optimized

INTEGRATED_MODULES

Google Sheets
Google Sheets
Telegram
Telegram
Step by Step

Setup Tutorial

mission-briefing.md

Email Discovery Automation Workflow Setup Guide

What This Agent Does

This powerful workflow automates the process of discovering and validating email addresses for leads stored in Google Sheets. By integrating with the Anymail Finder API, it systematically searches for contact emails based on company domain and name information, then updates your spreadsheet with results and sends real-time notifications via Telegram.

Key benefits include:

  • Eliminate manual email research – Automatically find verified business emails in seconds instead of hours
  • Real-time updates – Your Google Sheet stays synchronized with discovery results instantly
  • Instant notifications – Receive Telegram alerts when emails are found or when searches complete
  • Scalable lead processing – Handle hundreds of leads in a single workflow execution
  • Organized tracking – Automatically mark leads as processed to avoid duplicate searches

Target use cases: Sales prospecting, lead enrichment, recruitment outreach, partnership research, and customer verification campaigns.


Who Is It For

This workflow is ideal for:

  • Sales teams looking to build verified contact lists without manual research
  • Recruitment professionals seeking to expand candidate outreach networks
  • Business development managers enriching lead databases with accurate contact information
  • Marketing teams validating and completing prospect information before campaigns
  • Anyone managing leads in Google Sheets who needs automated email discovery at scale

No coding experience required – this workflow handles all the technical complexity for you.


Required Integrations

Google Sheets

Why it's needed: Google Sheets serves as your central database for leads and results. The workflow reads lead information (company names and domains) from your sheet and writes discovered emails and status updates back to it, creating a seamless, organized record of all prospecting activities.

Setup steps:

  1. Enable Google Sheets API in Google Cloud Console

    • Visit Google Cloud Console
    • Create a new project or select an existing one
    • Search for "Google Sheets API" and click Enable
    • Search for "Google Drive API" and click Enable (required for file access)
  2. Create a Service Account

    • In the Cloud Console, navigate to Credentials (left sidebar)
    • Click Create CredentialsService Account
    • Enter a service account name (e.g., taskagi-sheets-automation)
    • Click Create and Continue
    • Grant the service account Editor role for Google Sheets
    • Click Continue and then Done
  3. Generate and Download Service Account Key

    • Click on the newly created service account
    • Go to the Keys tab
    • Click Add KeyCreate new key
    • Select JSON format
    • Click Create – a JSON file will download automatically
    • Keep this file secure – it contains your authentication credentials
  4. Share Your Google Sheet with the Service Account

    • Open your Google Sheet containing leads
    • Click Share (top right)
    • Copy the service account email from the downloaded JSON file (looks like name@project.iam.gserviceaccount.com)
    • Paste it in the share dialog and grant Editor access
    • Click Share
  5. Configure in TaskAGI

    • In TaskAGI, navigate to IntegrationsGoogle Sheets
    • Click Connect New Account
    • Upload the JSON key file you downloaded
    • Name this connection (e.g., Lead Discovery Sheets)
    • Click Authenticate

How to obtain credentials: All credentials are generated through the Google Cloud Console and provided in the JSON service account key file. No additional API keys are needed for Google Sheets.


Telegram

Why it's needed: Telegram provides instant notifications when your email discovery workflow completes or finds results. This keeps your team informed in real-time without constantly checking your spreadsheet.

Setup steps:

  1. Create a Telegram Bot

    • Open Telegram and search for @BotFather
    • Send the message /start
    • Send /newbot
    • Follow the prompts to name your bot (e.g., EmailDiscoveryBot)
    • BotFather will provide your Bot Token (looks like 123456789:ABCdefGHIjklmnoPQRstuvWXYZ)
    • Save this token – you'll need it for TaskAGI
  2. Get Your Telegram Chat ID

    • Search for @userinfobot in Telegram
    • Send /start
    • The bot will display your User ID (a numeric value)
    • Alternatively, add your bot to a group and use /getgroupid to get the group chat ID
    • Save this ID – required for sending messages
  3. Configure in TaskAGI

    • Navigate to IntegrationsTelegram
    • Click Connect New Account
    • Paste your Bot Token in the token field
    • Enter your Chat ID (or group ID) in the chat ID field
    • Name this connection (e.g., Lead Discovery Alerts)
    • Click Save
  4. Test the Connection

    • Click Test to send a verification message
    • You should receive a test message in Telegram
    • If successful, your integration is ready

How to obtain credentials:

  • Bot Token: From @BotFather in Telegram
  • Chat ID: From @userinfobot or by adding your bot to a conversation

Configuration Steps

Step 1: Prepare Your Google Sheet

Before running the workflow, structure your Google Sheet with these columns:

Column Header Example
A Company Name Acme Corporation
B Domain acme.com
C Email (leave blank – workflow fills this)
D Status (leave blank – workflow fills this)

Important: Ensure your sheet URL is accessible and the service account has editor permissions.

Step 2: Configure "Get Leads from Sheet" Node

  1. Click the Get Leads from Sheet node in your workflow
  2. In the configuration panel:
    • Sheet URL: Paste your Google Sheet URL (e.g., https://docs.google.com/spreadsheets/d/1ABC...)
    • Range: Enter A2:B to read company names and domains (skip header row)
    • Integration: Select your configured Google Sheets account
  3. Click Save

Data structure: This node returns an array where each item contains [Company Name, Domain]

Step 3: Configure "Loop Over Leads" Node

  1. Click the Loop Over Leads node
  2. In the configuration panel:
    • Loop Over: Select the output from "Get Leads from Sheet"
    • Item Variable: This automatically creates loop.item containing current lead data
  3. Click Save

What happens: The workflow processes each lead one at a time, with loop.item.0 = company name and loop.item.1 = domain.

Step 4: Configure "Find Email via Anymail Finder" Node

  1. Click the Find Email via Anymail Finder node
  2. In the configuration panel:
    • URL: Enter https://api.anymailfinder.com/v5/search
    • Method: Select POST
    • Headers: Add custom header:
    • Body: Use the pre-configured JSON:
      {
        "domain": "[[loop.item.1]]",
        "company_name": "[[loop.item.0]]"
      }
      
  3. Click Save

How to get Anymail API Key:

  • Sign up at anymailfinder.com
  • Navigate to SettingsAPI Keys
  • Copy your API key and paste it in the Authorization header

Step 5: Configure "Route by Email Status" Node

  1. Click the Route by Email Status node

  2. Set up two conditions:

    Condition 1 (Email Found):

    • If: [[find_email.response.email]] exists
    • Then: Route to "Update Sheet - Email Found"

    Condition 2 (Email Not Found):

    • Else: Route to "Mark as Processed (Not Found)"
  3. Click Save

Step 6: Configure "Update Sheet - Email Found" Node

  1. Click this node
  2. In the configuration panel:
    • Sheet URL: Your Google Sheet URL
    • Cell Range: C[[loop.index]] (updates column C with discovered email)
    • Value: [[find_email.response.email]]
    • Integration: Select your Google Sheets account
  3. Click Save
  4. Create a second instance to update column D (Status):
    • Cell Range: D[[loop.index]]
    • Value: Email Found

Step 7: Configure "Mark as Processed (Not Found)" Node

  1. Click this node
  2. In the configuration panel:
    • Sheet URL: Your Google Sheet URL
    • Cell Range: D[[loop.index]]
    • Value: Not Found
    • Integration: Select your Google Sheets account
  3. Click Save

Step 8: Configure "Send Telegram Alert" Node

  1. Click the Send Telegram Alert node
  2. In the configuration panel:
    • Integration: Select your configured Telegram account
    • Message: Customize your alert:
      ✅ Email Discovery Complete
      Company: [[loop.item.0]]
      Email: [[find_email.response.email]]
      Status: Processed
      
    • Parse Mode: Select Markdown for formatted text
  3. Click Save

Testing Your Agent

Test Execution Steps

1. Prepare Test Data

  • Add 2-3 test leads to your Google Sheet with real company names and domains
  • Example: Google (google.com), Microsoft (microsoft.com)

2. Run a Test Execution

  • Click Test Run in the workflow editor
  • Select Manual Trigger as your starting point
  • Click Execute

3. Monitor Execution Progress

  • Watch the execution timeline on the right panel
  • Each node will show as "Running," "Completed," or "Failed"
  • Click any node to view its input/output data

What to Verify at Each Step

Step Verification Expected Result
Get Leads from Sheet Check node output Array of [Company, Domain] pairs
Loop Over Leads Verify loop count Number matches lead count in sheet
Find Email via Anymail Check API response Email address or null value returned
Route by Email Status Confirm routing Correct path taken based on email
Update Sheet Refresh Google Sheet Email and status columns populated
Send Telegram Check Telegram app Alert message received

Success Indicators

Workflow completed successfully when:

  • All nodes show green checkmarks
  • Google Sheet displays discovered emails in column C
  • Status column (D) shows "Email Found" or "Not Found"
  • Telegram notification arrives with results
  • Execution time is reasonable (typically 2-5 seconds per lead)

Troubleshooting Tips

  • "Sheet not found" error: Verify the service account email is added as an editor
  • "Invalid API key" error: Double-check your Anymail API key in the Authorization header
  • "Telegram message failed": Confirm your Chat ID is correct and the bot has message permissions
  • No emails found: This is normal – not all companies have discoverable emails in the Anymail database

You're all set! Your email discovery automation is ready to transform your lead research process. Start with a small test batch, then scale to hundreds of leads with confidence.