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": "BTS AI Menu Pipeline",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "create-menu",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook",
"name": "Menu Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
200,
300
]
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body || $input.first().json;\nconst restaurantId = body.restaurantId || 'unknown';\nconst vendorId = body.vendorId;\n\n// Determine input type\nlet inputType = 'unknown';\nlet imageData = null;\n\nif (body.file?.base64 || body.file?.data) {\n inputType = 'image';\n imageData = body.file.base64 || body.file.data;\n}\nif (body.url) {\n inputType = 'url';\n imageData = body.url;\n}\nif (body.menuItems && Array.isArray(body.menuItems)) {\n inputType = 'json';\n}\n\nreturn {\n restaurantId,\n vendorId,\n inputType,\n imageData,\n menuItems: body.menuItems || [],\n timestamp: new Date().toISOString()\n};"
},
"id": "parse-input",
"name": "Parse Input",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
400,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.inputType }}",
"operation": "notEqual",
"value2": "json"
}
]
}
},
"id": "check-image",
"name": "Has Image/URL?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
600,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://openrouter.ai/api/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.OPENROUTER_API_KEY }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"model\": \"google/gemini-2.5-flash\",\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"image_url\", \"image_url\": {\"url\": \"{{ $json.imageData.startsWith('http') ? $json.imageData : 'data:image/jpeg;base64,' + $json.imageData }}\"}},\n {\"type\": \"text\", \"text\": \"Extract ALL menu items from this image. For each item provide: name, price (PHP number), category, description. Return ONLY a JSON array: [{\\\"name\\\":\\\"...\\\",\\\"price\\\":0,\\\"category\\\":\\\"...\\\",\\\"description\\\":\\\"...\\\"}]\"}\n ]\n }],\n \"max_tokens\": 4000\n}",
"options": {
"timeout": 60000
}
},
"id": "vision-extract",
"name": "Vision AI Extract",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
850,
200
]
},
{
"parameters": {
"jsCode": "const input = $input.first().json;\nconst parseInput = $('Parse Input').first().json;\nlet items = parseInput.menuItems || [];\n\n// Parse AI response if available\nif (input.choices?.[0]?.message?.content) {\n try {\n let c = input.choices[0].message.content;\n c = c.replace(/```json?/g, '').replace(/```/g, '').trim();\n const match = c.match(/\\[.*\\]/s);\n if (match) items = JSON.parse(match[0]);\n } catch (e) {\n console.log('Parse error:', e.message);\n }\n}\n\n// Normalize items\nconst normalized = items.map((item, idx) => ({\n id: `item-${idx}-${Date.now()}`,\n name: item.name || `Item ${idx + 1}`,\n price: parseFloat(item.price) || 0,\n category: item.category || 'General',\n description: item.description || '',\n imagePrompt: `Professional food photo of ${item.name || 'Filipino dish'}. Appetizing, warm lighting, ceramic plate, no text.`\n}));\n\nreturn {\n restaurantId: parseInput.restaurantId,\n vendorId: parseInput.vendorId,\n items: normalized,\n count: normalized.length\n};"
},
"id": "normalize",
"name": "Normalize Items",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1100,
300
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={\n \"success\": true,\n \"restaurantId\": \"{{ $json.restaurantId }}\",\n \"itemCount\": {{ $json.count }},\n \"items\": {{ JSON.stringify($json.items) }},\n \"message\": \"Menu items extracted successfully\"\n}"
},
"id": "respond",
"name": "Return Response",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1350,
300
]
}
],
"connections": {
"Menu Webhook": {
"main": [
[
{
"node": "Parse Input",
"type": "main",
"index": 0
}
]
]
},
"Parse Input": {
"main": [
[
{
"node": "Has Image?",
"type": "main",
"index": 0
}
]
]
},
"Has Image?": {
"main": [
[
{
"node": "Vision AI Extract",
"type": "main",
"index": 0
}
],
[
{
"node": "Normalize Items",
"type": "main",
"index": 0
}
]
]
},
"Vision AI Extract": {
"main": [
[
{
"node": "Normalize Items",
"type": "main",
"index": 0
}
]
]
},
"Normalize Items": {
"main": [
[
{
"node": "Return Response",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
BTS AI Menu Pipeline. Uses httpRequest. Webhook trigger; 6 nodes.
Source: https://github.com/innovatehubph/bts-delivery/blob/26bb958764e52fab467da38333b0c259c7a84fd8/n8n-workflows/ai-menu-pipeline.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