{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b87cc222-82ec-4b46-9573-68f41d096969",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        620
      ],
      "parameters": {
        "color": 7,
        "width": 740,
        "height": 680,
        "content": "## 2. XLSX\ub97c \uc218\ub3d9\uc73c\ub85c Markdown\uc73c\ub85c \ubcc0\ud658  \n[Extract From File \ub178\ub4dc\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uae30](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile/)  \n\n\uc624\ub298\ub0a0\uc758 LLM\ub4e4\uc740 Excel \ud30c\uc77c\uc744 \uc9c1\uc811 \ud30c\uc2f1\ud560 \uc218 \uc5c6\uc73c\ubbc0\ub85c, \uac00\uc7a5 \uc88b\uc740 \ubc29\ubc95\uc740 \uc2a4\ud504\ub808\ub4dc\uc2dc\ud2b8\ub97c \uadf8\ub4e4\uc774 \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \ud615\uc2dd, \uc989 \ub9c8\ud06c\ub2e4\uc6b4\uc73c\ub85c \ubcc0\ud658\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774 \ubcc0\ud658\uc740 \uc2e4\uc81c\ub85c \ub370\uc774\ud130 \uc2dc\ud2b8\uac00 \uc544\ub2cc Excel \ud30c\uc77c\uc5d0 \ub300\ud574\uc11c\ub3c4 \uc88b\uc740 \ud574\uacb0\ucc45\uc785\ub2c8\ub2e4 - \uc140\ub4e4\uc774 \ub808\uc774\uc544\uc6c3 \uc694\uc18c\ucc98\ub7fc \uc0ac\uc6a9\ub418\uace0 \uc788\uc8e0 - \uc774\ub294 \uccad\uad6c\uc11c\uc640 \uad6c\ub9e4 \uc8fc\ubb38\uc11c\uc5d0\uc11c \uc5ec\uc804\ud788 \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4.  \n\n\ubcc0\ud658\uc744 \uc218\ud589\ud558\uae30 \uc704\ud574, 'Extract from File' \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec xlsx\uc5d0\uc11c \uac01 \ud589\uc744 \uac00\uc838\uc628 \ub2e4\uc74c, \ucf54\ub4dc \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubc18\ubcf5\ud558\uace0 \uc5f0\uacb0\ud558\uc5ec \ub9c8\ud06c\ub2e4\uc6b4 \ud14c\uc774\ube14\uc744 \ud615\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "c4c55042-02c8-4364-ae7e-d1ec5a75437a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1400,
        620
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 680,
        "content": "## 3. AI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uad6c\ub9e4 \uc8fc\ubb38 \uc138\ubd80 \uc815\ubcf4 \ucd94\ucd9c\n\n[\uc815\ubcf4 \ucd94\ucd9c\uae30\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uae30](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.information-extractor)\n\n\ub370\uc774\ud130 \uc785\ub825\uc740 \uc544\ub9c8\ub3c4 AI/LLMs\ub97c \ud544\uc694\ub85c \ud558\ub294 \uac00\uc7a5 \ud070 \uc774\uc720\uc77c \uac83\uc785\ub2c8\ub2e4. \uc774 \uc2dc\uac04 \uc18c\ubaa8\uc801\uc774\uace0 \ub2e8\uc870\ub85c\uc6b4 \uc791\uc5c5\uc740 \uba87 \ucd08 \ub9cc\uc5d0 \uace0\ub3c4\uc758 \uc815\ud655\ub3c4\ub85c \uc644\ub8cc\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\uae30\uc11c, \uc6b0\ub9ac\ub294 AI\uc5d0\uac8c \uad6c\uc870\ud654\ub41c \ucd9c\ub825\uc73c\ub85c \uac01 \uc774\ubca4\ud2b8\ub97c \uc6a9\uc5b4 \ub0a0\uc9dc\uc640 \ud568\uaed8 \uc774\ubca4\ud2b8 \ubaa9\ub85d\uc73c\ub85c \ucd94\ucd9c\ud558\ub3c4\ub85d \uc694\uccad\ud569\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "b9530f93-464b-4116-add7-da218fe8eb12",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -80
      ],
      "parameters": {
        "width": 460,
        "height": 1400,
        "content": "## \uc774\ub97c \uc2dc\ub3c4\ud574 \ubcf4\uc138\uc694!\n### \uc774 n8n \ud15c\ud50c\ub9bf\uc740 Outlook\uc5d0\uc11c \uad6c\ub9e4 \uc8fc\ubb38 \uc81c\ucd9c\uc744 \uac00\uc838\uc640\uc11c \ucca8\ubd80\ub41c XLSX \ud615\uc2dd\uc758 \uad6c\ub9e4 \uc8fc\ubb38 \uc591\uc2dd\uc744 \uad6c\uc870\ud654\ub41c \ucd9c\ub825\uc73c\ub85c \ubcc0\ud658\ud569\ub2c8\ub2e4.\n\n\uc0ac\uc6a9\uc790\uac00 \uc81c\ucd9c\ud55c XLSX \uc591\uc2dd\uc758 \ub370\uc774\ud130 \uc785\ub825 \uc791\uc5c5\uc740 \uc2dc\uac04\uc774 \ub9ce\uc774 \uac78\ub9ac\uace0 \uc9c0\ub8e8\ud558\uc9c0\ub9cc \ube44\uc988\ub2c8\uc2a4 \uc6b4\uc601\uc5d0 \ud544\uc218\uc801\uc774\uba70, \uc544\ub9c8\ub3c4 \uc720\uc0b0 \uc2dc\uc2a4\ud15c\uc73c\ub85c\ubd80\ud130 \uc0c1\uc18d\ub41c \uc911\uc694\ud55c \uc791\uc5c5\uc77c \uac83\uc785\ub2c8\ub2e4.\n\n\uc2dc\uc2a4\ud15c \uac1c\ud3b8\uacfc \ud604\ub300\ud654\ub97c \uafc8\uafc0 \uc218\ub294 \uc788\uc9c0\ub9cc, \uc0ac\uc2e4 \ubcc0\ud654\ub294 \uc5b4\ub835\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \ub2e4\ub978 \ubc29\ubc95\uc774 \uc788\uc2b5\ub2c8\ub2e4 - n8n\uacfc AI\ub97c \uc0ac\uc6a9\ud558\uc138\uc694!\n\n### \uc791\ub3d9 \uc6d0\ub9ac\n* Outlook \ud2b8\ub9ac\uac70\ub97c \uc0ac\uc6a9\ud558\uc5ec \uacf5\uc720\ub41c \ubc1b\uc740 \ud3b8\uc9c0\ud568\uc744 \ud1b5\ud574 \uc81c\ucd9c\ub41c \uad6c\ub9e4 \uc8fc\ubb38 \uc591\uc2dd\uc744 \uac10\uc2dc\ud569\ub2c8\ub2e4.\n* \uc81c\ucd9c\ub41c \uc774\uba54\uc77c \ucca8\ubd80 \ud30c\uc77c\uc740 XLSX \ud615\uc2dd\uc758 \uc591\uc2dd\uc73c\ub85c, \uc608\ub97c \ub4e4\uc5b4 https://1drv.ms/x/c/8f1f7dda12b7a145/ETWH8dKwgZ1OiVz7ISUWYf8BwiyihBjXPXEbCYkVi8XDyw?e=WWU2eR \uc640 \uac19\uc740 \ud30c\uc77c\ub85c \uc6cc\ud06c\ud50c\ub85c\uc5d0 \uac00\uc838\uc635\ub2c8\ub2e4.\n* 'Extract from File' \ub178\ub4dc\ub97c 'code' \ub178\ub4dc\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud558\uc5ec XLSX \ud30c\uc77c\uc744 \ub9c8\ud06c\ub2e4\uc6b4\uc73c\ub85c \ubcc0\ud658\ud569\ub2c8\ub2e4. \uc774\ub294 LLM\uc774 \uc774\ub97c \uc774\ud574\ud560 \uc218 \uc788\uac8c \ud558\uae30 \uc704\ud568\uc785\ub2c8\ub2e4.\n* Information Extractor \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc591\uc2dd\uc5d0\uc11c \uad00\ub828 \uad6c\ub9e4 \uc8fc\ubb38 \uc138\ubd80 \uc0ac\ud56d\uacfc \ud488\ubaa9\uc744 \uc77d\uace0 \ucd94\ucd9c\ud569\ub2c8\ub2e4.\n* \uac04\ub2e8\ud55c \uac80\uc99d \ub2e8\uacc4\ub97c \uc0ac\uc6a9\ud558\uc5ec PO \ubc88\ud638 \ub204\ub77d\uc774\ub098 \uae08\uc561 \ubd88\uc77c\uce58\uc640 \uac19\uc740 \uc77c\ubc18\uc801\uc778 \uc624\ub958\ub97c \ud655\uc778\ud569\ub2c8\ub2e4. \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\uba74 \uad6c\ub9e4\uc790\uc5d0\uac8c \uc790\ub3d9\uc73c\ub85c \uc54c\ub9bc\uc744 \ubcf4\ub0b4 \ub2f5\ubcc0\ud569\ub2c8\ub2e4.\n* \uac80\uc99d\uc774 \ud1b5\uacfc\ub418\uba74 \uad6c\ub9e4\uc790\uc5d0\uac8c \ud655\uc778\uc744 \ubcf4\ub0b4\uace0, \uad6c\ub9e4 \uc8fc\ubb38 \uad6c\uc870\ud654\ub41c \ucd9c\ub825\uc744 \ub0b4\ubd80 \uc2dc\uc2a4\ud15c\uc73c\ub85c \ubcf4\ub0bc \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n\n### \uc0ac\uc6a9 \ubc29\ubc95\n* \uc774 \ud15c\ud50c\ub9bf\uc740 XLSX \ud615\uc2dd\uc758 \uc591\uc2dd\uc744 \uae30\ub300\ud558\uace0 \ubc1b\ub294 \uacbd\uc6b0\uc5d0\ub9cc \uc791\ub3d9\ud569\ub2c8\ub2e4. \uc774\ub294 \uc1a1\uc7a5, \uc694\uccad \uc591\uc2dd, \uad6c\ub9e4 \uc8fc\ubb38 \uc591\uc2dd \ub4f1\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n* Outlook \ub178\ub4dc\ub97c \ud544\uc694\ud55c \uc774\uba54\uc77c\ub85c \uc5c5\ub370\uc774\ud2b8\ud558\uc138\uc694.\n* \ub2e4\uc74c \ub2e8\uacc4\ub294? ERP\ub098 \ud68c\uacc4 \uc2dc\uc2a4\ud15c\uc73c\ub85c \ubcf4\ub0b4\ub294 \ub9c8\uc9c0\ub9c9 \ub2e8\uacc4\ub97c \uc0dd\ub7b5\ud588\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uc870\uc9c1\uc5d0 \ub530\ub77c \ub2e4\ub974\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.\n\n### \uc694\uad6c \uc0ac\ud56d\n* Outlook for Emails\n  * \uc790\uaca9 \uc99d\uba85 \uc124\uc815 \ubc29\ubc95\uc740 \uc5ec\uae30\ub97c \ud655\uc778\ud558\uc138\uc694: https://docs.n8n.io/integrations/builtin/credentials/microsoft/\n* OpenAI for LLM document understanding and extraction.\n\n### \uc6cc\ud06c\ud50c\ub85c \ucee4\uc2a4\ud130\ub9c8\uc774\uc9d5\n* \uc774 \ud15c\ud50c\ub9bf\uc740 \ub2e4\ub978 Excel \ud30c\uc77c\uc5d0\ub3c4 \uc801\uc6a9\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc77c\ubd80 \ud30c\uc77c\uc740 \ub354 \ubcf5\uc7a1\ud560 \uc218 \uc788\uc73c\ubbc0\ub85c \ub2e4\uc591\ud55c \ud30c\uc11c\uc640 \ucd94\ucd9c \ub3c4\uad6c \ubc0f \uc804\ub7b5\uc744 \uc2e4\ud5d8\ud574 \ubcf4\uc138\uc694.\n* Information Extractor Schema\ub97c \ucee4\uc2a4\ud130\ub9c8\uc774\uc988\ud558\uc5ec \ud544\uc694\ud55c \ud2b9\uc815 \ub370\uc774\ud130\ub97c \ucd94\ucd9c\ud558\uc138\uc694. \uc608\ub97c \ub4e4\uc5b4, \uad6c\ub9e4\uc790\uac00 \uc81c\uacf5\ud55c \ub178\ud2b8\ub098 \ub313\uae00\uc744 \ucea1\ucc98\ud558\uc138\uc694.\n\n### \ub3c4\uc6c0\uc774 \ud544\uc694\ud558\uc138\uc694?\n[Discord](https://discord.com/invite/XPKeKXeB7d) \ub610\ub294 [Forum](https://community.n8n.io/)\uc5d0 \uac00\uc785\ud558\uc138\uc694!\n\n\uc990\uac70\uc6b4 \ud574\ud0b9!"
      },
      "typeVersion": 1
    },
    {
      "id": "f5a2d1e7-f73b-4bfa-8e02-f30db275bbcc",
      "name": "Extract Purchase Order Details",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1500,
        920
      ],
      "parameters": {
        "text": "={{ $json.table }}",
        "options": {
          "systemPromptTemplate": "Capture the values as seen. Do not convert dates."
        },
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"purchase_order_number\": { \"type\": \"string\" },\n    \"purchase_order_date\": { \"type\": \"string\" },\n    \"purchase_order_total\": { \"type\": \"number\" },\n    \"vendor_name\": { \"type\": \"string\" },\n    \"vendor_address\": { \"type\": \"string\" },\n    \"vendor_contact\": { \"type\": \"string\" },\n    \"delivery_contact\": { \"type\": \"string\" },\n    \"delivery_address\": { \"type\": \"string\" },\n    \"delivery_method\": { \"type\": \"string\" },\n    \"items\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"description\": { \"type\": \"string\" },\n          \"part_number\": { \"type\": \"string\" },\n          \"quantity\": { \"type\": \"number\" },\n          \"unit\": { \"type\": \"number\" },\n          \"unit_price\": { \"type\": \"number\" }\n        }\n      }\n    }\n  }\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "0ce545f0-8147-4ad2-bb9e-14ef0b0c26ef",
      "name": "Is Excel Document?",
      "type": "n8n-nodes-base.if",
      "position": [
        760,
        1020
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f723ab0a-8f2d-4501-8273-fd6455c57cdd",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ccbd9531-66be-4e07-8b73-faf996622f9f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 140,
        "content": "\uad6c\ub9e4 \uc8fc\ubb38 \uc608\uc81c\n\n\uc774\uac83\uc740 \uc774 \ud15c\ud50c\ub9bf\uc758 \uc608\uc81c\ub85c \uc0ac\uc6a9\ub418\ub294 \uad6c\ub9e4 \uc8fc\ubb38 XLSX\uc785\ub2c8\ub2e4.\n\nhttps://1drv.ms/x/c/8f1f7dda12b7a145/ETWH8dKwgZ1OiVz7ISUWYf8BwiyihBjXPXEbCYkVi8XDyw?e=WWU2eR"
      },
      "typeVersion": 1
    },
    {
      "id": "ef8b00eb-dba6-47dd-a825-1aa5c85ee215",
      "name": "Run Checks",
      "type": "n8n-nodes-base.set",
      "position": [
        2160,
        940
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "049c7aca-7663-4eed-93b4-9eec3760c058",
              "name": "has_po_number",
              "type": "boolean",
              "value": "={{ Boolean($json.output.purchase_order_number) }}"
            },
            {
              "id": "94d2224a-cf81-4a42-acd0-de5276a5e493",
              "name": "has_valid_po_date",
              "type": "boolean",
              "value": "={{ $json.output.purchase_order_date.toDateTime() < $now.plus({ 'day': 1 }) }}"
            },
            {
              "id": "a8f69605-dad6-4ec2-a22f-d13ff99e27cd",
              "name": "has_items",
              "type": "boolean",
              "value": "={{ $json.output.items.length > 0 }}"
            },
            {
              "id": "c11db99e-9cc2-40b7-b3a5-f3c65f88dc13",
              "name": "is_math_correct",
              "type": "boolean",
              "value": "={{\n$json.output.items.map(item => item.unit_price * item.quantity).sum().round(2) === $json.output.purchase_order_total.round(2) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "801848cc-558c-4a30-aab5-eb403564b68f",
      "name": "Is Valid Purchase Order?",
      "type": "n8n-nodes-base.if",
      "position": [
        2360,
        940
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "11fa8087-7809-4bc9-9fbe-32bfd35821a6",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.has_po_number }}",
              "rightValue": ""
            },
            {
              "id": "c45ae85a-e060-4416-aa2c-daf58db8ba0e",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.has_valid_po_date }}",
              "rightValue": ""
            },
            {
              "id": "d0ae9518-2f4b-43fb-87b1-7108a6a75424",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.has_items }}",
              "rightValue": ""
            },
            {
              "id": "eed09f78-ce1a-4e09-8940-febcf7e41078",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.is_math_correct }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7c7dd7a0-45fe-4549-8341-3b3fd18e1725",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        980,
        920
      ],
      "parameters": {
        "options": {
          "rawData": true,
          "headerRow": false,
          "includeEmptyCells": true
        },
        "operation": "xlsx"
      },
      "typeVersion": 1
    },
    {
      "id": "dfb6b00f-fe50-42d6-8597-8fdcb562714b",
      "name": "XLSX to Markdown Table",
      "type": "n8n-nodes-base.code",
      "position": [
        1180,
        920
      ],
      "parameters": {
        "jsCode": "const rows = $input.all().map(item => item.json.row);\nconst maxLength = Math.max(...rows.map(row => row.length));\n\nconst table = [\n  '|' + rows[0].join('|') + '|',\n  '|' + Array(maxLength).fill(0).map(_ => '-').join('|') + '|',\n  rows.slice(1, rows.length)\n    .filter(row => row.some(Boolean))\n    .map(row =>\n      '|' + row.join('|') + '|'\n    ).join('\\n')\n].join('\\n')\n\nreturn { table }"
      },
      "typeVersion": 2
    },
    {
      "id": "1a3de516-1d21-4664-b2e3-8c8d6ec90ef2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1600,
        1080
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1a29236f-5eaa-4a38-a0a1-6e19abd77d2c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        620
      ],
      "parameters": {
        "color": 7,
        "width": 940,
        "height": 680,
        "content": "## 4. \uac04\ub2e8\ud55c \uac80\uc99d\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc2dc\uac04\uacfc \ub178\ub825\uc744 \uc808\uc57d\ud558\uc138\uc694  \n[Edit Fields node\uc5d0 \ub300\ud574 \ub354 \uc54c\uc544\ubcf4\uae30](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set)  \n\n\uc6b0\ub9ac\uc758 \ucd94\ucd9c\ub41c \ucd9c\ub825\uc73c\ub85c \uad00\ub9ac \uc2dc\uac04\uc744 \uc808\uc57d\ud558\uae30 \uc704\ud574 \uac04\ub2e8\ud55c \uac80\uc99d \uac80\uc0ac\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uad6c\ub9e4 \uc8fc\ubb38 \ubc88\ud638 \ub204\ub77d\uc774\ub098 \ube44\uc6a9 \uae08\uc561 \uc624\uc0b0\uacfc \uac19\uc740 \uc77c\ubc18\uc801\uc778 \uc624\ub958\ub294 \uc27d\uac8c \uac10\uc9c0\ud560 \uc218 \uc788\uc73c\uba70, \ube60\ub978 \uc751\ub2f5\uc744 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac80\uc99d\uc774 \ud1b5\uacfc\ub418\uba74, \ucd94\ucd9c\ub41c \ucd9c\ub825\uc744 \ub2e4\uc74c\uc5d0 \uc5b4\ub5bb\uac8c \uc0ac\uc6a9\ud558\ub294\uc9c0\ub294 \ub2f9\uc2e0\uc5d0\uac8c \ub2ec\ub824 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "79a39a03-5f71-4021-bcfd-06edbc285e8a",
      "name": "Reply Invalid Format",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        980,
        1120
      ],
      "parameters": {
        "message": "PO rejected due to invalid file format. Please try again with XLSX.",
        "options": {},
        "messageId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Outlook Trigger').first().json.id }}"
        },
        "operation": "reply",
        "additionalFields": {},
        "replyToSenderOnly": true
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ec973438-4d6c-4d2e-8702-1d195f514528",
      "name": "Outlook Trigger",
      "type": "n8n-nodes-base.microsoftOutlookTrigger",
      "position": [
        -120,
        920
      ],
      "parameters": {
        "fields": [
          "body",
          "categories",
          "conversationId",
          "from",
          "hasAttachments",
          "internetMessageId",
          "sender",
          "subject",
          "toRecipients",
          "receivedDateTime",
          "webLink"
        ],
        "output": "fields",
        "filters": {
          "hasAttachments": true,
          "foldersToInclude": []
        },
        "options": {
          "downloadAttachments": true
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fcb173ce-7dad-497a-9376-9650c2a24a84",
      "name": "Reply Rejection",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        2580,
        1040
      ],
      "parameters": {
        "message": "=PO Rejected due to the following errors:\n{{\n[\n  !$json.has_po_number ? '* PO number was not provided' : '',\n  !$json.has_valid_po_date ? '* PO date was missing or invalid' : '',\n  !$json.has_items ? '* No line items detected' : '',\n  !$json.is_math_correct ? '* Line items prices do not match up to PO total' : ''\n]\n  .compact()\n  .join('\\n')\n}}",
        "options": {},
        "messageId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Outlook Trigger').first().json.id }}"
        },
        "operation": "reply",
        "additionalFields": {},
        "replyToSenderOnly": true
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "64ced193-6b12-4ee9-b1e2-735040648051",
      "name": "Reply Accepted",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        2580,
        820
      ],
      "parameters": {
        "message": "=Thank you for the purchase order.\nThis is an automated reply.",
        "options": {},
        "messageId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Outlook Trigger').first().json.id }}"
        },
        "operation": "reply",
        "additionalFields": {},
        "replyToSenderOnly": true
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "7bfe0e44-cd5d-4290-ba2e-0064c95bc4e2",
      "name": "Do Something with Purchase Order",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2800,
        940
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6f517f2f-6072-46a2-8a9d-cca4e958d601",
      "name": "Fix Excel Dates",
      "type": "n8n-nodes-base.set",
      "position": [
        1840,
        920
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={{\n{\n  output: {\n    ...$json.output,\n    purchase_order_date: $json.output.purchase_order_date\n      ? new Date((new Date(1900, 0, 1)).getTime() + (Number($json.output.purchase_order_date) - 2) * (24 * 60 * 60 * 1000))\n      : $json.output.purchase_order_date\n  }\n}\n}}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "f3a31b63-ebcb-4d93-8c5a-f626897b7d68",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        620
      ],
      "parameters": {
        "color": 7,
        "width": 840,
        "height": 680,
        "content": "## 1. \uc218\uc2e0 \uad6c\ub9e4 \uc8fc\ubb38 \ub300\uae30\n\n[Outlook \ud2b8\ub9ac\uac70\uc5d0 \ub300\ud574 \ub354 \uc77d\uae30](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.microsoftoutlooktrigger)\n\n\uc6b0\ub9ac\uc758 \ud15c\ud50c\ub9bf\uc740 Outlook Trigger \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uacf5\uc720 \uc778\ubc15\uc2a4(\uc608: \"purchase-orders@example.com\")\uc5d0 \ub300\ud55c \uc0c8 \uc774\uba54\uc77c\uc744 \uac10\uc2dc\ud558\ub294 \uac83\uc73c\ub85c \uc2dc\uc791\ud569\ub2c8\ub2e4. \uc6b0\ub9ac\uc758 \ubaa9\ud45c\ub294 \uad6c\ub9e4\uc790 \uad6c\ub9e4 \uc8fc\ubb38\uc744 \uc2dd\ubcc4\ud558\uace0 \ucea1\ucc98\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c \uac80\uc99d\ud558\uace0 AI\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \uc785\ub825 \uc2dc\uac04\uacfc \ube44\uc6a9\uc744 \ub300\uaddc\ubaa8\ub85c \uc904\uc774\ub294 \uac83\uc785\ub2c8\ub2e4.\n\n\ub610\ud55c Text Classifier \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc758\ub3c4\ub97c \uac80\uc99d\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uc720\ud6a8\ud55c \uc81c\ucd9c \uc0ac\ud56d\uc744 \ud3ec\ucc29\ud558\ub3c4\ub85d \ud558\uba70, \ub2e8\uc9c0 \uad6c\ub9e4 \uc8fc\ubb38\uc5d0 \ub300\ud55c \ucffc\ub9ac\ub098 \ub2f5\ubcc0\uc774 \uc544\ub2d0 \uc218 \uc788\ub3c4\ub85d \ud569\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "bb395dfc-2831-4e57-90c9-62f13f84302e",
      "name": "Is Submitting a Purchase Order?",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        80,
        920
      ],
      "parameters": {
        "options": {
          "fallback": "other"
        },
        "inputText": "=from: {{ $json.from.emailAddress.name }} <{{ $json.from.emailAddress.address }}>\nsubject: {{ $json.subject }}\nmessage:\n{{ $json.body.content }}",
        "categories": {
          "categories": [
            {
              "category": "is_purchase_order",
              "description": "The message's intent is to submit a purchase order"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e52ec2e2-8be5-40ab-b1f8-8d7c0b161e1a",
      "name": "Do Nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        420,
        1040
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5ca6be4e-bc33-42d7-91bc-d30f7ccfdd25",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        180,
        1080
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "connections": {
    "Run Checks": {
      "main": [
        [
          {
            "node": "Is Valid Purchase Order?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply Accepted": {
      "main": [
        [
          {
            "node": "Do Something with Purchase Order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fix Excel Dates": {
      "main": [
        [
          {
            "node": "Run Checks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Outlook Trigger": {
      "main": [
        [
          {
            "node": "Is Submitting a Purchase Order?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "XLSX to Markdown Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Purchase Order Details",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Is Excel Document?": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply Invalid Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Is Submitting a Purchase Order?",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "XLSX to Markdown Table": {
      "main": [
        [
          {
            "node": "Extract Purchase Order Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Valid Purchase Order?": {
      "main": [
        [
          {
            "node": "Reply Accepted",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply Rejection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Purchase Order Details": {
      "main": [
        [
          {
            "node": "Fix Excel Dates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Submitting a Purchase Order?": {
      "main": [
        [
          {
            "node": "Is Excel Document?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do Nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}