maestro-automate
latest
false
Maestro Automate 用户指南
- 开始使用
- 构建
- HTTP 请求
- 连接器节点的工作方式
- 创建连接
- 销售和客户关系
- 客户支持和服务台
- 消息传递和会议
- 电子邮件
- 营销
- 社交媒体
- 文件、文档和电子签名
- 项目、协作和代码
- 人员和招聘
- 财务和商业
- AI 模型和智能体
- 语音、视觉和语言
- 数据和位置
- 云、身份和安全性
- 部署并运行
- 示例
- 参考
构建 Slack 通知工作流
逐步构建一个工作流,该工作流使用脚本节点写入消息,并通过 Slack 连接器将其发布到 Slack 频道。
您构建的内容
此工作流根据工作流数据撰写动态 Slack 消息并将其发送到频道。该模式适用于任何触发器,例如已计划的作业、传入的 Webhook 或来自其他系统的事件,并可为任何自动化添加实时通知。
开始之前
使用的节点
步骤
提示:
编码智能体设置后,您可以跳过手动步骤。询问:
Build a Maestro Automate workflow that starts manually with a title and a message, composes a Slack message from them, and posts it to a channel through my Slack connection.
Build a Maestro Automate workflow that starts manually with a title and a message, composes a Slack message from them, and posts it to a channel through my Slack connection.
然后在画布上打开工作流,根据以下步骤进行检查并进行测试。“设置编码智能体”描述了相关设置。
1. 新建工作流并添加触发器
- 按照您的第一个工作流所述创建项目。画布将打开,画布上已有“手动触发器” 。
- 在触发器的属性面板中,为要包含在消息中的每项数据选择“添加输入参数” ,例如
recordName(字符串)和status(字符串)。
2. 撰写消息
- Select the + on the output handle of the Manual Trigger.
- Search for Script, and select it.
- 在代码编辑器中,使用输入变量编写消息文本:
return `✅ Update: *${$vars.manualTrigger1.output.recordName}* is now ${$vars.manualTrigger1.output.status}.\nTriggered at: ${new Date().toISOString()}`;
return `✅ Update: *${$vars.manualTrigger1.output.recordName}* is now ${$vars.manualTrigger1.output.status}.\nTriggered at: ${new Date().toISOString()}`;
- On the Advanced tab of the properties panel, rename the node ID to
formatSlackMessage. Later nodes read the message text as$vars.formatSlackMessage.output.
格式可以遵循团队的约定。Slack 支持消息中的基本 Markdown( *bold* 、 _italic_和\n ,用于换行符)。
3. 添加“Slack 发送消息”节点
- Select the + on the output handle of the Script node.
- In the Add node panel, open the Connector category, and find the Slack connector.
- 选择“发送消息”操作。
- 在“属性”面板中:
- 选择您的 Slack连接。
- 将“频道”设置为应发送消息的频道 ID 或名称(例如
#alerts)。 - 将消息映射到
{{ $vars.formatSlackMessage.output }}。
4. 测试和调试
- 在画布底部工具栏中选择“运行调试”。
- 在触发器对话框中,为
recordName和status输入示例值。 - 运行测试。
运行完成后,请查看 Slack 频道。如果未出现此消息:
- 检查 Slack 连接是否仍处于活动状态,如创建连接所述。
- 检查频道名称。如果出现“未找到频道”错误,以
C开头的频道 ID 比显示名称效果更好。 - 检查执行追踪记录中 Slack 节点的输出,以获取 Slack API 中的任何错误详细信息。
结果
工作流按需启动,根据触发器输入撰写 Slack 消息,并将其发布到配置的频道。执行追踪中的频道和 Slack 节点的输出均确认成功。
扩展此工作流
- 添加条件:在 Slack 节点之前添加一个决策节点,以便仅在满足特定阈值时发送消息(例如,仅在
Failed状态下通知)。 - 替换触发器:将手动触发器替换为集成触发器或计划的触发器,以自动发送通知。
- 发送到多个频道:添加“切换”节点,以根据优先级或团队将消息路由到不同的频道。