{
  "name": "Generate structured exams from PDFs with OpenAI GPT-4o and HTML to PDF",
  "nodes": [
    {
      "id": "cffb63a4-8e42-437e-bd9c-1d6a16e5eeee",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -160,
        64
      ]
    },
    {
      "id": "0ba4e4b7-a5da-46cf-aeb9-07567ed28be2",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        496,
        48
      ]
    },
    {
      "id": "8c9dc848-766e-4e10-8bcb-f873a2b6812a",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        96,
        656
      ]
    },
    {
      "id": "fed1bbb3-7548-47eb-8f1b-da99de9be2b6",
      "name": "Parse JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        656
      ]
    },
    {
      "id": "273dfa0f-5e1c-47b1-985c-235da64a6463",
      "name": "Clean Text",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        48
      ]
    },
    {
      "id": "0e4eb4a7-25d6-49eb-9106-af82daf5209c",
      "name": "Convert HTML to PDF - Exam",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        -112,
        1264
      ]
    },
    {
      "id": "8cd1950a-7eba-42e5-8903-d3becd42f2bc",
      "name": "Convert HTML to PDF - Answer",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        -112,
        1072
      ]
    },
    {
      "id": "c8dabac7-0bfc-411b-97c7-0f6c21dcc379",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        128,
        1264
      ]
    },
    {
      "id": "5216e3ac-c362-41f1-94a8-e497ae747183",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        128,
        1072
      ]
    },
    {
      "id": "ba6d1641-7c82-4cc7-a89d-b4438b6e8c53",
      "name": "Length Estimation Layer",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        48
      ]
    },
    {
      "id": "67befabc-06a2-4518-a83a-f7c628c2f645",
      "name": "Validate Token > 8.000",
      "type": "n8n-nodes-base.if",
      "position": [
        1104,
        48
      ]
    },
    {
      "id": "fdc5097a-d54c-4960-b95e-906a58b11405",
      "name": "Format Exam Text",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        656
      ]
    },
    {
      "id": "c6bb4cc0-c14e-4ccb-baa4-ab9048546cbb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -448
      ],
      "parameters": {
        "width": 784,
        "height": 2496,
        "content": "# 🚀 ExamForge AI\n### Automated PDF to Structured Exam Generator (MCQ + Essay + Answer Key)\n\nGenerate structured exams automatically from text-based PDF materials using AI.\n\nExamForge AI is a productio"
      }
    },
    {
      "id": "9583f719-e279-4e99-8a1b-ba67556f3609",
      "name": "Respond Valid Parameter",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        496,
        272
      ]
    },
    {
      "id": "7e297b7a-6cb0-480c-9c4b-2184b7338c9b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -112
      ],
      "parameters": {
        "width": 1712,
        "height": 528,
        "content": "## Step 1 : Get File, Parsing and Validation file PDF\n"
      }
    },
    {
      "id": "d66457fe-5bc6-45f1-8418-bc24157d9f21",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1296,
        32
      ]
    },
    {
      "id": "de840513-497b-433a-9323-6823780e16dd",
      "name": "Condition Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        256,
        64
      ]
    },
    {
      "id": "2e4212dd-5dd0-4ccc-b5d2-f72b88d0714c",
      "name": "Validate Parameter & PDF",
      "type": "n8n-nodes-base.code",
      "position": [
        48,
        64
      ]
    },
    {
      "id": "21c3c2a2-3946-4af1-a440-7949234949fc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        432
      ],
      "parameters": {
        "width": 1712,
        "height": 528,
        "content": "## Step 2: Generate Exam and Answer\n"
      }
    },
    {
      "id": "b3207d61-69a1-41ec-ad30-7bb936b858b9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        992
      ],
      "parameters": {
        "width": 1712,
        "height": 528,
        "content": "## Step 3: Convert HTML to PDF and Send Telegram\n"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Validate Parameter & PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Text": {
      "main": [
        [
          {
            "node": "Length Estimation Layer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse JSON": {
      "main": [
        [
          {
            "node": "Format Exam Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Condition Valid": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond Valid Parameter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Parse JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Exam Text": {
      "main": [
        [
          {
            "node": "Convert HTML to PDF - Exam",
            "type": "main",
            "index": 0
          },
          {
            "node": "Convert HTML to PDF - Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Clean Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook": {
      "main": [
        []
      ]
    },
    "Validate Token > 8.000": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Length Estimation Layer": {
      "main": [
        [
          {
            "node": "Validate Token > 8.000",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Parameter & PDF": {
      "main": [
        [
          {
            "node": "Condition Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert HTML to PDF - Exam": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert HTML to PDF - Answer": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}