{
  "name": "Legal Case Automation Workflow",
  "nodes": [
    {
      "parameters": {
        "path": "start-case",
        "httpMethod": "POST",
        "responseMode": "onReceived",
        "responseData": "firstEntryJson"
      },
      "id": "TriggerCase",
      "name": "Trigger Case",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        100,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 2: Start Case Data\nreturn [{ json: { step: 'Start Case Data', status: 'ok' } }];"
      },
      "id": "StartCaseData",
      "name": "Start Case Data",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        300,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 3: Classify Request\nreturn [{ json: { step: 'Classify Request', status: 'ok' } }];"
      },
      "id": "ClassifyRequest",
      "name": "Classify Request",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 4: Collect Inputs\nreturn [{ json: { step: 'Collect Inputs', status: 'ok' } }];"
      },
      "id": "CollectInputs",
      "name": "Collect Inputs",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        700,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 5: Validate Inputs\nreturn [{ json: { step: 'Validate Inputs', status: 'ok' } }];"
      },
      "id": "ValidateInputs",
      "name": "Validate Inputs",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 6: Apply Rules\nreturn [{ json: { step: 'Apply Rules', status: 'ok' } }];"
      },
      "id": "ApplyRules",
      "name": "Apply Rules",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1100,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 7: Generate Draft Output\nreturn [{ json: { step: 'Generate Draft Output', status: 'ok' } }];"
      },
      "id": "GenerateDraftOutput",
      "name": "Generate Draft Output",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1300,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 8: AI Quality Check\nreturn [{ json: { step: 'AI Quality Check', status: 'ok' } }];"
      },
      "id": "AIQualityCheck",
      "name": "AI Quality Check",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1500,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 9: Expert Review\nreturn [{ json: { step: 'Expert Review', status: 'ok' } }];"
      },
      "id": "ExpertReview",
      "name": "Expert Review",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1700,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 10: Deliver Result\nreturn [{ json: { step: 'Deliver Result', status: 'ok' } }];"
      },
      "id": "DeliverResult",
      "name": "Deliver Result",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1900,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// Step 11: Log & Knowledge Base\nreturn [{ json: { step: 'Log & Knowledge Base', status: 'ok' } }];"
      },
      "id": "Log&KnowledgeBase",
      "name": "Log & Knowledge Base",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        2100,
        300
      ]
    }
  ],
  "connections": {
    "Trigger Case": {
      "main": [
        [
          {
            "node": "Start Case Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Case Data": {
      "main": [
        [
          {
            "node": "Classify Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Request": {
      "main": [
        [
          {
            "node": "Collect Inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Inputs": {
      "main": [
        [
          {
            "node": "Validate Inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Inputs": {
      "main": [
        [
          {
            "node": "Apply Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Rules": {
      "main": [
        [
          {
            "node": "Generate Draft Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Draft Output": {
      "main": [
        [
          {
            "node": "AI Quality Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Quality Check": {
      "main": [
        [
          {
            "node": "Expert Review",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expert Review": {
      "main": [
        [
          {
            "node": "Deliver Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deliver Result": {
      "main": [
        [
          {
            "node": "Log & Knowledge Base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "legal-case-flow"
}