Overview
Build a Dify workflow that refines a draft sales email in stages, then has a final reviewer step label it send, defer or disqualify and routes it to the right queue for a person.
Problem or Objective
- Which agents draft personalised outreach to prospects for a person to approve before sending?
- Which agents research inbound business leads, score them or draft replies for a person to review?
More in Sales, Marketing and Support
AI Agents and Models
Tools and Integrations
- Tools
- Dify
- Prerequisites
- A Dify workspace (cloud or self-hosted), an LLM provider, lead data you may lawfully use, and your own email tool for sending after approval.
How It Works
In Dify, create a workflow whose input is one lead record and one draft email. Add an LLM step that tightens the draft, then a second LLM step that checks every claim in the email against the lead record and flags anything unsupported. Add a final reviewer LLM step that returns one label, send, defer or disqualify, with a one-line reason, using rules you write: for example disqualify if the lead is on your suppression list or outside your market, defer if key facts are missing. Use an If-Else node on that label to route each case. Send-labelled drafts go to a review list where a person reads and approves each one before sending it from your own email tool; deferred and disqualified leads are logged with the reason.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Dify.
- Connect the toolsConnect the tools this workflow relies on: Dify.
- Check the prerequisitesA Dify workspace (cloud or self-hosted), an LLM provider, lead data you may lawfully use, and your own email tool for sending after approval.
- Gather your detailsCollect what the prompt asks for: Lead data passed in, Refined draft from the earlier step, When to disqualify, When to defer.
- Run the starter promptPaste the starter prompt below into Dify and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at github.com before you rely on it.
Practical Starter Prompt: Label a sales draft for the review queue
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are the final reviewer for outbound email. Lead record: [Lead data passed in]. Draft: [Refined draft from the earlier step]. Rules: disqualify if [When to disqualify]; defer if [When to defer]; otherwise send. Check that every claim in the draft is supported by the lead record. Return only a JSON object with label (send, defer or disqualify), reason in one sentence, and unsupported_claims as a list. A send label only puts the draft in the queue for a person to approve; never send anything.Route on the label with an If-Else node. A person reads and approves every send-labelled draft before it goes out from your email tool.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Dify README describes building and testing AI workflows on a visual canvas, and the If-Else page says the node routes execution down different paths based on conditions, using variables that can come from LLM responses. No cited page shows a sales email gate, so how consistently the reviewer step labels drafts is untested here.
Limitations and Considerations
An LLM reviewer can mislabel drafts, so a person still approves every email before it is sent, and nothing in this workflow sends mail by itself. Check your email tool and contact data for suppression lists and opt-outs, and follow the rules on unsolicited commercial email where you and your leads are. Keep lead data in the workflow to what the email needs. Test the labels on a set of past drafts before relying on them. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About langgenius/dify
Dify vs Flowise vs Langflow: Best Open Source AI Workflow Builder (opens in a new tab)
Walkthrough of dify by StackWhiz: its description links the GitHub repository.
Watch on YouTube (opens in a new tab)About langgenius/dify
Dify Explained: Build AI Workflows, RAG and Agents in One Place (opens in a new tab)
Walkthrough of dify by Ilm Initiative: its description links the GitHub repository.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- langgenius/dify README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- Build and test powerful AI workflows on a visual canvas, leveraging all the following features and beyond.
- If-Else - Dify Docs (opens in a new tab)
Project documentation · docs.dify.ai · Undated · Source checked 27 Nov 2026, 08:45 UTC
What this source supports
- The If-Else node adds decision-making logic to your workflows by routing execution down different paths based on conditions you define.
- Variables can come from user input, LLM responses, API calls, or any other workflow node output.

