Route Slack commands to custom code and reply

BotsArtificial IntelligenceSales EnablementRecipe ToolsDeveloper ToolMarketing

What it does

When someone mentions Workbot in Slack with a command, this automation processes that command through custom code and posts the result back to the channel. The reply confirms the command was received and executed.

Who it's for

Operations teams who need to run custom logic from Slack without leaving the conversation.

How teams use this

Transform usernames from Slack commands

Run a Slack Workbot mention command that passes a username to custom code, which reformats it and posts the result back to the channel. The team gets the transformed value without leaving Slack.

Extend the command to handle multiple fields

Add more variable steps to capture additional fields from the command, then pass all of them to the Ruby code for processing. The reply includes all transformed values.

Route commands to a different team channel

Point the same automation to a different Slack channel so another team can issue the same Workbot mention command and get results in their workspace.

How it works

  1. Receive the Slack Workbot mention command. Someone mentions Workbot in a Slack channel or direct message with a command. The automation captures the command text in real time.
  2. Transform the username format. Execute Ruby code to change the username format from the command so it matches the expected output structure.
  3. Post the command reply. Reply in the same Slack conversation as Workbot so the channel sees the command was processed and the result.