Skip to content

Slack Message

⚠️ DEPRECATION WARNING

This component is deprecated and will be removed in a future version of Nappai. Please migrate to the recommended alternative components.

The Slack Message component lets you post a text message, optionally with media, to a Slack channel using a Slack App OAuth token. It’s a quick way to send alerts, notifications, or updates directly from your Nappai workflow to Slack.

How it Works

When you run the component, it takes the following steps:

  1. Read the inputs – the message text, optional media file, and the channel name.
  2. Use the stored Slack OAuth token – the token is provided through a credential you set up in Nappai’s Credentials section.
  3. Call Slack’s API – the component uses the SlackWrapperApi helper to send a POST request to the chosen channel, attaching any media file if supplied.
  4. Return a Message object – the component outputs a Message that contains the text you sent (and the media text if available). This output can be used by other components in your workflow.

Inputs

Credential
This component requires a Slack bot API credential.

  1. In Nappai, go to Credentials and add a new credential of type Slack bot API.
  2. Sign in to Slack API and copy the Slack bot App token (e.g., <APP_OAUTH_TOKEN>).
  3. Save the credential and select it in the component’s Credential field.

Input Fields

  • Media files: Media files to be uploaded.
  • Channel Name: The name of the Slack channel where the message will be posted.
  • Input: The text of the message you want to send.

Outputs

  • Slack Message: A Message object containing the text that was sent (and any media text if provided). This can be used as input to other components or for logging.

Usage Example

  1. Add the Slack Message component to your workflow.
  2. Configure the credential as described above.
  3. Set the Channel Name to the channel you want to post to (e.g., #alerts).
  4. Enter the message text in the Input field, e.g.,
    New order received: Order #12345
  5. (Optional) Drag a File component into the Media files slot to attach an image or PDF.
  6. Run the workflow – the message will appear in the chosen Slack channel.
  • Slack Channel List – Retrieves a list of channels for use in dropdowns.
  • Slack File Upload – Uploads files to Slack without sending a message.

Tips and Best Practices

  • Test in a dedicated channel first to avoid cluttering important channels.
  • Keep the OAuth token secure by storing it in Nappai’s credential store, not in plain text.
  • Use concise messages; Slack truncates very long messages.
  • Attach media only when necessary to keep notifications clear.

Security Considerations

  • The OAuth token is stored in Nappai’s credential system; ensure only authorized users can view or edit it.
  • Avoid logging the token or any sensitive data in workflow logs.
  • Use the component in a workflow that runs with the least privilege necessary for the task.