The Core Stack: Forms, Glue, and Brains
To build this, you need three things. First, a way to get leads. A simple web form from a tool like Tally or Jotform works perfectly. Second, you need the ‘glue’ to connect services. This is where a no-code automation platform comes in. I use Make (formerly Integromat) for almost everything. Third, you need the AI ‘brains’ β an LLM API from OpenAI or Anthropic.
The setup is straightforward. A new form submission in Tally triggers a scenario in Make. Make then sends the form data to the AI API for processing. Based on the AI’s response, Make performs another action, like sending an email or updating a CRM.
People often ask about cost. Let’s be clear: the tools are cheap, your time is not. Tally has a generous free plan. Make.com’s Core plan at $9/mo is a steal for the power it gives you, and it’s far more flexible than Zapier automations‘s equivalent pricing tier. The API calls themselves cost fractions of a cent per lead. You can qualify thousands of leads for the price of a coffee. The cost is not the barrier.
What Most Guides on AI Integration Get Wrong
Almost every tutorial I’ve seen on this topic makes a critical error. They show you a perfect, happy-path scenario where the LLM returns perfectly formatted JSON every single time. This is a fantasy.
AI Side Hustles
Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.
Get the Guide β $14
My biggest gripe is the ‘just parse the JSON’ advice. It’s terrible advice. In the real world, LLMs are non-deterministic. They will, occasionally, return broken JSON, add extra commentary, or just fail to follow instructions perfectly. If your entire automation depends on parsing a clean JSON object, it’s brittle and will fail silently. You need a validation and retry step, period. You also need a fallback for when the API call times out or throws a 500 error, which happens more than vendors admit.
Most guides also oversimplify the prompt. They show a basic prompt that works for a simple example but falls apart with real-world, messy form submissions. A production prompt needs to be much more specific, with clear instructions, examples of the desired output format, and constraints on what to do with ambiguous or junk input. We’ll build one of those next.
Step-by-Step: Building the Lead Qualification Agent
Let’s build the core logic in Make.com. This is the operator playbook for a reliable AI integration that filters and classifies incoming leads.
- The Trigger: Start with a ‘Watch for New Submissions’ module for your form tool (e.g., Tally). This kicks off the automation whenever someone fills out your contact form.
- The First AI Call (Classification): Add an OpenAI or Anthropic module. You’ll make an API call to the chat completions endpoint. The goal here is to classify the lead and extract structured data. Hereβs a prompt that actually works:
You are a lead qualification expert for a B2B automation agency. Your task is to analyze the following contact form submission and return a JSON object with your analysis. DO NOT add any commentary before or after the JSON.Your JSON response must have the following structure:{ "lead_quality": "[Hot, Warm, Junk]", "summary": "[A one-sentence summary of the user's request]", "suggested_next_step": "[A brief suggestion for the next action, e.g., 'Schedule a call' or 'Send pricing guide']", "is_spam": [true, false]}Here is the form submission data:Name: {{1.name}}Email: {{1.email}}Message: {{1.message}}Now, provide your analysis in the specified JSON format.
Notice the specifics: the role, the explicit instruction for a JSON-only response, the exact structure with keys, and the placeholders `{{1.name}}` for mapping the form data.
- Parse and Validate: Add a ‘Parse JSON’ module to process the AI’s response. This is critical. After parsing, add a Router. One path is for successfully parsed data. The other path is for failures. The failure path should send you a notification (e.g., a Slack message) with the raw, unparsed text from the AI so you can see what went wrong. Don’t skip this.
- The Router (Decision Making): After the successful parse, add another Router with multiple paths based on the `lead_quality` field. You’ll have a path for ‘Hot’, ‘Warm’, and ‘Junk’.
- The Actions: On the ‘Hot’ path, you might add a new row to a Google Sheet and send a high-priority Slack notification to yourself. On the ‘Warm’ path, you could use another AI call to draft a personalized follow-up email. On the ‘Junk’ path, you do nothing. The lead is filtered out automatically.
This structure creates a basic but effective ai agent framework that can make decisions and route tasks without your input.
