## Introduction
Modern startup teams and operations specialists heavily rely on project management tools like Asana to keep track of task progress and team productivity. One valuable feature of Asana is task completion alerts—automatic notifications sent to team members when tasks are completed. However, Asana’s notification features come at a recurring cost and sometimes lack the flexibility for highly customizable alerts.
This tutorial explains how to build a robust, customizable task completion alert system using n8n, the powerful open-source automation tool. By integrating your Asana account (or any alternative project management tool with an API) with communication apps like Slack and email, you can replicate and extend Asana’s task completion notifications, saving subscription costs and gaining more control.
### Who Benefits?
– Startup teams looking to reduce SaaS spend
– Automation engineers needing customizable alerts
– Operations specialists wanting integration flexibility
## Tools and Services Integrated
– n8n Automation Platform (self-hosted or cloud)
– Asana API (for detecting task completions)
– Slack (for team notifications)
– Gmail or SMTP Mail (for email alerts)
—
## Technical Tutorial: Building Your Task Completion Alert Workflow
### 1. Prerequisites
– An n8n instance accessible with proper credentials
– An Asana account and Personal Access Token to access the Asana API
– Slack workspace and bot token
– Gmail account or SMTP details for sending email alerts
– Basic knowledge of REST APIs and n8n interface
### 2. Understanding the Problem
Asana sends task completion notifications via its own channels. Your goal is to:
– Automate monitoring Asana tasks for completion events
– Send notifications to your Slack channel and/or email
– Customize who receives what and when
– Reduce dependency on Asana’s native notification system and avoid licensing costs
### 3. Overview of the Workflow
**Trigger:** Poll Asana for recently completed tasks periodically.
**Processing:** Filter tasks that have been marked as completed since the last check.
**Notification:** Send alerts to Slack channels and/or email recipients with task details.
**Output:** Notifications arrive on Slack and/or email informing the team about completed tasks.
—
### 4. Step-by-Step Node Breakdown
#### Step 1: Cron Trigger Node
– Purpose: Periodically trigger the workflow, e.g., every 5 minutes.
– Configuration: Set to repeat on your desired schedule.
#### Step 2: HTTP Request Node to Asana API
– Purpose: Fetch recently completed tasks.
– Configuration:
– Method: GET
– URL: `https://app.asana.com/api/1.0/tasks?completed_since=now&workspace=
– Headers: `Authorization: Bearer
– Query Parameters: Adjust `completed_since` to retrieve tasks completed since the last run.
**Tip:** Store the timestamp of the last successful run in n8n’s workflow or an external database to avoid duplicate notifications.
#### Step 3: Function Node – Filter Newly Completed Tasks
– Purpose: Compare retrieved tasks with last run timestamp and filter only new completions.
– Configuration: Write JavaScript code to check task completion time and filter accordingly.
#### Step 4: Slack Node (Send Message)
– Purpose: Notify the team in a Slack channel about the completed tasks.
– Configuration:
– Authentication: Slack bot token credentials
– Channel: Target channel ID or name
– Message: Format a message with task name, link, and completion time.
#### Step 5: Email Node (SMTP or Gmail)
– Purpose: Send email notifications about task completions.
– Configuration:
– SMTP or Gmail credentials
– Recipient(s): Team email addresses
– Subject and Body: Include task details
#### Step 6: Set Node or Function Node – Update Last Run Timestamp
– Purpose: Save the timestamp of the latest task completion processed.
– Persistence: Use n8n’s workflow variables or external storage.
—
### 5. Implementing the Workflow in n8n
1. **Create a new workflow in n8n.**
2. **Add a Cron Trigger:** Configure to run at your desired interval.
3. **Add HTTP Request Node:** Configure to query Asana API for tasks completed since the last timestamp.
4. **Add a Function Node:** Filter new tasks, format data, and prepare for notifications.
5. **Add Slack Node:** Connect and send formatted messages.
6. **Add Email Node:** Send detailed notifications via email.
7. **Add a Set or Function Node:** Update the last run timestamp for next polling.
8. **Test the workflow thoroughly.**
—
### 6. Common Errors and Tips
– **API Rate Limits:** Respect Asana API rate limits by adjusting polling frequency.
– **Authentication Failures:** Ensure your Asana, Slack, and email credentials are valid and refreshed.
– **Duplicate Notifications:** Use persistent storage or n8n’s workflow data to keep track of processed tasks.
– **Error Handling:** Add error workflow or trigger Slack alerts on workflow failure.
– **Time Zones:** Normalize time zones when comparing timestamps.
—
### 7. Scaling and Adaptation
– **Multi-user Support:** Modify the workflow to monitor tasks across multiple Assignees or projects.
– **Additional Channels:** Integrate other communication platforms (e.g., Microsoft Teams, SMS).
– **Task Metadata:** Include task comments or attachments in notifications.
– **Custom Filters:** Alert only for high-priority tasks or critical projects.
## Summary
By leveraging n8n’s flexible automation capabilities and open APIs, you can rebuild Asana’s task completion alert feature economically and tailor notifications exactly to your team’s needs. This reduces reliance on costly project management SaaS plans while gaining a highly customizable, transparent automation layer.
**Bonus Tip:** Combine this setup with other n8n workflows, such as creating onboarding task reminders or daily summaries, to build a fully automated task management ecosystem.