Dynamic Quiz Creator from Documents using Gemini and Jotform - n8n Workflow

Use this powerful n8n workflow to automate quiz creation. Upload a document, and the n8n node handles text extraction and uses Google Gemini to generate structured multiple-choice questions, saving them to Google Sheets and publishing the final quiz in Jotform. Explore our advanced n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Educational content creators and instructional designers.

  • Professionals needing to quickly test comprehension of large documents.

  • Users seeking advanced n8n templates leveraging AI for content generation.

  • Anyone wanting a custom, automated n8n workflow for assessment creation.

Overview

Manually creating comprehensive quizzes from lengthy documents is time-consuming and prone to human error. This n8n workflow solves that problem by providing a seamless, automated pipeline. The user simply uploads the source document via a JotForm submission, and the n8n automation takes over. It extracts all the textual content, uses the powerful Google Gemini model via an n8n node to generate a specified number of highly structured questions and answers, logs the results in Google Sheets, and finally uses the JotForm API to dynamically create a ready-to-use quiz. This end-to-end n8n workflow demonstrates high-level integration between document processing, AI, and external form builders.

How it Works

The entire process is initiated by an n8n trigger when a user submits a form, typically containing a document upload, desired number of questions, and a quiz title.


  1. Trigger & Download: The n8n trigger, configured for JotForm, captures the submission data. An immediate subsequent n8n node uses an HTTP Request to securely download the uploaded document file.

  2. Extraction: The content of the document (e.g., PDF) is extracted into raw text using a dedicated n8n node.

  3. AI Generation: The extracted text is passed to the AI Agent n8n node, which uses a specific prompt to instruct the Google Gemini Chat Model to create the required number of multiple-choice questions, ensuring the output is strictly structured JSON. The Structured Output Parser n8n node guarantees valid syntax.

  4. Data Splitting & Logging: The resulting JSON array of questions is split out using the Split Out n8n node, allowing each item (question) to be processed individually. Each question is then appended as a new row in a designated Google Sheets spreadsheet using the Google Sheets n8n node.

  5. JotForm Payload Preparation: A Code in JavaScript n8n node aggregates the generated questions and formats them into the complex URL-encoded payload required by the JotForm API, including dynamic form styling and defining the question types (radio buttons).

  6. Quiz Creation: The final HTTP Request n8n node sends this structured payload to the JotForm API, instantly creating a functional, styled quiz populated with the AI-generated questions. This completes the fully automated n8n workflow.

Installation Guide

To deploy this comprehensive n8n templates solution, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON code and import it directly into your n8n instance.

  2. JotForm Setup: Create a JotForm that includes a file upload field, a field for the desired number of questions, and a field for the quiz title. Configure the JotForm Trigger n8n node with the correct Form ID and ensure the webhook connection is active.

  3. AI Credentials: Set up credentials for the Google Gemini Chat Model (requiring a Google AI API Key).

  4. Google Sheets Credentials: Configure the Google Sheets n8n node with OAuth2 credentials and specify the target spreadsheet and sheet name where quiz details will be logged.

  5. JotForm API Key: The final HTTP Request n8n node requires a JotForm API key for creating new forms. Ensure this key is available either directly in the node parameters or via credentials. The URL parameter structure must include the API key.

  6. Testing: Run the n8n workflow manually or submit a test form to ensure all connections and the AI logic function correctly.

Node Details

This n8n workflow relies on several specialized n8n node configurations:

JotForm Trigger (n8n trigger): Initiates the flow upon submission. It captures key configuration data such as the file URL, the number of questions requested (q5numberOf), and the quiz name (q7quizName). This acts as the essential starting point for the n8n automation.
Extract from File (n8n node): Essential for handling document automation. It takes the binary file data downloaded by the previous HTTP Request and extracts the textual content, crucial input for the LLM.
AI Agent (n8n node): The core intelligence of the n8n workflow. It uses expressions to embed dynamic user inputs (like question count and topic) directly into the prompt instructing the Gemini model to generate quizzes. It is set up with an enforced Structured Output Parser to ensure clean, predictable JSON output.
Google Gemini Chat Model (n8n node): The specific LLM used for generation, connected to the AI Agent.
Structured Output Parser (n8n node): Guarantees that the AI output adheres to the required JSON schema, preventing downstream errors in data manipulation.
Split Out (n8n node): Takes the array of generated questions and splits them into individual items, preparing the data for row-by-row logging in Google Sheets.
Append row in sheet (Google Sheets n8n node): Logs the question, options, and correct_option for each item into a Google Sheet for auditing and management.
Code in JavaScript (n8n node): A powerful custom n8n node that aggregates the split items back together, constructs a valid JotForm API payload (including form styling, alignment, and dynamic question creation), transforming the raw AI data into a functional form definition.


  • HTTP Request (n8n node): The final action n8n node. It sends the carefully constructed payload to the JotForm API using a POST request to instantly publish the complete, customized quiz.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

I partner with businesses to streamline processes and accelerate growth through intelligent AI automation and Web/mobile Development. Leveraging deep expertise in GPT-4, LangChain, and n8n, I develop AI-powered agents and sophisticated LLM pipelines.

Featured*