Free guide
The Dify Lead Machine: Automate Intake, Scoring, and Scheduling
Stop paying for bloated CRMs. Build a custom agent pipeline that qualifies leads and books calls for under $5/month.
What You Need
- Dify Account: Sign up at dify.ai.
- Cost: Free tier available for light usage.
- Make.com Account: Sign up at make.com.
- Cost: Free tier (1,000 operations/month).
- LLM API Key: Anthropic (Claude) or OpenAI.
- Cost: Pay-as-you-go. A few cents per lead processed.
- Calendar Link: A booking link from Calendly, Cal.com, or your native calendar.
- Cost: Free or standard subscription.
Step-by-Step Build
1. Create a New App in Dify
- Log in to Dify.
- Click Create Blank App.
- Select Agent (or Workflow, depending on your Dify version; Agent is best for autonomous decision-making).
- Name it:
Lead Qualifier.
2. Configure the Agent
- Go to the Model tab.
- Select your LLM (e.g.,
Claude 3.5 SonnetorGPT-4o-mini). - Set Temperature to
0.2(low creativity, high precision). - In the Prompt section, paste this system instruction:
You are a lead qualification agent.
Input: Raw lead data (name, email, company, message).
Task:
1. Determine if the lead is a qualified B2B prospect.
2. If qualified, extract: Name, Company, Pain Point.
3. If unqualified, mark as "Spam" or "Low Intent".
4. Output strictly as JSON:
{
"status": "qualified" | "unqualified",
"name": "string",
"company": "string",
"pain_point": "string",
"confidence_score": 0-100
}3. Add Tools (Optional but Recommended)
- Go to the Tools tab.
- Add HTTP Request tool if you need to check domain age or enrichment data.
- Note: For this basic setup, the LLM is sufficient. Add tools later for complex enrichment.
4. Connect Dify to Make.com
- In Dify, go to Settings → API.
- Copy your API Key and API Endpoint.
- Go to Make.com.
- Create a new Scenario.
- Add a Webhook module (or use an incoming email/CRM trigger).
- Add a Dify module (or use HTTP Request if no native connector exists).
- Method: POST
- URL: Your Dify API Endpoint
- Headers:
Authorization: Bearer [YOUR_DIFY_API_KEY] - Body (JSON):
{
"inputs": {
"query": "{{1.body}}"
},
"response_mode": "blocking",
"user": "make-automation"
}- Note: If Dify doesn't have a native Make module, use the standard HTTP module with the endpoint from Dify's API docs.
5. Process the Output
- Add a Text Parser or JSON module in Make.
- Extract the
statusfield from the Dify response. - Add an Iterator or Filter module.
- Condition:
statusis equal to"qualified". - If NO, stop the scenario (or send to a "Nurture" folder).
- If YES, continue.
- Condition:
6. Schedule the Call
- Add a Calendly (or Cal.com) module.
- Action: Create Invitation or Book Event.
- Map the
nameandemailfrom the Dify output to the calendar fields. - (Optional) Add an Email module to send a confirmation with the calendar link.
7. Test the Flow
- In Dify, use the Chat tab.
- Input:
Name: John Doe, Company: TechCorp, Message: We need help with our API latency. - Verify the JSON output is correct.
- In Make, send a test webhook payload.
- Confirm the calendar event is created.
Common Mistakes & Fixes
- Mistake: Dify returns text instead of JSON.
- Fix: Add to your Dify prompt:
Respond ONLY with valid JSON. No markdown, no explanations.
- Fix: Add to your Dify prompt:
- Mistake: Make.com times out.
- Fix: Ensure your Dify
response_modeis set toblockingif using synchronous processing. If using large models, increase the timeout in Make's HTTP module settings.
- Fix: Ensure your Dify
- Mistake: High costs from verbose prompts.
- Fix: Use a smaller, faster model like
GPT-4o-miniorClaude Haikufor initial filtering. Only use larger models for the final draft if needed.
- Fix: Use a smaller, faster model like
Next Step
Follow @letagentswork for more no-code AI automation blueprints.
Building agents too? Ask questions and get new builds first in Agent Lab on Telegram (free).
Made by Let Agents Work — follow @letagentswork
From the reel: Replace $300 CRM with Dify + Make + Claude for $5/mo