8
n8n 中文网amn8n.com

通过 API 将每日多币种汇率更新发送到电子邮件和 WhatsApp

中级

这是一个Crypto Trading领域的自动化工作流,包含 15 个节点。主要使用 Set, Wait, WhatsApp, EmailSend, HttpRequest 等节点。 从 CurrencyFreaks API 发送每日汇率到电子邮件和 WhatsApp

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "5EnZkZXpxy95JiaU",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "通过 API 将每日多币种汇率更新发送到电子邮件和 WhatsApp",
  "tags": [],
  "nodes": [
    {
      "id": "0121e662-72d7-46c6-a3e2-41e3fd94de11",
      "name": "每日触发器(上午 7:30 IST)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -280,
        180
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "993ff9e7-0958-4b2e-b578-1f4d78e052f8",
      "name": "设置配置:API 密钥和货币",
      "type": "n8n-nodes-base.set",
      "position": [
        -60,
        180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4669b111-8540-4de2-a5f7-672f2ad81e98",
              "name": "API",
              "type": "string",
              "value": "Enter_your_api_key"
            },
            {
              "id": "58c89ccb-2e3d-4334-9366-d0b285fdfbd8",
              "name": "Currencies",
              "type": "string",
              "value": "INR,CAD,AUD,CNY,EUR,USD"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3c0cb008-daa7-4832-a1f3-f093b0201d6b",
      "name": "获取汇率 (CurrencyFreaks)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        180
      ],
      "parameters": {
        "url": "=https://api.currencyfreaks.com/v2.0/rates/latest?apikey={{ $json['API Key'] }}&symbols={{ $json['Currencies'] }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "249dde1c-95b4-480c-91ab-90651ed6a6a9",
      "name": "等待 API 响应(5 秒)",
      "type": "n8n-nodes-base.wait",
      "position": [
        380,
        180
      ],
      "webhookId": "fba78dc5-c55b-47de-85fd-a0c0c6498444",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "9f860161-dda0-4351-9ce4-ce02204cef32",
      "name": "设置电子邮件和 WhatsApp 收件人",
      "type": "n8n-nodes-base.set",
      "position": [
        600,
        180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0b0969ab-45d1-427c-bac0-bd59a43661d7",
              "name": "Email_id",
              "type": "string",
              "value": "abc@gmail.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "51a13f97-7ba1-465d-9dc2-701fb932c64c",
      "name": "创建邮件主题和正文",
      "type": "n8n-nodes-base.set",
      "position": [
        820,
        180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ad95bad5-c4ac-4864-a83c-06d59d99b415",
              "name": "Subject",
              "type": "string",
              "value": "Today's Currency Exchange Rates"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d669298c-ada6-4a7d-a2c9-b45712db0872",
      "name": "发送 WhatsApp 提醒",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1040,
        280
      ],
      "webhookId": "f6576fdd-1b46-4617-ae60-31c4636c38fd",
      "parameters": {
        "textBody": "📈 Today's Currency Exchange Rates – {{ $('Fetch Exchange Rates (CurrencyFreaks)').item.json.data }}  Base: INR  USD:  {{rate}} EUR:  {{rate}} CAD:  {{rate}} AUD:  {{rate}} CNY:  {{rate}}  — Auto-sent by FX Update Bot",
        "operation": "send",
        "phoneNumberId": "=+919994448855",
        "additionalFields": {},
        "recipientPhoneNumber": "+919876567854"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "b0PxTDPdWzznWnfG",
          "name": "WhatsApp-test "
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1c770554-e541-4905-8a0a-eb21610faf23",
      "name": "发送邮件警报",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1040,
        80
      ],
      "webhookId": "d0c3ff03-3c95-4d34-b6a2-1c8594fb080b",
      "parameters": {
        "text": "=📈 Today's Currency Exchange Rates – {{ $('Fetch Exchange Rates (CurrencyFreaks)').item.json.data }}\n\nBase: INR\n\nUSD:  {{rate}}\nEUR:  {{rate}}\nCAD:  {{rate}}\nAUD:  {{rate}}\nCNY:  {{rate}}\n\n— Auto-sent by FX Update Bot\n",
        "options": {},
        "subject": "={{ $('Create Message Subject & Body').item.json.Subject }}",
        "toEmail": "={{ $('Set Email & WhatsApp Recipients').item.json.Email_id }}",
        "fromEmail": "xyz@gmail.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3b5b384c-884d-4e0b-99eb-f0b7ea5deef0",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        0
      ],
      "parameters": {
        "width": 180,
        "height": 340,
        "content": "每天在固定时间(例如,上午 7 点 IST)触发工作流,以获取并发送更新的汇率。"
      },
      "typeVersion": 1
    },
    {
      "id": "761c84ed-715e-47e0-afb4-d24473808431",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 180,
        "height": 340,
        "content": "在手动节点中定义您的 API 密钥和目标货币(INR、CAD、AUD、CNY、EUR、USD),以便在 API 调用中使用。"
      },
      "typeVersion": 1
    },
    {
      "id": "c09a6a8a-878c-4372-9441-4c4baca49a82",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        0
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 340,
        "content": "使用您的 API 密钥调用汇率 API,并以 INR 为基础获取最新货币汇率。"
      },
      "typeVersion": 1
    },
    {
      "id": "0d97f12f-5fae-4bc4-a01e-b30438b6140d",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 180,
        "height": 340,
        "content": "添加短暂延迟以确保遵守 API 速率限制并维持系统稳定性。"
      },
      "typeVersion": 1
    },
    {
      "id": "64caf21b-c1ee-4e7c-a798-a8a9178b89fc",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        0
      ],
      "parameters": {
        "width": 180,
        "height": 340,
        "content": "设置应接收货币更新的电子邮件地址和 WhatsApp 号码列表。"
      },
      "typeVersion": 1
    },
    {
      "id": "e562a8fb-b41b-4d7f-8c23-c7bffb596410",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        0
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 340,
        "content": "动态生成主题行(例如,“今日货币汇率 – {{日期}}”)和包含所有汇率的文本正文。"
      },
      "typeVersion": 1
    },
    {
      "id": "41ac52db-46d3-4d7f-86d3-709ee41fc6f1",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1000,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 600,
        "content": "通过电子邮件和 WhatsApp 发送格式化的货币汇率更新"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "01ad1e77-4366-41bc-a9b6-43551d7e9a83",
  "connections": {
    "Wait for API Response (5s)": {
      "main": [
        [
          {
            "node": "Set Email & WhatsApp Recipients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Trigger (7:30 AM IST)": {
      "main": [
        [
          {
            "node": "Set Config: API Key & Currencies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Message Subject & Body": {
      "main": [
        [
          {
            "node": "Send WhatsApp Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Email Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Email & WhatsApp Recipients": {
      "main": [
        [
          {
            "node": "Create Message Subject & Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Config: API Key & Currencies": {
      "main": [
        [
          {
            "node": "Fetch Exchange Rates (CurrencyFreaks)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Exchange Rates (CurrencyFreaks)": {
      "main": [
        [
          {
            "node": "Wait for API Response (5s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 加密货币交易

需要付费吗?

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

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

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

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部链接
在 n8n.io 查看

分享此工作流