In Dify, an agent app starts as a chatflow: create the application from blank, choose Chatflow, add a model provider, and write the instructions that define the agent’s job. A chatflow is a flow of nodes the agent runs through, and the simplest first version is a straight line: input, model, answer. Test it in the debug preview with real questions before you publish, because a published app answers real users.
What you need
- A Dify account with a model provider added
- One narrow job for the agent, written in one sentence
- Three test questions with known answers
Step 1: Create the app as a chatflow
In Dify, select Create from Blank and choose Chatflow. Give the app a name that says what it does, and confirm the model provider is added.
Step 2: Write the instructions and add the first nodes
Write instructions for the agent’s job, its tone and what it must not do. Keep the flow simple for the first version: a start, a language model step and an answer.
Step 3: Test with the three questions, then publish
Run the three test questions in the debug preview and confirm each answer is right. Fix the instructions from what goes wrong, then publish the app.
Worked example: synthetic first Dify app
The table below is a synthetic example. It shows the expected result of a first Dify chatflow; no app was built.
| Question | Answered correctly? | Result |
|---|---|---|
| Opening hours | Yes | Pass |
| How to reset a password | Yes | Pass |
| Off-topic question | Refused | Pass |
Expected result (UNTESTED). two questions are answered correctly, and the off-topic question is refused. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A chatflow needs a model provider with an embedding model when it uses a knowledge base, so add the provider first.
- Test in the debug preview before publishing, because a published app answers real users.
- Keep the first flow simple; a straight line that works beats a branching flow that does not.
