{
  "name": "WF04-\uba85\uc138\uc11c\uac80\uc218",
  "id": "zSXpWko9op4hnSBr",
  "description": "Human-in-the-loop \ud2b9\ud5c8 \uba85\uc138\uc11c \uac80\uc218 \uc6cc\ud06c\ud50c\ub85c\uc6b0 - \uc2b9\uc778/\uc218\uc815\uc694\uccad/\ubc18\ub824 \ucc98\ub9ac",
  "active": false,
  "nodes": [
    {
      "id": "webhook-trigger",
      "name": "\uac80\uc218 \uc694\uccad Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "wf04-review-request",
        "responseMode": "onReceived"
      }
    },
    {
      "id": "prepare-review",
      "name": "\uac80\uc218 \ub370\uc774\ud130 \uc900\ube44",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "id": "review-form",
      "name": "\uac80\uc218 Form",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        440,
        0
      ],
      "parameters": {
        "formTitle": "\ud2b9\ud5c8 \uba85\uc138\uc11c \uac80\uc218",
        "formFields": [
          "\uac80\uc218 ID",
          "\uc2b9\uc778 \uc0c1\ud0dc",
          "\uccad\uad6c\ud56d \ud53c\ub4dc\ubc31",
          "\uc0c1\uc138\uc124\uba85 \ud53c\ub4dc\ubc31",
          "\ub3c4\uba74\uc124\uba85 \ud53c\ub4dc\ubc31",
          "\uc804\uccb4 \uc758\uacac",
          "\uc218\uc815 \uc6b0\uc120\uc21c\uc704"
        ]
      }
    },
    {
      "id": "check-approval",
      "name": "\uc2b9\uc778 \uc5ec\ubd80 \ud655\uc778",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        660,
        0
      ]
    },
    {
      "id": "process-approval",
      "name": "\uc2b9\uc778 \ucc98\ub9ac",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        880,
        -100
      ]
    },
    {
      "id": "process-revision",
      "name": "\uc218\uc815 \uc694\uccad \ucc98\ub9ac",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        880,
        100
      ]
    },
    {
      "id": "set-approved-output",
      "name": "\uc2b9\uc778 \uc644\ub8cc \ucd9c\ub825",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1100,
        -100
      ]
    },
    {
      "id": "google-drive-upload-approved",
      "name": "Google Drive \uc5c5\ub85c\ub4dc (\uc2b9\uc778\ubb38\uc11c)",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1320,
        -100
      ],
      "parameters": {
        "operation": "upload",
        "folderId": {
          "__rl": true,
          "value": "={{ $vars.GOOGLE_DRIVE_APPROVED_FOLDER_ID }}",
          "mode": "id"
        },
        "name": "=\uc2b9\uc778_{{ $json.patent_id }}_{{ $now.format('yyyyMMdd') }}.md",
        "options": {
          "mimeType": "text/markdown"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "google-sheets-approved",
      "name": "Google Sheets \uc2b9\uc778 \uc5c5\ub370\uc774\ud2b8",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1540,
        -100
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "={{ $vars.GOOGLE_SHEETS_TRACKING_ID }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "\uc81c\ucd9c\uc774\ub825",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Patent ID": "={{ $json.patent_id }}",
            "\uc0c1\ud0dc": "approved",
            "\ucd5c\uc885\ubb38\uc11c URL": "={{ $('Google Drive \uc5c5\ub85c\ub4dc (\uc2b9\uc778\ubb38\uc11c)').item.json.webViewLink }}",
            "\uac80\uc218\uc644\ub8cc\uc77c": "={{ $now.format('yyyy-MM-dd') }}"
          }
        },
        "options": {
          "updateLookupColumn": "Patent ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "set-revision-output",
      "name": "\uc218\uc815 \uc694\uccad \ucd9c\ub825",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1100,
        100
      ]
    },
    {
      "id": "check-rejection",
      "name": "\ubc18\ub824 \uc5ec\ubd80 \ud655\uc778",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1320,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "rejection-check",
              "leftValue": "={{ $json.status }}",
              "rightValue": "rejected",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      }
    },
    {
      "id": "google-drive-upload-rejected",
      "name": "Google Drive \uc5c5\ub85c\ub4dc (\ubc18\ub824\ubb38\uc11c)",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1540,
        50
      ],
      "parameters": {
        "operation": "upload",
        "folderId": {
          "__rl": true,
          "value": "={{ $vars.GOOGLE_DRIVE_REJECTED_FOLDER_ID }}",
          "mode": "id"
        },
        "name": "=\ubc18\ub824_{{ $json.patent_id }}_{{ $now.format('yyyyMMdd') }}.md",
        "options": {
          "mimeType": "text/markdown"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "google-sheets-rejected",
      "name": "Google Sheets \ubc18\ub824 \uc5c5\ub370\uc774\ud2b8",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1760,
        50
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "={{ $vars.GOOGLE_SHEETS_TRACKING_ID }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "\uc81c\ucd9c\uc774\ub825",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Patent ID": "={{ $json.patent_id }}",
            "\uc0c1\ud0dc": "rejected",
            "\ucd5c\uc885\ubb38\uc11c URL": "={{ $('Google Drive \uc5c5\ub85c\ub4dc (\ubc18\ub824\ubb38\uc11c)').item.json.webViewLink }}",
            "\ubc18\ub824\uc0ac\uc720": "={{ $json.rejection_reason }}",
            "\uac80\uc218\uc644\ub8cc\uc77c": "={{ $now.format('yyyy-MM-dd') }}"
          }
        },
        "options": {
          "updateLookupColumn": "Patent ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "google-sheets-revision",
      "name": "Google Sheets \uc218\uc815\uc694\uccad \uc5c5\ub370\uc774\ud2b8",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1540,
        150
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "={{ $vars.GOOGLE_SHEETS_TRACKING_ID }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "\uc81c\ucd9c\uc774\ub825",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Patent ID": "={{ $json.patent_id }}",
            "\uc0c1\ud0dc": "revision_requested",
            "\uc218\uc815\uc694\uccad\uc0ac\ud56d": "={{ $json.revision_comments }}"
          }
        },
        "options": {
          "updateLookupColumn": "Patent ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "merge-output",
      "name": "\uacb0\uacfc \ubcd1\ud569",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        1980,
        0
      ],
      "parameters": {
        "mode": "combine",
        "options": {}
      }
    }
  ],
  "connections": {
    "\uac80\uc218 \uc694\uccad Webhook": {
      "main": [
        [
          {
            "node": "\uac80\uc218 \ub370\uc774\ud130 \uc900\ube44",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uac80\uc218 Form": {
      "main": [
        [
          {
            "node": "\uc2b9\uc778 \uc5ec\ubd80 \ud655\uc778",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc2b9\uc778 \uc5ec\ubd80 \ud655\uc778": {
      "main": [
        [
          {
            "node": "\uc2b9\uc778 \ucc98\ub9ac",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\uc218\uc815 \uc694\uccad \ucc98\ub9ac",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc2b9\uc778 \ucc98\ub9ac": {
      "main": [
        [
          {
            "node": "\uc2b9\uc778 \uc644\ub8cc \ucd9c\ub825",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc2b9\uc778 \uc644\ub8cc \ucd9c\ub825": {
      "main": [
        [
          {
            "node": "Google Drive \uc5c5\ub85c\ub4dc (\uc2b9\uc778\ubb38\uc11c)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive \uc5c5\ub85c\ub4dc (\uc2b9\uc778\ubb38\uc11c)": {
      "main": [
        [
          {
            "node": "Google Sheets \uc2b9\uc778 \uc5c5\ub370\uc774\ud2b8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets \uc2b9\uc778 \uc5c5\ub370\uc774\ud2b8": {
      "main": [
        [
          {
            "node": "\uacb0\uacfc \ubcd1\ud569",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc218\uc815 \uc694\uccad \ucc98\ub9ac": {
      "main": [
        [
          {
            "node": "\uc218\uc815 \uc694\uccad \ucd9c\ub825",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc218\uc815 \uc694\uccad \ucd9c\ub825": {
      "main": [
        [
          {
            "node": "\ubc18\ub824 \uc5ec\ubd80 \ud655\uc778",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ubc18\ub824 \uc5ec\ubd80 \ud655\uc778": {
      "main": [
        [
          {
            "node": "Google Drive \uc5c5\ub85c\ub4dc (\ubc18\ub824\ubb38\uc11c)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets \uc218\uc815\uc694\uccad \uc5c5\ub370\uc774\ud2b8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive \uc5c5\ub85c\ub4dc (\ubc18\ub824\ubb38\uc11c)": {
      "main": [
        [
          {
            "node": "Google Sheets \ubc18\ub824 \uc5c5\ub370\uc774\ud2b8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets \ubc18\ub824 \uc5c5\ub370\uc774\ud2b8": {
      "main": [
        [
          {
            "node": "\uacb0\uacfc \ubcd1\ud569",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Google Sheets \uc218\uc815\uc694\uccad \uc5c5\ub370\uc774\ud2b8": {
      "main": [
        [
          {
            "node": "\uacb0\uacfc \ubcd1\ud569",
            "type": "main",
            "index": 2
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "version": "1.1.0",
    "created": "2026-01-10",
    "updated": "2026-01-13",
    "project": "MAIPatent",
    "workflow_sequence": 4,
    "review_options": [
      "\uc2b9\uc778",
      "\uc218\uc815 \ud544\uc694",
      "\ubc18\ub824"
    ],
    "feedback_fields": [
      "\uccad\uad6c\ud56d",
      "\uc0c1\uc138\uc124\uba85",
      "\ub3c4\uba74\uc124\uba85",
      "\uc804\uccb4 \uc758\uacac"
    ]
  }
}