UiPath Documentation
maestro-automate
latest
false
Maestro Automate user guide

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​

Tip:

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​

  1. Create a project, as Your first workflow describes. The canvas opens with a Manual Trigger already on it.
  2. 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) and status (string).

2. Compose the message​

  1. Select the + on the output handle of the Manual Trigger, search for Script, and select it.
  2. 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()}`;
  1. 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​

  1. Select the + on the output handle of the Script node, open the Connector category of the Add node panel, and find the Slack connector.
  2. Select the Send message action.
  3. 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​

  1. Select Run Debug (▶) in the bottom toolbar of the canvas.
  2. In the trigger dialog, enter sample values for recordName and status.
  3. 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 Failed status).
  • 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​

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated