{"meta":{"instanceId":"workflow-0903c371","versionId":"1.0.0","createdAt":"2025-09-29T07:07:48.816962","updatedAt":"2025-09-29T07:07:48.816980","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"nodes":[{"id":"5a421900-20d7-4d64-a064-3211c3338676","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-520,-820],"parameters":{"width":432,"height":397,"content":"## Self-coded LLM Chain Node"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"93e3641b-d365-456d-b939-11fd92da8155","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","position":[-1060,-740],"parameters":{},"typeVersion":1,"notes":"This manualTrigger node performs automated tasks as part of the workflow."},{"id":"235e436f-353f-4bb4-a619-35ebb17011d0","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-300,-100],"parameters":{"width":320.2172923777021,"height":231,"content":"## Self-coded Tool Node"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"4265a9d3-7c7e-4511-9a41-fa5a940f8869","name":"Set2","type":"n8n-nodes-base.set","position":[-820,-740],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6c3d9c41-58b0-4d0d-8892-0b1a96428da3","name":"chatInput","type":"string","value":"Tell me a joke"}]}},"typeVersion":3.4,"notes":"This set node performs automated tasks as part of the workflow."},{"id":"b78b6d50-53be-43a1-889c-773726443bfb","name":"Custom - LLM Chain Node1","type":"n8n-nodes-base.noOp","position":[-440,-740],"parameters":{"code":{"execute":{"code":"const { PromptTemplate } = require('@langchain/core/prompts');\n\nconst query = $input.item.json.chatInput;\nconst prompt = PromptTemplate.fromTemplate(query);\nconst llm = await this.getInputConnectionData('ai_languageModel', 0);\nlet chain = prompt.pipe(llm);\nconst output = await chain.invoke();\nreturn [ {json: { output } } ];"}},"inputs":{"input":[{"type":"main","required":true,"maxConnections":1},{"type":"ai_languageModel","required":true,"maxConnections":1}]},"outputs":{"output":[{"type":"main"}]}},"typeVersion":1,"notes":"This code node performs automated tasks as part of the workflow."},{"id":"cc27654f-92bd-48f5-80d9-1d4f9c83ecb5","name":"OpenAI Chat Model","type":"n8n-nodes-base.noOp","position":[-420,-580],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"8gccIjcuf3gvaoEr","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"e64b5510-efd9-4a8b-aa3c-4312219cb2f0","name":"Set3","type":"n8n-nodes-base.set","position":[-820,-440],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6c3d9c41-58b0-4d0d-8892-0b1a96428da3","name":"chatInput","type":"string","value":"What year was Einstein born?"}]}},"typeVersion":3.4,"notes":"This set node performs automated tasks as part of the workflow."},{"id":"77f8bff3-8868-43ca-8739-7cc16d15dd80","name":"AI Agent","type":"n8n-nodes-base.noOp","position":[-440,-340],"parameters":{"options":{}},"typeVersion":1,"notes":"This agent node performs automated tasks as part of the workflow."},{"id":"d6e943df-ee88-4d0b-bca4-68b9f249dd00","name":"OpenAI Chat Model1","type":"n8n-nodes-base.noOp","position":[-460,-120],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"8gccIjcuf3gvaoEr","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"a4b19037-399a-4d0b-abe0-378d8d81c536","name":"Custom - Wikipedia1","type":"n8n-nodes-base.noOp","position":[-180,-20],"parameters":{"name":"wikipedia_tool","jsCode":"console.log('Custom Wikipedia Node runs');\nconst { WikipediaQueryRun } = require(\"@n8n/n8n-nodes-langchain/node_modules/@langchain/community/tools/wikipedia_query_run.cjs\");\n\nconst tool = new WikipediaQueryRun({\n  topKResults: 3,\n  maxDocContentLength: 4000,\n});\n\nreturn await tool.invoke(query);","description":"Call this tool to research a topic on wikipedia."},"typeVersion":1,"notes":"This toolCode node performs automated tasks as part of the workflow."},{"id":"error-0f0b6015","name":"Error Handler","type":"n8n-nodes-base.stopAndError","typeVersion":1,"position":[1000,400],"parameters":{"message":"Workflow execution error","options":{}}}],"connections":{"OpenAI Chat Model":{"main":[[]]},"OpenAI Chat Model1":{"main":[[]]}},"name":"Stickynote Workflow","settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"description":"Automated workflow: Stickynote Workflow. This workflow integrates 8 different services: stickyNote, code, agent, set, stopAndError. It contains 12 nodes and follows best practices for error handling and security.","notes":"Excellent quality workflow: Stickynote Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}