{
 "name": "[노드 한 장] Calculator · 샘플 할인 금액을 실제 도구로 계산",
 "nodes": [
  {
   "id": "m",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "s",
   "name": "Sample price calculation",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    220,
    0
   ],
   "parameters": {
    "jsCode": "// 직접 작성한 샘플, 실제 주문/결제가 아님. 배송비와 추가 세금은 없다고 가정.\nreturn [{json:{sample:true,unitPrice:50000,discountRate:0.1,quantity:3,expression:'50000*0.9*3'}}];"
   }
  },
  {
   "id": "a",
   "name": "AI Agent",
   "type": "@n8n/n8n-nodes-langchain.agent",
   "typeVersion": 3,
   "position": [
    460,
    0
   ],
   "parameters": {
    "promptType": "define",
    "text": "=직접 작성한 샘플입니다. 단가 {{ $json.unitPrice }}원, 10% 할인, 수량 {{ $json.quantity }}개의 합계입니다. 배송비와 추가 세금은 없다고 가정합니다. 연결된 Calculator 도구를 반드시 실제 호출해 {{ $json.expression }} 을 계산하세요. 스스로 계산해 도구 결과처럼 말하지 마세요. 도구 응답을 받은 다음 수식과 원화 결과를 한국어 한 문장으로 답하세요.",
    "hasOutputParser": false,
    "options": {
     "systemMessage": "You help with a fictional price example using the connected Calculator tool. Always use the tool for this calculation, then report the actual tool response. Do not invent tool results.",
     "maxIterations": 3,
     "returnIntermediateSteps": true
    }
   }
  },
  {
   "id": "lm",
   "name": "OpenAI Chat Model",
   "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
   "typeVersion": 1.2,
   "position": [
    420,
    240
   ],
   "parameters": {
    "model": {
     "__rl": true,
     "mode": "list",
     "value": "gpt-4.1-mini",
     "cachedResultName": "gpt-4.1-mini"
    },
    "options": {
     "temperature": 0
    }
   }
  },
  {
   "id": "t",
   "name": "Calculator",
   "type": "@n8n/n8n-nodes-langchain.toolCalculator",
   "typeVersion": 1,
   "position": [
    680,
    240
   ],
   "parameters": {}
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Sample price calculation",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Sample price calculation": {
   "main": [
    [
     {
      "node": "AI Agent",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "OpenAI Chat Model": {
   "ai_languageModel": [
    [
     {
      "node": "AI Agent",
      "type": "ai_languageModel",
      "index": 0
     }
    ]
   ]
  },
  "Calculator": {
   "ai_tool": [
    [
     {
      "node": "AI Agent",
      "type": "ai_tool",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "executionOrder": "v1",
  "timezone": "Asia/Seoul"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}