AI-Driven Exam Question Paper Generation and Email Delivery - n8n Workflow

Automate academic content creation with this advanced n8n workflow. Input syllabus details, use GPT-4 AI agents to generate structured, Bloom's Taxonomy-aligned question papers, and instantly email the formatted results.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Academic professionals and educators needing rapid question paper generation.
n8n users interested in complex AI automation workflows involving parallel LangChain agents.
Developers looking for examples of using the n8n form trigger and structured AI output parsing.
Organizations seeking to create and distribute tailored educational content using n8n templates.

Overview

This sophisticated n8n workflow solves the tedious problem of manually creating structured, diverse question papers that adhere to specific educational standards like Bloom’s Taxonomy. It provides immense value by allowing users to input raw syllabus units via a user-friendly form. The core of this n8n template lies in its use of parallel processing with multiple OpenAI (GPT-4) agents. Each AI n8n node is assigned a specific task—generating Part A (low complexity), Part B (mid-complexity), and Part C (high-complexity) questions—ensuring the resulting paper is well-balanced and professionally formatted using an HTML n8n node before being delivered via a Gmail n8n node. This end-to-end automation transforms syllabus into a finalized, ready-to-use exam paper instantly.

How it Works


  1. Start: The process begins with the On form submission n8n trigger, where the user submits the subject name, two units of syllabus content, and their receiving email address.

  2. Parallel AI Generation: The data immediately flows into three separate AI Agent branches simultaneously:

Part A Agent: Generates four 2-mark questions focusing on “Remember” and “Understand” levels using a dedicated OpenAI Chat Model n8n node (GPT-4 Turbo).
Part B Agent: Generates four 13-mark questions structured as pairs (a/or/b) focusing on “Apply” and “Analyze” levels, using another OpenAI Chat Model n8n node (GPT-4).
Part C Agent: Generates two 14-mark questions structured as pairs (a/or/b) focusing on “Analyze” and “Evaluate” levels, using a third OpenAI Chat Model n8n node (GPT-4o-mini).
Crucially, each agent is paired with a Structured Output Parser n8n node to enforce strict JSON output formatting.

  1. Data Consolidation: The results from the three parallel streams are collected using two consecutive Merge n8n nodes.

  2. Final JSON Structuring: A Code n8n node combines the 'QuestionsA', 'QuestionsB', and 'QuestionsC' arrays into a single, clean JSON object, making integration into the final document easy.

  3. HTML Formatting: The QP Formatter with HTML n8n node takes the consolidated JSON output and injects the questions into a complex HTML template designed to look like a professional question paper, dynamically including the submitted subject code.

  4. Delivery: The final step uses the Gmail n8n node to send the beautifully formatted HTML content directly to the user's submitted email address, concluding this powerful n8n workflow.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON and import it directly into your n8n instance using the "New -> Import from JSON" option.

  2. Set Up Credentials:

OpenAI: This n8n workflow requires an OpenAI API Key credential configured for the OpenAI Chat Model nodes. Ensure this key has access to the GPT-4 models specified (GPT-4 Turbo, GPT-4o-mini).
Gmail: Configure a Gmail OAuth2 credential for the final Gmail n8n node to allow the workflow to send emails from your account.

  1. Activate the Form Trigger: The On form submission n8n trigger needs to be activated. Once the entire n8n template is imported and credentials are set, ensure the workflow is marked as 'Active'. Access the form URL provided by the n8n trigger node to begin using the automation.

  2. Customization (Optional): Review the QP Formatter with HTML n8n node if you wish to change the college name, header details, or the visual styling of the generated question paper.

Node Details

On form submission (n8n trigger): The entry point for the n8n workflow. It collects necessary syllabus details (Unit 1, Unit 2) and the recipient email.
OpenAI Chat Model (LangChain n8n node): The large language model engine, utilized three times (with different GPT-4 versions) to handle different question types and complexity levels required by the n8n template.
Part A/B/C QP Agent (LangChain Agent n8n node): These agents define the specific prompts, rules (like Bloom's Taxonomy levels and marks), and input data references ($json['syllabus for unit 1']) for the AI generation based on the required structure of the exam paper.
Structured Output Parser (LangChain n8n node): Ensures the AI output conforms to a strict JSON schema, which is vital for later merging and HTML injection in this n8n workflow.
Merge (n8n node): Essential core logic n8n nodes used to synchronize and combine the results from the parallel AI branches, ensuring all data is present before the formatting stage.
Code (n8n node): A utility n8n node used for transforming and consolidating the three generated question arrays (A, B, C) into a single, unified JSON structure ({QuestionsA: [..], QuestionsB: [..], QuestionsC: [..]}). This custom n8n node simplifies downstream processing.
QP Formatter with HTML (HTML n8n node): Responsible for taking the cleaned data and embedding it into a professional, predefined HTML structure, ready for email delivery. This node uses expression to pull data from the Code and the initial n8n trigger.
Gmail (n8n node): The final action n8n node, sending the formatted question paper as the email body to the address captured by the initial n8n trigger.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Gracewell
Gracewell

Featured*