🎯 Lead Generation Action
The Lead Generation Action allows your AI Agent to collect customer information such as names, phone numbers, emails, project requirements, and other details.
Collected leads can be sent to:
- Telegram
- Google Sheets
This is useful for service businesses, agencies, clinics, consultants, and any company that wants to automatically capture potential customers.
📍 Creating a Lead Generation Action
Navigate to:
AI Agents → Select AI Agent → AI Actions → Create Action → Lead Generation
Step 1: Create the Action
Fill in the basic information:
| Field | Description |
|---|---|
| Action Name | Internal name for your lead generation action |
| When To Use | Instructions for AI explaining when this action should be triggered |
Example:
- Action Name:
Web Development Lead - When To Use:
Use this action when a customer wants to order website development services.

📥 Step 2: Select Lead Destination
Choose where collected lead information should be delivered.
Available destinations:
Telegram
Send collected leads directly to a Telegram chat.
Required fields:
| Field | Description |
|---|---|
| Telegram Bot Token | Your Telegram bot token |
| Telegram Chat ID | Chat ID where leads will be sent |

Google Sheets
Store leads automatically inside a Google Spreadsheet.
To use Google Sheets:
- Click Connect
- Authorize your Google account
- Select an existing spreadsheet using Google Picker

🧩 Step 3: Configure Variables
Open the Variables tab.
Variables define what information the AI should collect from customers.
Examples:
| Variable | Description |
|---|---|
| fullname | Customer full name |
| phone_number | Customer phone number |
| Customer email address | |
| company_name | Company name |
| project_details | Project requirements |
You can mark variables as Required.
The AI will continue asking questions until all required fields are collected.

⚙️ System Variables
Ainisa automatically provides several built-in variables.
Example:
| Variable | Description |
|---|---|
| source_channel | Source of the conversation (Website, Telegram, WhatsApp, Instagram, etc.) |
These variables do not need to be collected from the user manually.
💬 Step 4: Configure Telegram Message Template
If Telegram is selected as the lead destination, open the Message Template tab.
This template defines the message that will be sent to Telegram after the AI collects lead information.
You can insert variables into the template.
Example:
A new lead has been received.
Full Name: {{fullname}}
Phone Number: {{phone_number}}
Source Channel: {{source_channel}}The AI will automatically replace variables with collected values.

📊 Google Sheets Mapping
If Google Sheets is selected as the destination, collected data will be added directly to the connected spreadsheet.
You can map variables to spreadsheet columns.
Example:
| Spreadsheet Column | Variable |
|---|---|
| A | fullname |
| B | phone_number |
| C | |
| D | source_channel |

💡 Example Workflow
- Customer visits your website
- Customer asks for a service
- AI detects that a lead should be created
- AI collects required information
- Lead is sent to Telegram or Google Sheets
- Your team receives the lead instantly
Example collected information:
- Full Name
- Phone Number
- Service Needed
- Budget
- Source Channel
✅ Notes
- Multiple Lead Generation Actions can be created for a single AI Agent.
- Variables marked as required must be collected before submission.
- Telegram destination requires a valid Bot Token and Chat ID.
- Google Sheets destination requires Google account authorization.
- System variables are automatically populated by Ainisa.