8
n8n 中文网amn8n.com

通过 Webhook 使用 ExchangeRate.host 进行货币转换

中级

这是一个Building Blocks领域的自动化工作流,包含 6 个节点。主要使用 Webhook, HttpRequest, RespondToWebhook 等节点。 使用 ExchangeRate.host 通过 Webhook 进行货币转换

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "vQB8xArVsMh8sroM",
  "meta": {
    "instanceId": "1777696fb9fddfee653e70940936c2b1e28ba1f1bde53b7182fbd6eb01988706"
  },
  "name": "通过Webhook使用ExchangeRate.host进行货币转换",
  "tags": [],
  "nodes": [
    {
      "id": "6f42915a-6851-4e36-b086-29fc6c975d48",
      "name": "注意:Webhook触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -160
      ],
      "parameters": {
        "width": 280,
        "height": 540,
        "content": "## Webhook输入"
      },
      "typeVersion": 1
    },
    {
      "id": "52cb862c-71e1-4960-a0f2-2f6a7c620d7b",
      "name": "注意:货币转换API调用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        -160
      ],
      "parameters": {
        "color": 2,
        "width": 280,
        "height": 540,
        "content": "## 货币转换API调用"
      },
      "typeVersion": 1
    },
    {
      "id": "e75b2ecb-7637-4dfc-9ded-d2f8294d64ba",
      "name": "注意:Webhook响应",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        0
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 380,
        "content": "## Webhook响应"
      },
      "typeVersion": 1
    },
    {
      "id": "aa7f2f15-a806-41a2-94fc-7e3e0b34e66c",
      "name": "转换货币",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        220
      ],
      "parameters": {
        "url": "=https://api.exchangerate.host/convert?from={{ $json.body.from }}&to={{ $json.body.to }}&amount={{ $json.body.amount }}",
        "method": "=GET",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "HK0TybEUeSEKTm0j",
          "name": "ExchangeRate"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7d362367-2cbc-4761-ac60-a9c0cdf96329",
      "name": "接收转换请求Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        80,
        220
      ],
      "webhookId": "fe5e86fb-2975-4206-8982-19c52dc6a327-unique-id",
      "parameters": {
        "path": "convert-currency",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "9cfde3de-fdad-4d16-bed4-08512d57dd73",
      "name": "响应转换后的金额",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        780,
        220
      ],
      "parameters": {
        "options": {},
        "respondWith": "allIncomingItems"
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d7c961bc-e3f3-42a4-8238-5b0393417449",
  "connections": {
    "Convert Currency": {
      "main": [
        [
          {
            "node": "Respond with Converted Amount",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Conversion Request Webhook": {
      "main": [
        [
          {
            "node": "Convert Currency",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 构建模块

需要付费吗?

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

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

适合有一定经验的用户,包含 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 查看

分享此工作流