Skip to main content
Let’s look back at the upgrades we’ve made for our email assistant.
  • Learned to Read: It can search a Knowledge Base
  • Learned to Choose: It uses Conditions to make decisions
  • Learned to Multitask: It handles multiple questions via Iteration
  • Learned to Use Tools: It can access the Internet via Google Search
These nodes work, but we have had to describe every step in advance. What if we could give the job to an AI teammate that already knows how to reason, use its resources, and improve over time? Meet your AI teammate: the Agent.

From Workflow to Agentic Workflow

A traditional workflow follows a path designed by its builder. An Agentic workflow combines that dependable structure with an Agent that can decide how to complete a task inside the boundaries you set. Think of the workflow as the shared operating procedure and the Agent as the teammate performing part of it:
  • The workflow supplies inputs, order, checks, fallbacks, and outputs.
  • The Agent works toward a goal, uses its available knowledge and tools, and returns a result.
  • The Agent node is where that Agent appears in this particular workflow.
The same Agent can be invited into several workflows, or even appear more than once in one workflow. Its core identity and capabilities belong to the Agent. The instructions you add in an Agent node describe only its job at that point in the workflow. You do not need to install or select a reasoning strategy. The Agent manages its own reasoning loop. Your job is to give it the right assignment, inputs, and expected outputs.

Agent & Agent Node

There are two ways to add an Agent to a workflow:
  • Invite an Agent: Reuse an existing Agent that you or your team has already built.
  • Start from Scratch: Create a one-time Agent directly on the canvas. This is useful for a role that exists only in this workflow. You can save it to Agents later if it becomes reusable.
In the earlier lessons, we did not create an agent, so we will start from scratch and this tutorial works from a clean workspace. At the end, you can save it to the Agents page and reuse it elsewhere. After this lesson, the whole workflow is: Start → Knowledge Retrieval → Product Support Agent → Output

Hands-on 1: Create an Agent

Our goal is to replace the entire manually orchestrated middle section with one Agent. The Agent will receive the complete customer email, identify and answer every question, and return one coherent email body.
1

Remove Extra Nodes

Starting from Lesson 7’s workflow, delete the Parameter Extractor and the Iteration node (everything inside it goes with it), leaving only Start and Output.
2

Add Knowledge Retrieval

After Start, click + and add a Knowledge Retrieval node. Select the Dify product Knowledge Base used in the previous lessons.
3

Add an Agent Node

After Knowledge Retrieval, click +, choose Agent, and select Start from Scratch.
This opens the agent’s setup over the workflow canvas:
  • The Configure panel on the left contains the model, prompt, skills, files, tools, etc. You can set them up manually.
  • Build on the right lets you build your agent by chatting, and the configuration is filled automatically.
  • Preview lets you try the Agent before returning to the workflow.
4

Connect to the Required Resources

Before entering Build mode, do a quick setup:
  • Model: select a compatible model if the current model is missing or marked incompatible.
  • Tools: add Google Search.
5

Build the Agent by Chatting

In Build mode, enter the following request.
After the build finishes, the agent has set up its own assets:
  • product-support: an embedded skill carrying the Agent’s support behavior and source-use rules.
  • build_note.md: a note recording what was set up during the build chat.
6

Add the Main Prompt

After you click Apply, Build mode closes and the Configure panel becomes editable again. Add the following instruction to Prompt:
The generated skill defines the Agent’s reusable product-support expertise. The prompt adds a clear rule for when the Agent should use Google Search.
7

Preview the Agent

Switch to Preview and ask a Dify product question to confirm the agent answers concisely and searches only when necessary.When the setup looks correct, close it and return to the workflow canvas.
🎉 The Agent is ready now.

Hands-on 2: Assign the Workflow Task

Now the Agent has a reusable role, support expertise, and a search tool. Next, let’s give it an assignment of what to do in this workflow.
1

Provide the Email and Retrieved Knowledge

Select the Agent node. In Agent task, describe this step’s assignment:
Type / to insert email_content from User Input and result from Knowledge Retrieval, so they arrive as variables rather than plain text.
2

Connect the Output Node

Click the Output node and set its variable to the Agent’s text output. This way, the workflow returns the generated email reply.
Here comes the final workflow.
Click Test Run and input a customer email with a few questions. The Agent answers from the retrieved knowledge and searches only when it needs to.

Optionally Save the Agent

The Product Support Agent is already stored as part of this workflow. You do not need to save it separately to continue to the next lesson. To reuse it in other workflows: click the Agent node to open its setup, then in Configure, click and select Save to Agents.
Give the agent a name, an icon, and a description.

Mini Challenge

  1. Add a requirement that the Agent clearly labels information obtained from an Internet search.
  2. Ask one question that cannot be answered from either the retrieved knowledge or Google Search. Confirm that the Agent acknowledges the limitation instead of omitting the question.
Last modified on August 27, 2026