Let Agents WorkWORKFLOW

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

Step-by-Step Build

1. Create a New App in Dify

  1. Log in to Dify.
  2. Click Create Blank App.
  3. Select Agent (or Workflow, depending on your Dify version; Agent is best for autonomous decision-making).
  4. Name it: Lead Qualifier.

2. Configure the Agent

  1. Go to the Model tab.
  2. Select your LLM (e.g., Claude 3.5 Sonnet or GPT-4o-mini).
  3. Set Temperature to 0.2 (low creativity, high precision).
  4. 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)

  1. Go to the Tools tab.
  2. Add HTTP Request tool if you need to check domain age or enrichment data.
  3. Note: For this basic setup, the LLM is sufficient. Add tools later for complex enrichment.

4. Connect Dify to Make.com

  1. In Dify, go to Settings → API.
  2. Copy your API Key and API Endpoint.
  3. Go to Make.com.
  4. Create a new Scenario.
  5. Add a Webhook module (or use an incoming email/CRM trigger).
  6. 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"
}

5. Process the Output

  1. Add a Text Parser or JSON module in Make.
  2. Extract the status field from the Dify response.
  3. Add an Iterator or Filter module.
    • Condition: status is equal to "qualified".
    • If NO, stop the scenario (or send to a "Nurture" folder).
    • If YES, continue.

6. Schedule the Call

  1. Add a Calendly (or Cal.com) module.
  2. Action: Create Invitation or Book Event.
  3. Map the name and email from the Dify output to the calendar fields.
  4. (Optional) Add an Email module to send a confirmation with the calendar link.

7. Test the Flow

  1. In Dify, use the Chat tab.
  2. Input: Name: John Doe, Company: TechCorp, Message: We need help with our API latency.
  3. Verify the JSON output is correct.
  4. In Make, send a test webhook payload.
  5. Confirm the calendar event is created.

Common Mistakes & Fixes

Next Step

Follow @letagentswork for more no-code AI automation blueprints.

Best AI agents this week, every Friday

One short email: the agents and workflows we built, with the free guides. No spam.

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