{
  "name": "[\uae08\uc735] \uacbd\ube44 \ubcf4\uace0\uc11c \uc790\ub3d9\ud654 - Webhook",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "expense-report",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "webhook-node",
      "name": "\uacbd\ube44 \uc811\uc218",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// \ud544\uc218 \ud544\ub4dc \uac80\uc99d\nconst data = $input.item.json.body || $input.item.json;\n\nconst date = data.date || new Date().toISOString().slice(0, 10);\nconst item = data.item || '';\nconst amount = Number(data.amount) || 0;\nconst user = data.user || '';\nconst note = data.note || '';\n\n// \ud544\uc218 \ud544\ub4dc \ud655\uc778\nif (!item || !amount || !user) {\n  throw new Error('\ud544\uc218 \ud544\ub4dc \ub204\ub77d: item(\ud56d\ubaa9), amount(\uae08\uc561), user(\uc0ac\uc6a9\uc790)\ub294 \ud544\uc218\uc785\ub2c8\ub2e4.');\n}\n\nreturn {\n  json: {\n    date: date,\n    item: item,\n    amount: amount,\n    user: user,\n    note: note\n  }\n};"
      },
      "id": "code-validate-node",
      "name": "\ub370\uc774\ud130 \uac80\uc99d",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "placeholder-spreadsheet-id",
          "mode": "id",
          "cachedResultName": "\uacbd\ube44 \ubcf4\uace0\uc11c"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "id",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "\ub0a0\uc9dc": "={{ $json.date }}",
            "\ud56d\ubaa9": "={{ $json.item }}",
            "\uae08\uc561": "={{ $json.amount }}",
            "\uc0ac\uc6a9\uc790": "={{ $json.user }}",
            "\ube44\uace0": "={{ $json.note }}"
          },
          "matchingColumns": [],
          "schema": []
        },
        "options": {
          "cellFormat": "USER_ENTERED",
          "useAppend": true
        }
      },
      "id": "sheets-node",
      "name": "\uacbd\ube44 \uae30\ub85d",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.4,
      "position": [
        650,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C12345EXPENSE",
          "mode": "id"
        },
        "text": "=:receipt: \uacbd\ube44 \uc811\uc218 \uc644\ub8cc\n\n*\uc0ac\uc6a9\uc790:* {{ $json.user }}\n*\ud56d\ubaa9:* {{ $json.item }}\n*\uae08\uc561:* {{ Number($json.amount).toLocaleString() }}\uc6d0\n*\ub0a0\uc9dc:* {{ $json.date }}\n*\ube44\uace0:* {{ $json.note || '\uc5c6\uc74c' }}",
        "otherOptions": {}
      },
      "id": "slack-node",
      "name": "\uc811\uc218 \ud655\uc778 \uc54c\ub9bc",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        850,
        300
      ],
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Webhook \uc751\ub2f5 JSON \uc0dd\uc131\nconst data = $('\ub370\uc774\ud130 \uac80\uc99d').item.json;\n\nreturn {\n  json: {\n    success: true,\n    message: `\uacbd\ube44\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \uc811\uc218\ub418\uc5c8\uc2b5\ub2c8\ub2e4.`,\n    data: {\n      date: data.date,\n      item: data.item,\n      amount: data.amount,\n      user: data.user\n    },\n    timestamp: new Date().toISOString()\n  }\n};"
      },
      "id": "code-response-node",
      "name": "\uc751\ub2f5 \uc0dd\uc131",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1050,
        300
      ]
    },
    {
      "parameters": {},
      "id": "noop-node",
      "name": "\uc644\ub8cc",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ]
    }
  ],
  "connections": {
    "\uacbd\ube44 \uc811\uc218": {
      "main": [
        [
          {
            "node": "\ub370\uc774\ud130 \uac80\uc99d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ub370\uc774\ud130 \uac80\uc99d": {
      "main": [
        [
          {
            "node": "\uacbd\ube44 \uae30\ub85d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uacbd\ube44 \uae30\ub85d": {
      "main": [
        [
          {
            "node": "\uc811\uc218 \ud655\uc778 \uc54c\ub9bc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc811\uc218 \ud655\uc778 \uc54c\ub9bc": {
      "main": [
        [
          {
            "node": "\uc751\ub2f5 \uc0dd\uc131",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc751\ub2f5 \uc0dd\uc131": {
      "main": [
        [
          {
            "node": "\uc644\ub8cc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "",
    "timezone": "Asia/Seoul",
    "saveExecutionProgress": true,
    "saveDataErrorExecution": "all",
    "saveDataSuccessExecution": "all",
    "executionTimeout": 3600
  },
  "staticData": null,
  "tags": [
    {
      "createdAt": "2026-03-09T00:00:00.000Z",
      "updatedAt": "2026-03-09T00:00:00.000Z",
      "id": "finance",
      "name": "\uae08\uc735"
    },
    {
      "createdAt": "2026-03-09T00:00:00.000Z",
      "updatedAt": "2026-03-09T00:00:00.000Z",
      "id": "expense-mgmt",
      "name": "\uacbd\ube44 \uad00\ub9ac"
    }
  ],
  "triggerCount": 1,
  "updatedAt": "2026-03-09T00:00:00.000Z",
  "versionId": "1"
}