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 →
{
"name": "semantic_search",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "search-medicine",
"responseMode": "lastNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
0,
0
],
"id": "d03f3421-03be-4206-884f-81de23bcec1c",
"name": "Webhook"
},
{
"parameters": {
"url": "https://byysargobxhyirurxkuy.supabase.co/rest/v1/medicines?select=*&user_id=is.null",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "{{SUPABASE_SERVICE_ROLE_KEY}}"
},
{
"name": "Authorization",
"value": "Bearer {{SUPABASE_SERVICE_ROLE_KEY}}"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
208,
-80
],
"id": "b4a2f593-abb5-42bf-99fd-ce6b0d441520",
"name": "Get Legacy Medicines"
},
{
"parameters": {
"url": "=https://byysargobxhyirurxkuy.supabase.co/rest/v1/medicines?select=*&user_id=eq.{{ $json.body.user_id }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "{{SUPABASE_SERVICE_ROLE_KEY}}"
},
{
"name": "Authorization",
"value": "Bearer {{SUPABASE_SERVICE_ROLE_KEY}}"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
208,
80
],
"id": "f3c1a9d2-6b4e-4a17-9c2d-8e5f7a1b3c9d",
"name": "Get Real Medicines"
},
{
"parameters": {
"mode": "append"
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
416,
0
],
"id": "a8e2d5c7-1f3b-4d6a-9e8c-2b7f4a6d1c3e",
"name": "Merge Legacy + Real"
},
{
"parameters": {
"mode": "runOnceForAllItems",
"language": "javaScript",
"jsCode": "let combined = [];\nfor (const item of $input.all()) {\n combined = combined.concat(item.json.body || []);\n}\nreturn [{ json: { body: combined } }];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
0
],
"id": "5b6e8a1c-3d9f-4c2b-8a7e-1f4d6c9b2a3e",
"name": "Flatten Search Results"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "d53152fa-e8cb-446d-b41b-b8fc7d82875d",
"name": "searchQuery",
"value": "={{ $('Webhook').item.json.body.query }}",
"type": "string"
},
{
"id": "0ac1f5d6-2e94-437b-ae29-4d84ca83cdf5",
"name": "inventoryText",
"value": "={{ JSON.stringify($json.body) }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
800,
0
],
"id": "09d9c80b-645b-4d09-a6d2-f30b8f60c828",
"name": "Prepare Search Data"
},
{
"parameters": {
"method": "POST",
"url": "https://openrouter.ai/api/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{OPENROUTER_API_KEY}}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({\n model: \"deepseek/deepseek-v4-flash\",\n messages: [\n { role: \"system\", content: \"You are a search assistant for a home medicine cabinet app. Match SEARCH QUERY to medicines in INVENTORY by meaning, not exact words. Only return medicines that exist in INVENTORY. If nothing matches, say so honestly. Reply with ONLY valid JSON: an object with one field called matches, a list of objects each with a name field and a reason field.\" },\n { role: \"user\", content: \"SEARCH QUERY: \" + $json.searchQuery + \" INVENTORY: \" + $json.inventoryText }\n ]\n}) }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
1008,
0
],
"id": "7a30c05d-c891-4a95-b4fe-5330043598bb",
"name": "Search Medicines by Meaning"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3100ea0e-613a-4fc4-8755-aa8b33234ade",
"name": "matches",
"value": "={{ JSON.parse($json.choices[0].message.content.replace(/```json/g, '').replace(/```/g, '').trim()).matches }}",
"type": "array"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1216,
0
],
"id": "026241cf-741f-41f9-8671-82b3e81da284",
"name": "Prepare Search Response"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Get Legacy Medicines",
"type": "main",
"index": 0
},
{
"node": "Get Real Medicines",
"type": "main",
"index": 0
}
]
]
},
"Get Legacy Medicines": {
"main": [
[
{
"node": "Merge Legacy + Real",
"type": "main",
"index": 0
}
]
]
},
"Get Real Medicines": {
"main": [
[
{
"node": "Merge Legacy + Real",
"type": "main",
"index": 1
}
]
]
},
"Merge Legacy + Real": {
"main": [
[
{
"node": "Flatten Search Results",
"type": "main",
"index": 0
}
]
]
},
"Flatten Search Results": {
"main": [
[
{
"node": "Prepare Search Data",
"type": "main",
"index": 0
}
]
]
},
"Prepare Search Data": {
"main": [
[
{
"node": "Search Medicines by Meaning",
"type": "main",
"index": 0
}
]
]
},
"Search Medicines by Meaning": {
"main": [
[
{
"node": "Prepare Search Response",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false
},
"nodeGroups": [],
"id": "987DstgYaseuUY36",
"tags": []
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
semantic_search. Uses httpRequest. Webhook trigger; 8 nodes.
Source: https://github.com/Morn-Thuta/CabinetCare_C240_Project/blob/108c6065fbda2497f8f82ad6e6bcb1dd9976e1a0/n8n-workflows/semantic-search.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c