In modern development and operations, the speed of communication is just as critical as the speed of execution. While your applications can run automated processes flawlessly, keeping your team in sync often relies on manual updates, context switching, and chasing down information. This disconnect creates friction and slows down the very workflows you've worked so hard to automate.
What if your communication tools were a native part of your automated workflows?
This is where the power of connecting the Tasks.do agentic workflow API with a communication hub like Slack truly shines. By integrating the two, you can transform your Tasks.do instance from a silent executor into a proactive team member that provides real-time updates directly where your team collaborates.
This tutorial will guide you through connecting your automated task management directly to your team's Slack workspace. We'll show you how to trigger real-time notifications for task assignments, progress updates, and completions, turning your operational checklists into a fully transparent, automated service.
Before we dive into the "how," let's explore the "why." Integrating Tasks.do—a platform built on the "Business as Code" philosophy—with Slack isn't just about sending notifications. It's about embedding your operational processes directly into your team's conversational flow.
To follow along with this guide, you will need:
Our goal is to create a small service that acts as a bridge. It will listen for webhook events from Tasks.do and then forward a formatted message to a Slack channel.
First, we need to give our service a way to post messages to Slack.
Now, let's create a simple Node.js server using Express to listen for incoming data from Tasks.do.
First, initialize a new Node.js project and install the necessary packages:
mkdir tasksdo-slack-bridge
cd tasksdo-slack-bridge
npm init -y
npm install express axios
Next, create a file named index.js and set up a basic Express server. This server will have a single endpoint, /webhooks/tasksdo, that will process incoming webhook events.
// index.js
const express = require('express');
const axios = require('axios');
const app = express();
app.use(express.json()); // Middleware to parse JSON bodies
const PORT = process.env.PORT || 3000;
const SLACK_WEBHOOK_URL = 'YOUR_SLACK_WEBHOOK_URL_HERE'; // Replace with your URL from Step 1
// The endpoint that will receive webhooks from Tasks.do
app.post('/webhooks/tasksdo', async (req, res) => {
const { event, data } = req.body;
console.log(`Received event: ${event}`);
// We'll add the logic to send a Slack notification here
res.status(200).send('Webhook received.');
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Make sure to replace YOUR_SLACK_WEBHOOK_URL_HERE with the URL you copied from Slack.
Now, let's build the function that formats our task data into a nice-looking Slack message and sends it. We will use Slack's Block Kit for a richer layout.
Update your index.js file:
// index.js
const express = require('express');
const axios = require('axios');
const app = express();
app.use(express.json());
const PORT = process.env.PORT || 3000;
const SLACK_WEBHOOK_URL = 'YOUR_SLACK_WEBHOOK_URL_HERE';
// Function to format and send the Slack message
const sendSlackNotification = async (taskData) => {
const { title, description, priority, dueDate, assignees, tags } = taskData;
const taskUrl = `https://app.tasks.do/tasks/${taskData.id}`; // Hypothetical URL to the task
const message = {
blocks: [
{
type: 'header',
text: {
type: 'plain_text',
text: `✅ New Task Created: ${title}`,
},
},
{
type: 'section',
fields: [
{ type: 'mrkdwn', text: `*Priority:*\n${priority}` },
{ type: 'mrkdwn', text: `*Due Date:*\n${new Date(dueDate).toDateString()}` },
],
},
{
type: 'section',
text: {
type: 'mrkdwn',
text: `*Description:*\n${description}`,
},
},
{
type: 'context',
elements: [
{ type: 'mrkdwn', text: `*Assignees:* ${assignees.join(', ')}` },
{ type: 'mrkdwn', text: `*Tags:* ${tags.join(', ')}` },
],
},
{
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'View Task in Tasks.do',
},
url: taskUrl,
},
],
},
],
};
try {
await axios.post(SLACK_WEBHOOK_URL, message);
console.log('Slack notification sent successfully.');
} catch (error) {
console.error('Error sending Slack notification:', error.message);
}
};
// The webhook endpoint
app.post('/webhooks/tasksdo', async (req, res) => {
const { event, data } = req.body;
// Trigger notification only for new task creation events
if (event === 'task.created') {
console.log(`Received task.created event for task: "${data.title}"`);
await sendSlackNotification(data);
}
res.status(200).send('Webhook received.');
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
To run this server, you'll need a way for the public internet to reach it. Tools like ngrok are perfect for testing this from your local machine.
The final step is to tell Tasks.do where to send events. Tasks.do's API-first design makes this simple. You would programmatically register your new webhook endpoint to listen for specific events.
While the exact implementation might vary, it would look conceptually like this using the @do-sdk/client:
import { client } from '@do-sdk/client';
// The URL of the listener service we built in Step 2 & 3
// Use your ngrok URL for testing, or your deployed server URL for production.
const webhookUrl = 'https://your-server-or-ngrok-url.com/webhooks/tasksdo';
const newWebhook = await client.webhooks.create({
url: webhookUrl,
description: 'Slack Notifier for Project Updates',
events: [
'task.created',
'task.updated',
'task.completed'
],
});
console.log(`Webhook successfully created with ID: ${newWebhook.id}`);
With this webhook registered, every time a task is created, updated, or completed within your Tasks.do account, an HTTP POST request with the event details will be sent to your listener service, which will then post a beautiful, informative message to your Slack channel.
This integration is just the beginning. You can expand on this foundation to build an even more powerful, interactive system:
By bridging the gap between your automated tasks and your team's communication hub, you elevate your Tasks.do implementation from a simple task runner to a fully integrated, communicative part of your operation. This is the essence of building a true agentic workflow: systems that not only execute but also report, interact, and streamline human collaboration.
Ready to turn your business logic into automated, intelligent services? Explore the Tasks.do API today and start building more connected and efficient workflows.