Learning Objective
By the end of this guide, you'll know how to create AI Variables from your lead list, configure AI settings for different use cases, generate personalized content at scale, and troubleshoot common issues. You'll be able to clean messy data, write tailored messages, and segment thousands of leads in seconds using AI-powered prompts.
Why This Matters
Raw lead data rarely arrives campaign-ready. Job titles have emojis, company names are inconsistent, and personalization fields need context-aware content. AI Variables automate this cleanup and personalization work that would otherwise take hours.
With AI Variables, you can:
Clean 1,000+ leads in under a minute instead of manual editing
Generate personalized intro lines that increase reply rates
Standardize inconsistent data such as job titles and company names for better segmentation
Write contextual messages based on lead information without copying and pasting
AI Variables turn messy, generic data into clean, personalized content that drives authentic conversations and higher engagement.
Prerequisites
Before you start, make sure you have:
lemlist credits available or access to a supported AI provider in the AI Variable settings
A campaign with leads imported that includes the variables you want to transform or use in prompts
Basic understanding of custom variables and how they work in lemlist sequences
Core Lesson: Step-by-Step Workflow
Phase 1: Access AI Variables
Step 1: Open your campaign's Leads list and create an AI column
In your campaign, open the Leads list tab, then click + Add in the table header and select Create AI column. This opens the AI Variable setup flow from your leads table.
Phase 2: Create Your First AI Variable
Step 2: Choose your starting point
In AI Column Templates, browse the template categories in the left panel to find a single AI column template for cleaning, copywriting, extraction, research, or segmentation.
If you want a multi-step setup that creates several AI columns together, switch to the AI Columns Workflow tab and choose a workflow from the list.
You can also skip templates and click Create from scratch to write your own prompt from the ground up. In the New AI column window, enter a name in the AI column name field and click Save. When using a workflow or template, review any required input columns before proceeding.
Step 3: Name or select your AI variable
The AI column panel opens on the Configure tab, where you write the instructions and adjust every setting yourself. Give the column a clear name so you can find it later in your sequence.
Naming examples:
personalizedOpenerfor intro linesindustryCategoryfor segmentationcompanyNameCleanedfor standardized names
💡 Tip: Use camelCase or underscores for multi-word variable names to keep them clean and readable.
Step 4: Configure AI settings
Set your AI preferences based on your use case:
Select a model: In the Configure tab, click the model name under the Instructions field (for example lemagent) and choose lemagent, OpenAI (GPT), Perplexity, Claude, Google, or SpaceXAI (Grok), then the model. To bill your own provider account instead of lemlist credits, turn on Use my own API key.
Temperature: Click Model settings next to the model name and adjust the Temperature slider to control how consistent or creative the output should be.
0 to 0.3 – Focused, consistent output for cleaning and standardization
0.4 to 0.6 – Balanced creativity and consistency
0.7 to 1.0 – More creative output for personalized writing
Apps & knowledge: Turn on Web access to let the AI search the web, AI context center to use your company context, or Record context to let the AI look up the record history: activities, tasks and campaigns. Click + Apps to add tools to the column. The list shows built-in tools, such as Extract content from webpage and LinkedIn, and the MCP servers your team has connected. One AI column can combine several servers and built-in tools. For example, you can qualify accounts with data from your CRM, extract needs and objections from meeting notes, or use internal documentation to improve personalization.
Admins can connect another server directly from the column: click + Apps, then Browse tools, select the app, and click Connect [app]. To add a server that is not listed, click Custom MCP. See Connect an MCP server to lemlist and control its tool permissions.
LinkedIn enrichment tool: AI Variables can use the LinkedIn profile enrichment tool to pull data from a lead's LinkedIn profile and use it inside your AI Variable output. Under the LinkedIn tool, you can also use the Update contact fields with LinkedIn data checkbox to control whether the enriched LinkedIn data should be written back to the contact's fields, such as job title and company name. This toggle is enabled by default, so nothing changes for existing users unless they switch it off themselves.
Cost: The cost per row is shown at the bottom of the panel, next to Generate (for example 1 / row).
Phase 3: Write and Test Your Prompt
Step 5: Write your AI prompt
If you selected a template, review and customize the prompt to fit your needs. If you're creating from scratch, write clear, specific instructions for what the AI should generate in the Instructions field.
Good prompt structure:
What to do: "Remove emojis and abbreviations from job titles"
Format: "Output only the cleaned title, no extra text"
Example: "Input: 'CEO 🚀' → Output: 'CEO'"
Example prompts:
Data cleaning:
Remove all emojis, special characters, and abbreviations from {{jobTitle}}. Return only the standardized job title. Example: "VP of Mktg 🚀" becomes "Vice President of Marketing"
Personalized opener:
Write a one-sentence personalized opener for an outreach email based on this information: {{companyName}} in {{industry}}. Keep it under 20 words, conversational tone, and mention their industry or company focus.
Categorization:
Based on {{companyName}}, determine the industry category. Choose from: SaaS, E-commerce, Finance, Healthcare, Marketing Agency, Other. Return only the category name.
💡 Pro tip: Include examples in your prompt. AI performs better when it sees the expected input-output format.
If your prompt needs more context, turn on Web access or AI context center under Apps & knowledge.
Step 6: Test your prompt
Before generating for the whole list, click Test prompt to preview the output on a sample lead.
Step 7: Enable auto-generation for new leads if needed
If you want future imports to be processed automatically, go to Run conditions and turn on Auto run.
Step 8: Generate AI variables
Once your prompt is ready, click the arrow next to Generate (Generation scope), then choose:
Generate all rows: Runs AI on every lead, overwriting any existing data in that column
Generate empty rows only: Runs AI only on leads where the variable is currently empty, preserving existing data
💡 When to use each:
All rows: When you've updated your prompt and want fresh results for everyone
Empty rows only: When adding new leads to an existing campaign with AI Variables already set up
The AI processes your leads based on your prompt. Depending on lead count and provider, this typically takes a few seconds to a minute.
Phase 4: Review and Refine Results
Step 9: Check the generated output
Once generation completes, review the AI Variable column in your Leads list. A successful output appears directly in the row, while rows with issues may show Empty output warnings.
Check for:
Accuracy: Does the output match what you expected?
Consistency: Is the format uniform across leads?
Quality: Would this content work in your sequence?
Step 10: Regenerate if needed
If the output isn't quite right:
Open the AI variable settings again from the lead list
Adjust your prompt, AI provider, or temperature
Run the generation again for all rows or empty rows only
You can iterate as many times as needed to get the right output.
💡 Refinement tip: If the output is too generic, lower the temperature and add more specific instructions. If it's too rigid, raise the temperature slightly.
Phase 5: Use AI Variables in Your Sequence
Step 11: Insert the variable into your email
Open the Sequence tab in your campaign.
Then open the email step where you want to use your AI Variable, click + Add > Add variable and pick the AI variable. You can also type {{ in the editor and pick it from the list.
The AI-generated content will automatically populate for each lead when the email is sent.
Editing Existing AI Variables
Open your campaign and go to the Leads list.
Open the AI column's header menu and click Edit AI column.
In Configure, update the instructions, model, temperature, apps, output format, or run conditions as needed.
Test the prompt again if needed, then regenerate results for all rows or only empty rows.
💡 Time-saver: If you're continuously importing leads, turn on Auto run in Run conditions so new rows are generated automatically.
Practical Application / Real-Life Example
SaaS Company Scenario: Cleaning and Personalizing at Scale
A B2B SaaS company targeting sales leaders had thousands of leads with messy job title data:
"VP of Sales 🚀"
"Head of Rev Ops (RevOps)"
"CRO | Chief Revenue Officer"
"Sales Dir."
Their workflow:
Step 1: Created an AI Variable cleanedJobTitle with this prompt:
Remove emojis, special characters, abbreviations, and parenthetical text from {{jobTitle}}. Expand abbreviations to full titles. Return only the clean title. Examples: "VP of Sales 🚀" → "Vice President of Sales", "Sales Dir." → "Sales Director"
Step 2: Set the temperature to 0.2 and chose a structured model for consistent output
Step 3: Generated for all leads
Step 4: Created a second AI Variable personalizedOpener with this prompt:
Write a one-sentence opener for a cold email to a {{cleanedJobTitle}} at {{companyName}}. Refer to their role's main challenge. Keep it under 15 words and conversational.
Step 5: Increased the temperature for more creative output
Step 6: Generated personalized openers for all leads
Results:
Data cleanup: Job titles standardized in under a minute
Personalization: Unique intro lines generated at scale
Time saved: Hours of manual work automated
Key takeaway: AI Variables transform unusable, messy data into clean, personalized content with only a few minutes of setup.
When a Template Relies on a Missing Variable
If you choose a template that requires a variable that doesn't exist in your lead data, a yellow banner appears in the AI Variable panel.
The banner shows which variable is missing, so you can update your lead data or adjust the prompt.
Fix:
Add the missing variable by importing a CSV with that column
Or create/populate that variable in your Leads list first
Then regenerate the AI Variable
The AI cannot generate output until all required input variables exist.
Troubleshooting & Pitfalls
Issue: The AI variable column is empty after generation
Root cause: The prompt may be unclear, the required input data is missing, or the AI couldn't interpret the instructions
Fix:
Check that the variable your prompt references (for example,
{{jobTitle}}) exists and contains dataMake your prompt more specific with examples of expected output
Lower the temperature to 0.2-0.3 for more consistent results
Use Test prompt before generating for your full lead list
Issue: The AI output doesn't match what I expected
Root cause: Prompt lacks specificity, temperature is too high or too low, or examples are missing
Fix:
Rewrite your prompt with explicit instructions and 2-3 input → output examples
Adjust temperature:
Too generic or robotic? Raise temperature to 0.6-0.8
Too random or inconsistent? Lower temperature to 0.2-0.4
Specify the exact format you want, such as "Return only the category name"
Issue: Yellow banner says a variable is missing
Root cause: The template requires a variable that isn't in your lead data
Fix:
Check which variable is missing in the banner message
Add that variable by importing it or filling it in on the Leads list
Regenerate the AI Variable after the variable exists
Issue: AI generation is taking too long or timing out
Root cause: Large lead list, complex prompt, or provider-side delays
Fix:
Generate in smaller batches instead of all at once
Simplify your prompt
Try a different AI provider
Wait a few minutes and try again if the provider is experiencing high traffic
Issue: I turned off LinkedIn field updates and still used credits
Root cause: The Update contact fields with LinkedIn data checkbox only controls whether enriched data is written back to the contact. It does not disable the LinkedIn enrichment itself.
Fix:
Keep in mind that LinkedIn enrichment is still billed when it runs on demand
Use the toggle only if you want to prevent changes to contact fields
Check the cost per row at the bottom of the panel before running large generations
Optimization Tips
To maximize AI Variables' effectiveness:
Start with templates, then customize: Templates give you proven prompt structures. Once you understand how they work, adapt them to your needs or create from scratch.
Use temperature strategically:
Data cleaning and categorization: 0.2-0.3
Writing subject lines or openers: 0.6-0.8
Professional formal content: 0.3-0.5
Test small before scaling: Review the output, refine your prompt, then generate for all leads once you're satisfied.
Include examples in your prompts: AI performs significantly better when you show input → output examples.
Chain AI Variables: Create one AI Variable to clean data, then create a second AI Variable that uses the first one as input.
Monitor credit usage: Check the cost per row at the bottom of the panel before running large generations.
Regenerate after data updates: If you enrich leads with new information, regenerate AI Variables to incorporate the fresh data.
Enable auto-generation: For campaigns where you continuously add leads, turn on Auto run in Run conditions.
Use specific providers for specific tasks:
OpenAI (GPT): Data cleaning, categorization, structured output
Claude: Nuanced writing and longer-form personalization
Perplexity: Research-based content
Google: Alternative option for general tasks
lemagent: Native built-in option, always uses lemlist credits
SpaceXAI (Grok): Alternative option for general tasks
Use LinkedIn enrichment intentionally: If you only want LinkedIn data to help generate AI output, turn off Update contact fields with LinkedIn data. If you also want the latest LinkedIn details saved back to the contact, leave it on.
What You Cannot Do with AI Variables
AI Variables work only on variables you create or populate in your lead list. They cannot directly overwrite system-managed default fields such as:
First Name
Last Name
Email
Company Name
LinkedIn URL
Phone
These default fields are system-managed. AI Variables are best used to create new clean, enriched, or personalized values that you can then insert into your sequence.



















