{
 "name": "[노드 한 장] Item List Output Parser · 샘플 품목 3개",
 "nodes": [
  {
   "id": "m",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "s",
   "name": "Direct sample item names",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    220,
    0
   ],
   "parameters": {
    "jsCode": "// 직접 작성한 샘플 품목 3개. 실제 상품/고객 데이터 아님.\nconst names=[\"머그컵\",\"접이식 우산\",\"노트\"];\nreturn [{json:{sample:true,sourceKind:'direct-authored-sample',sourceText:names.join('\\n'),expectedNames:names}}];"
   }
  },
  {
   "id": "c",
   "name": "Basic LLM Chain",
   "type": "@n8n/n8n-nodes-langchain.chainLlm",
   "typeVersion": 1.7,
   "position": [
    500,
    0
   ],
   "parameters": {
    "promptType": "define",
    "hasOutputParser": true,
    "text": "=직접 작성한 샘플 품목 목록입니다. 각 줄의 품목 이름을 그대로 3줄로 다시 출력하세요. 설명, 번호, 따옴표, 글머리표 없이 원문 순서를 유지하세요.\n원문 목록:\n{{ $json.sourceText }}",
    "batching": {
     "batchSize": 1
    }
   }
  },
  {
   "id": "lm",
   "name": "OpenAI Chat Model",
   "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
   "typeVersion": 1.2,
   "position": [
    460,
    260
   ],
   "parameters": {
    "model": {
     "__rl": true,
     "mode": "list",
     "value": "gpt-4.1-mini",
     "cachedResultName": "gpt-4.1-mini"
    },
    "options": {
     "temperature": 0
    }
   },
   "note": "Connect your own approved OpenAI credential"
  },
  {
   "id": "p",
   "name": "Item List Output Parser",
   "type": "@n8n/n8n-nodes-langchain.outputParserItemList",
   "typeVersion": 1,
   "position": [
    700,
    260
   ],
   "parameters": {
    "options": {
     "numberOfItems": 3,
     "separator": "\\n"
    }
   }
  },
  {
   "id": "v",
   "name": "Verify 3 native parser items and order",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    800,
    0
   ],
   "parameters": {
    "jsCode": "const src=$('Direct sample item names').first().json;\nconst input=$input.all();\nif(input.length!==3) throw new Error('Expected 3 native parser output items');\nconst names=input.map(it=>it.json.text??it.json.output??it.json);\nconst shape=names.every(v=>typeof v==='string')&&names.length===3;\nconst originalNamesMatch=shape&&names.every((v,i)=>v===src.expectedNames[i]);\nif(!originalNamesMatch) throw new Error('Parser output names/order mismatch');\nreturn [{json:{sample:true,sourceKind:src.sourceKind,sourceText:src.sourceText,parserArray:names,parserArrayLength:names.length,n8nItemCountAfterParser:input.length,nativeParserOutput:true,originalNamesMatch:true,orderVerified:true,verificationNote:'Basic LLM Chain이 parser의 3개 문자열을 3 n8n items로 출력했고 원문 이름·순서를 검증.'}}];"
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Direct sample item names",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Direct sample item names": {
   "main": [
    [
     {
      "node": "Basic LLM Chain",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Basic LLM Chain": {
   "main": [
    [
     {
      "node": "Verify 3 native parser items and order",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "OpenAI Chat Model": {
   "ai_languageModel": [
    [
     {
      "node": "Basic LLM Chain",
      "type": "ai_languageModel",
      "index": 0
     }
    ]
   ]
  },
  "Item List Output Parser": {
   "ai_outputParser": [
    [
     {
      "node": "Basic LLM Chain",
      "type": "ai_outputParser",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}