{
  "name": "Generate recipes from fridge photos using GPT-4 Vision & Telegram",
  "nodes": [
    {
      "id": "if_node_001",
      "name": "Check Input Type",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        -16
      ]
    },
    {
      "id": "ai_agent_vision_001",
      "name": "AI Vision Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        704,
        -128
      ]
    },
    {
      "id": "openai_vision_model_001",
      "name": "OpenAI Vision Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        672,
        16
      ]
    },
    {
      "id": "output_parser_001",
      "name": "Ingredient Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        896,
        16
      ]
    },
    {
      "id": "set_ingredients_001",
      "name": "Format Ingredients",
      "type": "n8n-nodes-base.set",
      "position": [
        1088,
        -128
      ]
    },
    {
      "id": "set_text_ingredients_001",
      "name": "Get Text Ingredients",
      "type": "n8n-nodes-base.set",
      "position": [
        688,
        144
      ]
    },
    {
      "id": "recipe_generator_001",
      "name": "Recipe Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        144
      ]
    },
    {
      "id": "openai_recipe_model_001",
      "name": "OpenAI Recipe Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1264,
        320
      ]
    },
    {
      "id": "recipe_parser_001",
      "name": "Recipe Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1456,
        320
      ]
    },
    {
      "id": "format_response_001",
      "name": "Format Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1680,
        144
      ]
    },
    {
      "id": "684b387e-b22d-47a2-8db3-5367850fa33d",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        176,
        -16
      ]
    },
    {
      "id": "812b9b19-c320-4a6b-a28f-7bf80a7863bd",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1872,
        144
      ]
    },
    {
      "id": "a9e0f1b2-c3d4-e5f6-a7b8-c9d0e1f2a3b4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -320
      ],
      "parameters": {
        "width": 500,
        "height": 260,
        "content": "### Phase 1: User Input via Telegram\n\n-   **Telegram Trigger**: Starts the workflow when a user sends a message or image.\n\n-   **Check Input Type**: This crucial IF node checks if the message contains"
      }
    },
    {
      "id": "b1c2d3e4-f5a6-b7c8-d9e0-f1a2b3c4d5e6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -448
      ],
      "parameters": {
        "width": 500,
        "height": 380,
        "content": "### Phase 2: Ingredient Extraction (Dual Path)\nThis section's goal is to create a standardized list of ingredients for the next phase.\n\n-   **Image Path (Top)**: The `AI Vision Agent` analyzes the pho"
      }
    },
    {
      "id": "c3d4e5f6-a7b8-c9d0-e1f2-a3b4c5d6e7f8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -192
      ],
      "parameters": {
        "width": 500,
        "height": 360,
        "content": "### Phase 3: AI Recipe Generation\n\n-   **Recipe Generator**: This is the main creative AI. It takes the standardized ingredient list (from either path) and acts as a professional chef to generate 3 de"
      }
    },
    {
      "id": "d5e6f7a8-b9c0-d1e2-f3a4-b5c6d7e8f9a0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -128
      ],
      "parameters": {
        "width": 500,
        "height": 280,
        "content": "### Phase 4: Format & Send Response\n\n-   **Format Response**: This node uses a JavaScript expression to transform the structured recipe JSON from the parser into a beautiful, emoji-rich, and easy-to-r"
      }
    }
  ],
  "connections": {
    "Recipe Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Recipe Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Vision Agent": {
      "main": [
        [
          {
            "node": "Format Ingredients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Input Type": {
      "main": [
        [
          {
            "node": "AI Vision Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Text Ingredients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recipe Generator": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check Input Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ingredient Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Vision Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Format Ingredients": {
      "main": [
        [
          {
            "node": "Recipe Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Recipe Model": {
      "ai_languageModel": [
        [
          {
            "node": "Recipe Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Vision Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Vision Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Text Ingredients": {
      "main": [
        [
          {
            "node": "Recipe Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}