{
  "name": "AI Academic Assistant Workflow",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "event": "assignmentUploaded",
        "options": {}
      },
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Process uploaded assignment\nconst assignmentData = $input.first().json;\n\n// Extract requirements\nconst requirements = {\n  fileType: assignmentData.fileType,\n  keywords: assignmentData.keywords,\n  deadline: assignmentData.deadline\n};\n\nreturn [\n  {\n    json: requirements\n  }\n];"
      },
      "name": "Process Assignment",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "resource": "schema",
        "operation": "generate",
        "schema": "={{$json}}",
        "options": {}
      },
      "name": "Generate ER Diagram",
      "type": "n8n-nodes-base.openAI",
      "typeVersion": 1,
      "position": [
        850,
        200
      ],
      "credentials": {
        "openAiApi": "<your credential>"
      }
    },
    {
      "parameters": {
        "resource": "code",
        "operation": "generate",
        "prompt": "Generate {{$node[\"Process Assignment\"].json[\"keywords\"]}} code solution",
        "options": {}
      },
      "name": "Generate Code Solution",
      "type": "n8n-nodes-base.openAI",
      "typeVersion": 1,
      "position": [
        850,
        400
      ],
      "credentials": {
        "openAiApi": "<your credential>"
      }
    },
    {
      "parameters": {
        "url": "https://api.grammarly.com/v2/check",
        "options": {
          "json": "body"
        },
        "jsonBody": {
          "text": "={{$node[\"Generate Documentation\"].json[\"content\"]}}",
          "options": {
            "plagiarism": true
          }
        }
      },
      "name": "Plagiarism Check",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "credentials": {
        "grammarlyApi": "<your credential>"
      }
    },
    {
      "parameters": {
        "functionCode": "// Format final submission\nconst files = {\n  report: $node['Generate Documentation'].json,\n  code: $node['Generate Code Solution'].json,\n  diagrams: $node['Generate ER Diagram'].json\n};\n\nreturn [\n  {\n    json: files\n  }\n];"
      },
      "name": "Package Submission",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ]
    },
    {
      "parameters": {
        "subject": "Assignment Ready for Review",
        "body": "={{$json}}",
        "to": "student@university.edu"
      },
      "name": "Send Notification",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1450,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Webhook Trigger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Process Assignment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Assignment": {
      "main": [
        [
          {
            "node": "Generate ER Diagram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Code Solution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate ER Diagram": {
      "main": [
        [
          {
            "node": "Plagiarism Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Code Solution": {
      "main": [
        [
          {
            "node": "Plagiarism Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Plagiarism Check": {
      "main": [
        [
          {
            "node": "Package Submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Package Submission": {
      "main": [
        [
          {
            "node": "Send Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "tags": [],
  "id": "123"
}