AutomationFlowsAI & RAG › Related Item

Related Item

Related-item. Uses agent, lmChatAwsBedrock, httpRequest. Webhook trigger; 11 nodes.

Webhook trigger★★★★☆ complexityAI-powered11 nodesAgentLm Chat Aws BedrockHTTP Request
AI & RAG Trigger: Webhook Nodes: 11 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Related-item",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "related-item",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -32,
        0
      ],
      "id": "660815d1-28c5-4680-8589-ace315ae06db",
      "name": "Webhook"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.body.cn }},{{ $json.body.en }}",
        "options": {
          "systemMessage": "\u4f60\u662f\u4e00\u4e2a\u52a9\u624b\u3002\u7528\u6237\u4f1a\u7ed9\u4f60\u4e00\u4e2a\u7269\u54c1\u7684\u4e2d\u6587\u540d\u5b57\u548c\u82f1\u6587\u540d\u5b57\u3002  \n\u8bf7\u8f93\u51fa\u4e00\u4e2aJSON\uff0c\u5305\u542b\uff1a  \n1. related_items: 3\u4e2a\u4e0e\u8be5\u7269\u54c1\u76f8\u5173\u7684\u4e2d\u6587\u548c\u82f1\u6587\u540d\u5b57\u3002  \n2. example_sentences: 3\u4e2a\u53e5\u5b50\uff0c\u6bcf\u4e2a\u53e5\u5b50\u540c\u65f6\u5305\u542b\u4e2d\u6587\u548c\u82f1\u6587\uff0c\u53e5\u5b50\u91cc\u8981\u4f7f\u7528\u5230\u8fd9\u4e2a\u7269\u54c1\u3002  \n\n\u5fc5\u987b\u662f\u5408\u6cd5\u7684JSON\u683c\u5f0f\uff0c\u4e0d\u8981\u8f93\u51fa\u5176\u4ed6\u5185\u5bb9\u3002\n\n\u793a\u4f8b\uff08\u8bf7\u4e25\u683c\u6309\u4e0a\u9762\u7ed3\u6784\u8f93\u51fa\uff0c\u4e0d\u8981\u5728\u771f\u5b9e\u8f93\u51fa\u4e2d\u5305\u542b\u6ce8\u91ca\uff09\uff1a\n{\n  \"related_items\": [\n    {\"cn\": \"\u725b\u5976\", \"en\": \"milk\"},\n    {\"cn\": \"\u7cd6\", \"en\": \"sugar\"},\n    {\"cn\": \"\u676f\u5b50\", \"en\": \"cup\"}\n  ],\n  \"example_sentences\": [\n    {\"cn\": \"\u6211\u65e9\u4e0a\u559d\u4e86\u4e00\u676f\u5496\u5561\u3002\", \"en\": \"I drank a cup of coffee this morning.\"},\n    {\"cn\": \"\u5496\u5561\u592a\u70eb\u4e86\uff0c\u5c0f\u5fc3\u522b\u88ab\u70eb\u5230\u3002\", \"en\": \"The coffee is too hot; be careful not to burn yourself.\"},\n    {\"cn\": \"\u6211\u4eec\u53bb\u5496\u5561\u5e97\u5750\u5750\u5427\u3002\", \"en\": \"Let's go to the coffee shop and sit for a while.\"}\n  ]\n}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        208,
        0
      ],
      "id": "3dcb4782-5c9c-4fd0-9209-3dea5353e17f",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        768,
        0
      ],
      "id": "b61facde-996c-4271-9b59-8f678e94d0ac",
      "name": "Respond to Webhook"
    },
    {
      "parameters": {
        "jsCode": "// n8n Code \u8282\u70b9\nreturn items.map(item => {\n  let parsed;\n  try {\n    parsed = JSON.parse(item.json.output);  // \u628a output \u91cc\u7684\u5b57\u7b26\u4e32\u89e3\u6790\u6210\u5bf9\u8c61\n  } catch (e) {\n    throw new Error(\"JSON \u89e3\u6790\u5931\u8d25: \" + e.message);\n  }\n\n  return {\n    json: parsed\n  };\n});\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        560,
        0
      ],
      "id": "2977f9b1-5875-413c-9a05-b43f723f27dc",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "model": "meta.llama3-70b-instruct-v1:0",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
      "typeVersion": 1.1,
      "position": [
        208,
        192
      ],
      "id": "fb98becc-23af-44f4-bef6-c068372d4970",
      "name": "AWS Bedrock Chat Model",
      "credentials": {
        "aws": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://172.31.30.231:3005/api/words",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.data }}",
        "options": {}
      },
      "id": "be151d84-6b49-4b5e-b1ab-6243cf7cad5f",
      "name": "POST2",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        1312,
        -176
      ]
    },
    {
      "parameters": {
        "url": "http://172.31.30.231:3005/api/profile",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -176
      ],
      "id": "049f4904-45f7-4d46-8c9a-a2f4b517de72",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "url": "=http://172.31.30.231:3005/api/user-statistics/{{ $json.data.id }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1216,
        0
      ],
      "id": "eddabedf-48b5-4000-8306-08b84118a519",
      "name": "Get Cache Statistics"
    },
    {
      "parameters": {
        "url": "=http://172.31.30.231:3005/api/profile",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        976,
        0
      ],
      "id": "0b334064-a098-4df2-afef-48837c944067",
      "name": "HTTP Request3"
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=http://172.31.30.231:3005/api/user-statistics/{{ $json.data.users_id }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.data }}",
        "options": {}
      },
      "id": "e180e48d-fe7f-47bb-a443-e899d8c10c80",
      "name": "Update Statistics",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        1616,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "return items.map(item => {\n  const old = item.json;\n\n  return {\n    json: {\n      ...old,\n      data: {\n        ...old.data,\n        words_learned: (old.data.words_learned || 0) + 3\n      }\n    }\n  };\n});\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1424,
        0
      ],
      "id": "8c9cd0bf-50b7-4466-a7c6-97367ea6ac7b",
      "name": "Code in JavaScript4"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AWS Bedrock Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook": {
      "main": [
        [
          {
            "node": "HTTP Request3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "POST2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Cache Statistics": {
      "main": [
        [
          {
            "node": "Code in JavaScript4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request3": {
      "main": [
        [
          {
            "node": "Get Cache Statistics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript4": {
      "main": [
        [
          {
            "node": "Update Statistics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "50e331c2-4f96-4458-bcfb-44944f915267",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "ksjqJdms3YMOWRnp",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Related-item. Uses agent, lmChatAwsBedrock, httpRequest. Webhook trigger; 11 nodes.

Source: https://github.com/gohyumin/amadues/blob/033615f2949d87617d54e817f3985c9b3742e112/workflow/Related-item.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

TestFluxNova. Uses httpRequest, agent, outputParserStructured, lmChatAwsBedrock. Webhook trigger; 18 nodes.

HTTP Request, Agent, Output Parser Structured +2
AI & RAG

Agent-Combined-Flow. Uses httpRequest, agent, outputParserStructured, lmChatAwsBedrock. Webhook trigger; 18 nodes.

HTTP Request, Agent, Output Parser Structured +2
AI & RAG

Agent-Trainer-Micro. Uses agent, lmChatAwsBedrock, outputParserStructured, httpRequest. Webhook trigger; 10 nodes.

Agent, Lm Chat Aws Bedrock, Output Parser Structured +1
AI & RAG

⏺ 🚀 How it works

Agent, Anthropic Chat, Output Parser Structured +6
AI & RAG

L&D_AgentsAI_ATIVO. Uses httpRequest, agent, googleCalendarTool, toolSerpApi. Webhook trigger; 93 nodes.

HTTP Request, Agent, Google Calendar Tool +9