Slack Dash Trigger icon

Slack Dash Trigger

Triggers workflow when a Slack slash command is invoked via Socket Mode.

Overview

This node triggers an n8n workflow when a Slack slash command is invoked via Slack's Socket Mode. It listens for specific or any slash commands issued in Slack and emits the command data to the workflow, enabling automation based on user interactions within Slack.

Common scenarios include:

  • Automating responses or actions when users enter custom slash commands in Slack.
  • Integrating Slack commands with other systems, such as creating tickets, sending notifications, or updating databases.
  • Building interactive Slack apps that react instantly to user commands without needing HTTP endpoints.

For example, if you configure the node to listen for /mycommand, whenever a user types /mycommand in Slack, this node will trigger and pass the command details into your workflow for further processing.

Properties

Name Meaning
Slash Command The full slash command to listen for (e.g., /mycommand). Leave empty to listen for any command.

Output

The node outputs JSON data containing details about the triggered slash command event. The output includes:

  • command: The exact slash command string invoked.
  • body: The full body of the Slack event payload.
  • context: Contextual information related to the Slack event.
  • payload: The raw payload received from Slack for the slash command.

This structured JSON allows workflows to access all relevant information about the command invocation for customized handling.

The node does not output binary data.

Dependencies

  • Requires a Slack app configured with Socket Mode enabled.
  • Needs credentials including a bot token, signing secret, and app-level token for authentication with Slack.
  • Uses the official Slack Bolt SDK for Node.js to manage the Socket Mode connection and event handling.

Troubleshooting

  • Slack App Not Initialized: If the node is manually triggered before activation, it may throw an error indicating the Slack app is not initialized. Ensure the workflow is activated first.
  • Error Starting Socket App: Issues starting the Slack Socket Mode app can occur due to invalid credentials or network problems. Verify that the provided tokens are correct and have necessary permissions.
  • No Events Emitted: If no events are emitted, check that the slash command name is correctly specified or left empty to listen for all commands. Also confirm the Slack app has the slash command properly registered.
  • Acknowledgement Failures: Errors acknowledging Slack events are logged but do not stop the workflow. These usually indicate communication issues with Slack and may require checking network connectivity or Slack app configuration.

Links and References

Discussion