8
n8n 中文网amn8n.com

使用ZenQuotes API通过Webhook按需提供励志名言

中级

这是一个Other, HR领域的自动化工作流,包含 9 个节点。主要使用 Set, Webhook, HttpRequest, RespondToWebhook 等节点。 使用ZenQuotes API通过Webhook按需提供励志名言

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VQKwOBOL659w93wt",
  "meta": {
    "instanceId": "3fed23de697c60307f3b4f5caeafbeffabaf7bbd62c1b20ae70d5faf5a9806b4"
  },
  "name": "使用 ZenQuotes API 通过 Webhook 按需提供励志名言",
  "tags": [
    {
      "id": "F1KjxL3SjfvVqZqo",
      "name": "training-n8n",
      "createdAt": "2025-04-29T10:40:13.332Z",
      "updatedAt": "2025-04-29T10:40:13.332Z"
    }
  ],
  "nodes": [
    {
      "id": "88e43bad-07dc-4742-b3c6-fe70059d209f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 200,
        "content": "## 适合初学者的工作流,介绍如何使用 API 并将数据格式化为所需输出"
      },
      "typeVersion": 1
    },
    {
      "id": "65d7b23d-b919-4dc3-b16e-d60565d5cda5",
      "name": "从 ZenQuotes 获取随机名言",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        80
      ],
      "parameters": {
        "url": "https://zenquotes.io/api/random",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "count",
              "value": "5"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c5ad35dc-62b6-488f-a501-d834e538dbf9",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        80
      ],
      "webhookId": "c376e35b-80f3-4086-abec-d2c5a4501fb3",
      "parameters": {
        "path": "c376e35b-80f3-4086-abec-d2c5a4501fb3",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "3a5da469-919c-411e-a5e9-a95a2178b01a",
      "name": "发送响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        940,
        80
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "{\n  \"quote\": \"{{ $json.quotes }}\"\n}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "cc390845-9e73-4761-92aa-5bbbff906e77",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        40
      ],
      "parameters": {
        "width": 260,
        "height": 180,
        "content": "### 接收传入请求"
      },
      "typeVersion": 1
    },
    {
      "id": "4996be52-267c-4900-87c1-3d6654ef0938",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        40
      ],
      "parameters": {
        "color": 2,
        "width": 300,
        "height": 220,
        "content": "### 获取随机名言"
      },
      "typeVersion": 1
    },
    {
      "id": "94532c78-d55e-4672-b984-385cd2e04b5c",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        40
      ],
      "parameters": {
        "color": 3,
        "width": 260,
        "height": 200,
        "content": "### 格式化为“名言 – 作者”字符串"
      },
      "typeVersion": 1
    },
    {
      "id": "83a09872-7da8-47ed-8b3d-e81b52d75050",
      "name": "格式化数据",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6b646b1c-914b-437e-ba5e-5a1fbfebbde9",
              "name": "quotes",
              "type": "string",
              "value": "=\"{{ $json.q }}\" - {{ $json.a }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "978227eb-2963-4dda-8341-fe75c2376506",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        40
      ],
      "parameters": {
        "width": 260,
        "height": 200,
        "content": "### 返回 JSON 数组"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "79051d11-19e3-4326-bf6e-0ac0f81ffc43",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Get Random Quote from ZenQuotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format data": {
      "main": [
        [
          {
            "node": "Send response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Random Quote from ZenQuotes": {
      "main": [
        [
          {
            "node": "Format data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 其他, 人力资源

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类2
节点类型5
难度说明

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

作者
ist00dent

ist00dent

@ist00dent

I’m a dedicated automation engineer passionate about no-code and low-code solutions. I design and implement robust n8n workflows—integrating APIs, databases, and messaging—to eliminate manual tasks and accelerate delivery. Leveraging Python and C#, I build scalable, adaptable automations that empower teams to focus on high-value work.

外部链接
在 n8n.io 查看

分享此工作流