8
n8n 中文网amn8n.com

在n8n AI代理中通过API Ninjas食谱API查找分步食谱

中级

这是一个自动化工作流,包含 6 个节点。主要使用 Agent, HttpRequestTool, ChatTrigger, LmChatOpenAi, MemoryBufferWindow 等节点。 在n8n AI代理中通过API Ninjas食谱API查找分步食谱

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "c8c9ba5d3eb26ae47a06d24ff164a01c0d73ed4753a74903c2bb609d434a0f6b",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "69588c4f-75cb-48c1-913d-b39e108591aa",
      "name": "Chat Trigger - 接收消息",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        624,
        16
      ],
      "webhookId": "c730e1d3-d3db-46f4-9218-b9b0d9312b7c",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "9e3376ef-ebef-481d-953b-aee21c174646",
      "name": "AI Agent - 路由至工具",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        832,
        16
      ],
      "parameters": {
        "options": {
          "systemMessage": "Always use the recipe tool if i ask you for recipe"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8900f434-6a59-47f7-ad6e-ce4649ba417b",
      "name": "LLM - OpenAI 聊天",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        768,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "IscXryYQZrfSUSkH",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a1c84496-89b6-405a-ae4a-c9688d717586",
      "name": "Recipe Tool - 从 API Ninjas 获取",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1120,
        224
      ],
      "parameters": {
        "url": "https://api.api-ninjas.com/v1/recipe",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            }
          ]
        },
        "toolDescription": "Use the query parameter to specify the food, and it will return a recipe"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "IU0D73p4jW1pvQE8",
          "name": "API Ninjas Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ce484377-a229-49b7-a6b7-ac3592595a25",
      "name": "Memory - 最近消息(窗口)",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        928,
        224
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "c13fc9d9-1f10-49c9-87e2-4f9233e56626",
      "name": "工作流描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 272,
        "height": 912,
        "content": "# 工作流描述"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "LLM - OpenAI Chat": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Route to Tools",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger - Receive Message": {
      "main": [
        [
          {
            "node": "AI Agent - Route to Tools",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Memory - Recent Messages (Window)": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Route to Tools",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Recipe Tool - Fetch from API Ninjas": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Route to Tools",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量6
分类-
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Milan Vasarhelyi - SmoothWork

Milan Vasarhelyi - SmoothWork

@vasarmilan

We help you eliminate the busywork by building compact business tools tailored to your processes. 📞: https://smoothwork.ai/book-a-call ▶️: https://www.youtube.com/@vasarmilan

外部链接
在 n8n.io 查看

分享此工作流