- Get started
- Build
- Deploy and run
- Examples
- Reference
Build a Slack notification workflow
Build a workflow step by step that writes a message with a Script node and posts it to a Slack channel through the Slack connector.
What you build
A workflow that composes a dynamic Slack message from workflow data and sends it to a channel. The pattern applies to any trigger, such as a scheduled job, an incoming webhook, or an event from another system, and adds real-time notifications to any automation.
Before you start
- A Slack workspace where you have permission to add an app. Slack describes the connector.
- A Slack connection, which signs UiPath in to your Slack workspace. Create a connection describes how to create one.
Nodes used
- Manual Trigger: starts the workflow on demand, to be replaced with the real trigger later.
- Script: composes the message text dynamically.
- Slack connector node: sends the message to a Slack channel.
Steps
With a coding agent set up, you can skip the manual steps. Ask it:
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.
Then open the workflow on the canvas, check it against the steps below, and test it. Set up your coding agent describes the setup.
1. Create a new workflow and add a trigger
- Create a project, as Your first workflow describes. The canvas opens with a Manual Trigger already on it.
- In the properties panel of the trigger, select Add input argument for each piece of data to include in the message, for example
recordName(string) andstatus(string).
2. Compose the message
- Select the + on the output handle of the Manual Trigger, search for Script, and select it.
- In the code editor, write the message text using your input variables:
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()}`;
- Set Output variable name to
messageText.
The format can follow the team's conventions. Slack supports basic markdown in messages (*bold*, _italic_, \n for line breaks).
3. Add the Slack Send Message node
- Select the + on the output handle of the Script node, open the Connector category of the Add node panel, and find the Slack connector.
- Select the Send message action.
- In the properties panel:
- Select your Slack Connection.
- Set Channel to the channel ID or name where the message should be sent (for example,
#alerts). - Map Message to
{{ $vars.messageText }}.
4. Test and debug
- Select Run Debug (▶) in the bottom toolbar of the canvas.
- In the trigger dialog, enter sample values for
recordNameandstatus. - Run the test.
Check the Slack channel after the run completes. If the message does not appear:
- Check that the Slack connection is still active, as Create a connection describes.
- Check the channel name. The channel ID, which starts with
C, works better than the display name if a "channel not found" error appears. - Inspect the Slack node's output in the execution trace for any error details from the Slack API.
Result
The workflow starts on demand, composes a Slack message from the trigger inputs, and posts it to the configured channel. The channel and the Slack node's output in the execution trace both confirm success.
Extend this workflow
- Add a condition: before the Slack node, add a Decision node to only send the message when a certain threshold is met (for example, only notify on
Failedstatus). - Replace the trigger: swap the Manual Trigger for an integration trigger or a Scheduled Trigger to send notifications automatically.
- Send to multiple channels: add a Switch node to route the message to different channels based on priority or team.
Next steps
- Deploy a workflow: make the workflow run without you.
- Guides: more workflows to build.
- Community: share what you built, or ask other builders for help.