{
  "name": "Grade PDF assignments with Google Gemini and upload reports to Google Drive",
  "nodes": [
    {
      "id": "0ed000fc-5884-4d56-a94c-c6bf2722c173",
      "name": "Webhook - Upload Test Paper",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1872,
        -464
      ]
    },
    {
      "id": "14bf826a-9bba-410c-9482-2578ea26b949",
      "name": "Extract Text from Test Paper",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1648,
        -464
      ]
    },
    {
      "id": "7acd4df7-f43b-480c-a7a3-2ea497c6ad2e",
      "name": "Prepare Assignment Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1424,
        -464
      ]
    },
    {
      "id": "243a790d-0757-4814-83d0-4d3733dc15aa",
      "name": "Load Answer Script",
      "type": "n8n-nodes-base.set",
      "position": [
        -1200,
        -464
      ]
    },
    {
      "id": "a3932528-d56a-49c1-9242-c26cf539f43f",
      "name": "AI Agent - Grade Assignment",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -976,
        -464
      ]
    },
    {
      "id": "27d5f8e7-2af0-4df9-9420-0eca38b94e04",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -832,
        -240
      ]
    },
    {
      "id": "95194943-b7c5-4a0c-a2f5-a0a9ab3243b9",
      "name": "Generate Results Table",
      "type": "n8n-nodes-base.code",
      "position": [
        -624,
        -464
      ]
    },
    {
      "id": "26226c89-7643-472c-9fea-b14e2370eb63",
      "name": "Convert to CSV File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -176,
        -464
      ]
    },
    {
      "id": "da46bbc9-f392-4c18-b2e8-2c84506854dd",
      "name": "Prepare CSV Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -400,
        -464
      ]
    },
    {
      "id": "2eb6444f-ec80-4d99-9cda-16f3ffdb908b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -976,
        -240
      ]
    },
    {
      "id": "2d334fb3-448f-4bcf-b6ee-5516c1aef5ae",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        48,
        -464
      ]
    },
    {
      "id": "9b832100-ecbc-4d17-bba2-5039bdfa4157",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        -768
      ],
      "parameters": {
        "width": 560,
        "height": 464,
        "content": "## AI Assignment Grader\n\n\n### How it works\n1. The workflow triggers when a student's test paper is uploaded via a webhook.\n2. It extracts text from the uploaded PDF and loads a predefined answer scrip"
      }
    },
    {
      "id": "3f2f4532-bb4b-4f3a-8593-52f998c2b1de",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -544
      ],
      "parameters": {
        "width": 656,
        "height": 288,
        "content": "## Get question paper\n"
      }
    },
    {
      "id": "b85e3a83-db4b-4b30-943c-c1a5521a275c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        -544
      ],
      "parameters": {
        "width": 736,
        "height": 464,
        "content": "## check answers "
      }
    },
    {
      "id": "a63b898a-15a8-4c45-a741-6aaffc075733",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -544
      ],
      "parameters": {
        "width": 704,
        "height": 256,
        "content": "## upload result to drive"
      }
    }
  ],
  "connections": {
    "Prepare CSV Data": {
      "main": [
        [
          {
            "node": "Convert to CSV File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Answer Script": {
      "main": [
        [
          {
            "node": "AI Agent - Grade Assignment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to CSV File": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Results Table": {
      "main": [
        [
          {
            "node": "Prepare CSV Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Assignment Data": {
      "main": [
        [
          {
            "node": "Load Answer Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Grade Assignment",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent - Grade Assignment",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Grade Assignment": {
      "main": [
        [
          {
            "node": "Generate Results Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Upload Test Paper": {
      "main": [
        [
          {
            "node": "Extract Text from Test Paper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from Test Paper": {
      "main": [
        [
          {
            "node": "Prepare Assignment Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}