Skip to main content

Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail

Workflow preview

Workflow preview
100%
Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail preview
Open on n8n.io

1. Workflow Overview

This workflow transforms any textbook PDF into a fully interactive quiz — automatically. Users upload a PDF, choose difficulty & number of questions, and the system: Extracts content Generates MCQs...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-uploadtourl.uploadtourl, n8n-nodes-base.gmail, n8n-nodes-base.extractfromfile, n8n-nodes-base.formtrigger, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.code, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jitesh Dugar.

Original n8n.io source

1.1 Workflow description

Title
Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail
Workflow name
Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail

This workflow transforms any textbook PDF into a fully interactive quiz — automatically.

Users upload a PDF, choose difficulty & number of questions, and the system:

  • Extracts content
  • Generates MCQs using AI
  • Builds an interactive quiz webpage
  • Uploads it online
  • Sends a shareable link via email

✨ Key Features

  • 📥 Form-based PDF upload
  • 🤖 AI-generated MCQs (with explanations)
  • 🎯 Custom difficulty & question count
  • 🌐 Interactive HTML quiz (instant feedback)
  • 🔗 Public shareable link
  • 📧 Automated email delivery
  • ⚡ Fully automated workflow

🧩 Workflow Breakdown (Node-by-Node)


🟢 1. Get-Details (Form Trigger)

What it does: Acts as the entry point of the workflow.

How it works:

  • Displays a form to the user
  • Collects:
  • Name
  • Email
  • PDF file
  • Number of questions (10 / 20 / 30)
  • Difficulty (Easy / Medium / Hard)
  • Once submitted → triggers the workflow

🟣 2. Extract from File

What it does: Extracts text from the uploaded PDF.

How it works:

  • Takes the uploaded PDF (binary data)
  • Uses n8n’s built-in PDF parser
  • Converts PDF → plain text
  • Passes extracted text to the AI node

🔵 3. Generate-MCQ (AI Node)

What it does: Converts textbook content into MCQs using AI.

How it works:

  • Receives extracted text
  • Reads user inputs:
  • Number of questions
  • Difficulty level
  • Sends structured prompt to Google Gemini
  • Forces AI to return strict JSON format
  • Output includes:
  • Question
  • 4 options
  • Correct answer
  • Explanation

🟡 4. Template (Code Node)

What it does: Builds a fully interactive quiz webpage.

How it works:

1. JSON Parsing

  • Cleans AI response
  • Converts string → JavaScript object
  • Handles parsing errors safely

2. Personalization

  • Fetches user's name
  • Adds it to quiz header

3. HTML Generation

  • Creates styled quiz layout
  • Includes:
  • Questions
  • Multiple choice options
  • Answer + explanation

4. Interactivity (JavaScript)

  • User clicks an option →
  • Shows correct/incorrect
  • Displays explanation
  • Locks answer

Output:

  • Generates a .html file

🟢 5. Upload a File (UploadToURL) ⭐

What it does: Uploads the generated quiz and creates a public shareable link.

How it works:

  • Takes the HTML file from previous node
  • Uploads it to the internet
  • Instantly returns a public URL

🔥 Why this node is powerful:

  • No hosting required
  • No backend setup
  • Instant file sharing
  • Perfect for automation workflows

👉 UploadToURL - Turn Files into Shareable Links

  • Turn any file into a live URL
  • Share instantly with anyone

🟠 6. Send a Message (Gmail)

What it does: Sends the quiz link directly to the user.

How it works:

  • Uses email collected from form
  • Personalizes message with user name
  • Inserts public quiz URL
  • Sends a clean, clickable email

Result: User receives their interactive quiz instantly 📧


🎯 Use Cases

  • 📚 Students → Practice from textbooks
  • 👨‍🏫 Teachers → Generate quizzes instantly
  • 🧠 EdTech → Build learning tools
  • 📈 Creators → Convert content into interactive experiences

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 2 - Upload a File

Type / Role
n8n-nodes-uploadtourl.uploadToUrl - uploadToUrl
Config choices
Version 1

Block 3 - Send a message

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 4 - Extract from File

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 5 - Get-Details

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.5

Block 6 - Generate-MCQ

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.9

Block 7 - Template

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail
Complexity advanced
Nodes 15
Categories Document Extraction, Multimodal AI
Author Jitesh Dugar
Published 06 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15512/15512.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail do?

This workflow transforms any textbook PDF into a fully interactive quiz — automatically. Users upload a PDF, choose difficulty & number of questions, and the system: Extracts content Generates MCQs...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, Multimodal AI use case.