Skip to template content
🤖

Random Question Generation

No ratings yet
779

This Chatflow template generates a custom number of practice questions on a user-specified subject. Users type a natural-language request (e.g. "Give me 3 Linear Algebra questions from Chapter 3") into the chat. A Knowledge Retrieval node fetches matching items from a connected question-bank knowledge base, and an LLM node filters and formats them according to the requested subject and count. The selected questions are streamed back as the assistant's reply. Ideal for teachers and learners who need quick, on-demand exercises without writing them by hand.

Others
React Flow mini map

Setup steps

  1. Create a new Chatflow. In Dify Studio, click Create Application → Chatflow. Name it .

  2. Add a USER INPUT node. This is the entry point where the user's request (e.g. "Give me 3 Linear Algebra questions") enters the workflow.

  3. Add a KNOWLEDGE RETRIEVAL node and connect it to a knowledge base that contains your question–answer pairs. A Markdown-formatted Excel question bank is recommended.

  4. Add an LLM node. Pick a chat-capable model such as GPT-5 or GPT-4o-mini.

  5. Paste the prompt into the LLM node's SYSTEM field. The prompt defines an exercise-filter-and-output agent and references two variables:

    • — the user's natural-language request
    • — items returned by the Knowledge Retrieval node

    The prompt lists six rules: parse intent · filter by subject · answer-switch · quantity-adapt · output format · stay on-topic.

  6. Add an ANSWER node and connect the LLM output to it so the assistant can stream the questions back to the user.

  7. Save and Test Run. Send a sample request such as "Give me 3 Linear Algebra questions" and verify the reply contains exactly the requested number of matching questions.

Give a rate
TYPE
Chatflow
PLUGINS
app icon
Openai
Dify Compatibility
1.14.0
SUPPORTED LANGUAGES
English
LAST UPDATED
Aug 21, 2026
SHARE WITH