跳转至

6. 通知团队#

在工作流的这一步中,您将学习如何使用Discord节点向Discord频道发送消息。在这一步骤之后,您的工作流应该如下所示:

现在您已经计算了已预订订单的摘要,您需要在Discord频道中通知Nathan的团队。对于这个工作流,您将向Discord上的n8n服务器发送消息。

在开始下面的步骤之前,请使用上面的链接连接到Discord上的n8n服务器。确保您可以访问#course-level-1频道。

Communication app nodes

You can replace the Discord node with another communication app. For example, n8n also has nodes for Slack and Mattermost.

In your workflow, add a Discord node connected to the Code node.

When you search for the Discord node, look for Message Actions and select Send a message to add the node.

In the Discord node window, configure these parameters:

  • Connection Type: Select Webhook.
  • Credential for Discord Webhook: Select - Create New Credential -.
    • Copy the Webhook URL from the email you received when you signed up for this course and paste it into the Webhook URL field of the credentials.
    • Select Save and then close the credentials dialog.
  • Operation: Select Send a Message.
  • Message:
    • Select the Expression tab on the right side of the Message field.
    • Copy the text below and paste it into the Expression window, or construct it manually using the Expression Editor.
      1
      This week we've {{$json["totalBooked"]}} booked orders with a total value of {{$json["bookedSum"]}}. My Unique ID: {{ $('HTTP Request').params["headerParameters"]["parameters"][0]["value"] }}
      

Now select Execute step in the Discord node. If all works well, you should see this output in n8n:

Discord node output
Discord node output

And your message should appear in the Discord channel #course-level-1:

Discord message
Discord message

What's next?#

Nathan 🙋: Incredible, you've saved me hours of tedious work already! Now I can execute this workflow when I need it. I just need to remember to run it every Monday morning at 9 AM.

You 👩‍🔧: Don't worry about that, you can actually schedule the workflow to run on a specific day, time, or interval. I'll set this up in the next step.

此页面是否
💬 微信

🚀 与作者交流

关注公众号
n8n实战笔记公众号
n8n实战笔记
📚 教程 💡 案例 🔧 技巧
添加微信
添加作者微信
1对1 专业指导
⚡ 快答 🎯 定制 🚀 支持