March 4, 2020 By Kazuki Nobutani 3 min read

Part 4 of a four-part series. In this post, we are going to register a bot in Slack and connect to the endpoint in Node-RED.

Step 1. Create an app (bot) on Slack

  1. Go to https://api.slack.com/apps.
  2. Click Create New App, and set the name and workspace to install.

    Note: It requires an approval from the workspace admin.

Step 2. Add Slash command

  1. Once the app is created, go to Features > Slash Commands.
  2. Click Create New Command.
  3. Define the command detail and Save. Make sure your command does not overlap with an existing command. Then, Request URL is going to be: https://<your_node_red>/talk. This time, I’ve named the commands as follows:
    • /talktest for starting the conversation
    • /cleartest for clearing the current conversation
  4. Go to Basic Information and click Request to Install. Then, Save Changes. The request will go to the admin of the workspace and they need to approve it. 

Step 3. Test the integration

Once the request is approved, we are all set. Let’s initiate the conversation by entering the command. The slash command can be executed anywhere on the workspace, and the responses are only visible to you. 

  1. Enter the slash command and hit enter.
  2. In order to continue the conversation, enter the command before your input.
  3. In order to reset the conversation, execute the clear command.

What’s next?

Now, you know how we can create a chatbot using watsonx Assistant and Node-RED. This time we integrated with Slack, but you can connect to your own apps or any other service that can access the endpoint we created on Node-RED. We hope you got the idea and apply what we’ve done in this series. Here are some “next steps” you can consider.

  • Node-RED visualizes the flow, but it is not suitable for production use. Switch to Node.js for better load balancing and precise controls.
  • Integrate with other services, such as text-to-speech, tone analyzer and any other nodes you can import to your Node-RED.

If you encounter any technical difficulties with services on IBM Cloud, feel free to contact at the Support Center

Disclaimer

IBM is not liable for any damages arising in contract, tort or otherwise from the use of or inability to use this post or any material contained within. All sample code is provided as-is and IBM does not support customization. Do not use the code in production. 

Was this article helpful?
YesNo

More from Cloud

X-Force report reveals top cloud threats: AITM phishing, business email compromise, credential harvesting and theft

4 min read - As we step into October and mark the start of Cybersecurity Awareness Month, organizations’ focus on protecting digital assets has never been more important. As innovative new cloud and generative AI solutions help advance today’s businesses, it’s also important to understand how these solutions have added to the complexity of today’s cyber threats, and how organizations can address them. That’s why IBM—as a leading global security, cloud, AI and business service provider—advocates to our global clients to take a proactive…

Top 6 innovations from the IBM – AWS GenAI Hackathon

5 min read - Eight client teams collaborated with IBM® and AWS this spring to develop generative AI prototypes to address real-world business challenges in the public sector, financial services, energy, healthcare and other industries. Over the course of several weeks, cross-functional teams comprising client teams, IBM and AWS representatives worked to design, develop and iterate on prototypes that push the boundaries of what's possible with generative AI. IBM used design thinking and user-centric approach to guide the teams throughout the hackathon. AWS provided…

IBM + AWS: Transforming Software Development Lifecycle (SDLC) with generative AI

7 min read - Generative AI is not only changing the way applications are built, but the way they are envisioned, designed, tested, documented, and deployed. It’s also revolutionizing the software development lifecycle (SDLC). IBM and AWS are infusing Amazon Bedrock generative AI capabilities into the IBM® SDLC solution to drive increased efficiency, speed, quality and value in every application lifecycle consistently and at scale. The evolution of the SDLC landscape The software development lifecycle has undergone several silent revolutions in recent decades. The…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters