How to

Deep Research Workflow in Dify: A Step-by-Step Guide

Learn how to build a Deep Research workflow with Dify using three key components: loop variables, structured outputs, and Agent nodes.

Evan Chen

Product Manager

Jing Yan

Technical Writer

Written on

May 20, 2025

Share

Share to Twitter
Share to LinkedIn
Share to Hacker News

How to

·

May 20, 2025

Deep Research Workflow in Dify: A Step-by-Step Guide

Learn how to build a Deep Research workflow with Dify using three key components: loop variables, structured outputs, and Agent nodes.

Evan Chen

Product Manager

Jing Yan

Technical Writer

Share to Twitter
Share to LinkedIn
Share to Hacker News

How to

Deep Research Workflow in Dify: A Step-by-Step Guide

Learn how to build a Deep Research workflow with Dify using three key components: loop variables, structured outputs, and Agent nodes.

Evan Chen

Product Manager

Jing Yan

Technical Writer

Written on

May 20, 2025

Share

Share to Twitter
Share to LinkedIn
Share to Hacker News

How to

·

May 20, 2025

Deep Research Workflow in Dify: A Step-by-Step Guide

Share to Twitter
Share to LinkedIn
Share to Hacker News

How to

·

May 20, 2025

Deep Research Workflow in Dify: A Step-by-Step Guide

Share to Twitter
Share to LinkedIn
Share to Hacker News

Standard search queries often fail with complex problems. For academic papers, market analyses, or code debugging, finding complete answers typically means piecing together dozens of separate searches. This is where Deep Research comes in – a capability that tackles this everyday challenge head-on. Leading AI platforms such as Google Gemini, ChatGPT, and DeepSeek-R1 now offer this powerful feature.

Deep Research stands out through its smart feedback loop: it identifies knowledge gaps, targets specific questions, explores systematically, and delivers comprehensive reports. Unlike traditional search that fragments information, Deep Research provides answers that go broad and dive down.

This guide will show you how to build a Deep Research workflow with Dify using three key components: loop variables, structured outputs, and Agent nodes. You will create a workflow that researches independently and delivers meaningful insights.

Workflow Overview

This Deep Research workflow in Dify follows three phases:

  1. Intent Identification: The workflow capture your research topic, gather initial context, and analyze goals to establish a clear direction.

  2. Iterative Exploration: The workflow uses loop variables to assess knowledge to find gaps, run targeted searches, and build findings progressively.

  3. Synthesis: All collected information becomes a structured report with proper citations.

It mirrors expert researchers’ thinking: “What do I know already? What’s missing? Where should I look next?”

Phase One: Research Foundation

Start Node

You should begin by configuring the Start node with essential input parameters:

  • research topic: The central question requiring exploration

  • max loop: The iteration budget for this research session

Background Knowledge Acquisition

We recommend using the Exa Answer tool to gather preliminary information, ensuring the model understands terminology before going deeper.

Intent Analysis

You need to use an LLM node to excavate the user’s true intent, and thus distinguish between surface-level questions and further information needs.

Phase Two: Dynamic Research Cycles

Loop Node: The Research Engine

The Loop node powers the entire research. In Dify, it transfers information across iterations so each cycle builds on previous discoveries.

Our Deep Research workflow tracks six crucial variables:

  • findings: New knowledge discovered in each cycle

  • executed_querys: Previously used search queries (prevents redundancy)

  • current_loop: Iteration counter

  • visited_urls: Source tracking for proper citation

  • image_urls: Visual content references

  • knowledge_gaps: Identified information needs

Loop variables fundamentally differ from standard variables:

  • Normal references follow a linear path: Node 1 → Node 2 → Node 3

  • Loop with Previous Iteration Reference creates a knowledge network: nodes can access outputs from both current and previous iterations

This design accumulates knowledge, avoids redundant work, and sharpens focus with each cycle.

Reasoning Node: Asking Better Questions

The Reasoning node works with a structured output format:

{
    "reasoning": "Detailed justification for the chosen action path...",
    "search_query": "Specific follow-up question targeting knowledge gaps",
    "knowledge_gaps": "Information still needed to answer the original question"
}

By enabling Dify’s structured output editor in an LLM node, you will receive consistent JSON that downstream nodes can process reliably. This allows for clean extraction of reasoning paths, search targets, and knowledge gaps.

Agent Node: Doing the Research

Good questions mark just the beginning. Effective research requires decisive action, which is exactly what Agent node excels at.

These nodes act as autonomous researchers by selecting the most suitable tools for each context. Our workflow equips Agents with:

Discovery Tools

  • exa_search: Does web searches and collects results

  • exa_content: Obtains full content from specific sources

Analytical Tools

  • think: Functions as the system’s reflection engine, inspired by Claude’s Think Tool. It enables the Agent to evaluate findings, identify patterns, and determine next steps, which is quite similar to a researcher pausing to consolidate notes and plan their approach.

We can optimize performance by providing Agents with only what they need: just the search_query from the previous LLM node instead of the entire context. This focused approach boosts tool selection accuracy.

URL Extraction

The workflow automatically identifies URLs and visual references from Agent responses, which leads to proper tracking of all information sources.

In each iteration, the Agent completes a full research cycle by gathering information, processing content, and integrating findings.

Variable Assignment

After each cycle, the Variable Assigner node updates the research state. This ensures that each iteration builds on previous work rather than duplicating efforts.

Phase Three: Research Synthesis

Once multiple exploration cycles finish, the Final Summary node takes all accumulated variables – findings, sources, and supporting data – to generate a comprehensive report.

We set up this node to maintain proper Markdown citations and compile a complete reference list. The workflow also features Answer nodes at strategic points to provide streaming updates throughout the research. These updates build toward final reports that offer thorough analysis with valid referencing, combining analytical depth with scholarly credibility.

Conclusion

This Deep Research guide shows what Dify’s agentic workflows can achieve. We have digitized expert research methods and accelerated them through automation.

The future of research is not just about having more data. It’s about smarter ways to explore it. Take these patterns and build your research engines today.

Reference

On this page

    Related articles

    Get your AI applications production-ready from day one. Dify offers a complete platform to build, test, and deploy reliable AI solutions for teams at any scale.

    © 2025 LangGenius, Inc.

    Build Production-ready AI Agent

    Get your AI applications production-ready from day one. Dify offers a complete platform to build, test, and deploy reliable AI solutions for teams at any scale.

    © 2025 LangGenius, Inc.

    Build Production-ready AI Agent

    Get your AI applications production-ready from day one. Dify offers a complete platform to build, test, and deploy reliable AI solutions for teams at any scale.

    © 2025 LangGenius, Inc.

    Build Production-ready AI Agent

    Get your AI applications production-ready from day one. Dify offers a complete platform to build, test, and deploy reliable AI solutions for teams at any scale.

    © 2025 LangGenius, Inc.

    Build Production-ready AI Agent