Slack, the popular workplace communication platform, is winning hearts worldwide. However, its usage shouldn’t be limited to communications alone. There is more you can do with powerful integrations with other applications.
We used our product, “Orkes Conductor,” to automate our daily tasks in Slack. At Orkes, we solved two of our biggest challenges. We created our engineering teams' standup bot & our community channel’s welcome message through effective Slack integrations using Orkes Conductor.
In this blog post, we’ll have a walkthrough on how you can create a standup bot for posting daily updates on a Slack channel using Orkes Conductor. Orkes Conductor is a powerful orchestration platform for building distributed applications that makes it easy to incorporate integrations such as Slack in your applications seamlessly.
Let’s see how Orkes Conductor can be leveraged to build your standup bot.
Here is the overview of our standup bot:
Boom! You’re done with the updates! 🤖
No more messing up with wrong channels; and the managers need not worry about missing the updates.
Let’s have a sneak peek at the most essential steps in building your Standup bot.
Let’s visualize the workflow.
You can get the JSON file for the workflow here.
In this example, we have 2 users. They are the forks of a fork-join task. These forks run in parallel to complete the workflow. For each individual, a fork is to be added, where each fork includes a sub-workflow, which is nothing but incorporating another workflow within your main workflow.
Here’s how the workflow added as sub-workflow (individual_updates) looks like:
You can get the JSON file for the workflow here.
When the main workflow is run, all the forks execute in parallel. So let’s see how each of the individual updates is processed.
workflow.secrets.slack_standup_token
workflow.secrets.slack_conductor_channel_url
You can add the above workflow as sub-workflows in the fork-join tasks depending on the number of employees in your team.
In addition, you can configure the main workflow so that all the sub-workflows added as forks can be marked as optional so that the workflow can complete without waiting for all the forks. This comes into use when employees are OOO, so their updates won’t be available.
If you want to collect all the updates within a certain time, such as, let’s say, within 3 hours, you can add a timeout for the individual_updates workflow of 10,800 seconds.
You have seen that a webhook task is utilized to collect user updates. You need to create a Webhook inside Orkes Conductor by navigating to the Webhooks option from the left menu and choosing the platform as “Slack”. Choose the standup bot workflows created in the previous step. Now, a Webhook URL will be generated.
The workflow should be scheduled to run at the standup time. Suppose the standup time set by your organization is 10:00 AM PT every Mon-Fri. You can create a scheduler in the Conductor that ensures the workflow runs at the scheduled time.
A Scheduler can be created from your Conductor console by navigating to Scheduler > Definitions and providing the following CRON expression.
This ensures that the workflow runs at 10:00 AM PT every Mon-Fri. The UI also displays the local browser time. While creating the scheduler, ensure to choose the workflow name & the corresponding version to be scheduled.
Sample JSON for the scheduler is as follows:
{
"name": "standup",
"cronExpression": "0 0 17 * * MON-FRI",
"startWorkflowRequest": {
"name": "standup_updates_main",
"version": "1",
"input": {}
}
}
Next, you must create a Slack App to integrate with your company’s Slack account. For this, navigate to https://api.slack.com/apps & click Create an App.
Next, we must install this Slack app in your organization’s workspace.
Once the app is installed in your workspace, a Bot User OAuth Token will be generated. This is to be added as a secret in Conductor.
If you want to try this in your Slack workspace, create the secrets with your values in your Conductor console.
Have a look at the following images for a better understanding of where you can get these values:
{
"name": "riza_updates",
"taskReferenceName": "riza_updates",
"inputParameters": {
"user_name": "Riza",
"user_id": "XXXXXXXXXX"// Go to Slack > View the profile > Click on three dots > Copy member ID
},
"type": "SUB_WORKFLOW",
Let’s execute the workflow and see how it runs. In the actual example, the workflow would be automatically triggered during the standup time.
So, the workflow is now waiting for the user’s update. Once the users open their Slack, they can see that the bot app has requested the update from the user.
Once the updates are posted, the user must send done
towards the end. Instantly, the message would be posted on the standup channel.
On checking the workflow execution, you can see that the fork of this particular user is completed and is waiting for the updates from the other user. Once the second user posts the updates, the workflow gets completed.
And we‘re done!
Here’s a video guide for the standup bot example:
We have successfully overcome one of our daily obstacles using powerful Conductor-Slack integration. Do you have similar challenges to be addressed? Orkes Conductor, built on the battle-tested Netflix Conductor, can help!
Orkes Conductor, the powerful orchestration platform, offers the cloud version of Netflix Conductor in all major cloud providers, including AWS, Azure & GCP.
If you require any assistance or have any inquiries, please don't hesitate to contact our team on Community Slack. We are always available to support you with your requirements.
Meanwhile, if you want to try Conductor for free, leverage Orkes Developer Edition, a free developer sandbox.
If you find the experience valuable, we would greatly appreciate it if you could give us a 🌟 on our Conductor repository!