{
  "name": "Recipe 3 · AI confirmation (Lovable)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "confirm",
        "responseMode": "responseNode",
        "options": {
          "allowedOrigins": "*"
        }
      },
      "name": "Kitchen bell (Webhook)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "vibesprint-confirm"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are the friendly voice of a small restaurant. Write two short lines confirming the order. No emojis, no questions."
            },
            {
              "content": "=Guest {{ $json.body.name }} ordered {{ $json.body.main }} and {{ $json.body.drink }}."
            }
          ]
        },
        "options": {}
      },
      "name": "Write confirmation (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        260,
        0
      ],
      "notes": "Credential: pick your own OpenAI credential here (Credentials menu, add OpenAI, paste your key). No key? Connect the bell to 'No key? (Edit Fields)' instead."
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a0",
              "name": "message",
              "value": "={{ { content: 'Hi ' + $json.body.name + ', your ' + $json.body.main + ' and ' + $json.body.drink + ' are in the kitchen.' } }}",
              "type": "object"
            }
          ]
        },
        "options": {}
      },
      "name": "No key? (Edit Fields)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        260,
        220
      ],
      "notes": "Fallback without AI: same output shape, so the Respond box does not care."
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"answer\": $json.message.content } }}",
        "options": {}
      },
      "name": "Hand it back (Respond)",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        520,
        0
      ]
    }
  ],
  "connections": {
    "Kitchen bell (Webhook)": {
      "main": [
        [
          {
            "node": "Write confirmation (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write confirmation (OpenAI)": {
      "main": [
        [
          {
            "node": "Hand it back (Respond)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No key? (Edit Fields)": {
      "main": [
        [
          {
            "node": "Hand it back (Respond)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}