Asana Automation of Due Dates of Dependant Subtasks using Tray.io

My team uses subtasks heavily in Asana and was looking to automate adjusting the due date when one subtask is delayed. I built a quick demo automation using Tray.io which adds 2 days between linked tasks or subtasks. Asana has built-in features for doing this with tasks, but it doesn’t work with subtasks. This solution should also work with tasks between projects, if desired.

For this demo, if a task or subtask has its dueon value changed, all dependent tasks will get a new due date of two days later. I was really glad to see that the Asana API call does trigger the webhook to fire, so it is recursive by default. Any chain-dependencies will fire in turn, and the change will cascade down the line, albeit slowly. Next steps are to meet with the team and understand their requirements better. I should accommodate for due_on vs due_at and also for a date range. As described in the video, I might add a custom field for “how many days does this subtask take” so the team won’t need to use a date range. I really don’t recommend this for level-of-effort tracking, I’d strongly suggest using story points instead, but I think an estimate of days might make this more user-friendly for the team.

I also need to add code to check the gid received from the Asana webhook is in fact a task or subtask. It’s probably possible to get other types of gid objects from the webhook. I might exclude tasks and only update subtasks for this team, I might add logic to update the overall task due date based on a specific subtask title, and/or I might update the due date of some or all subtasks based on the due date of the parent task. We are managing an editorial calendar, so your needs may different. Even though Asana Rules don’t allow automation on subtasks or detailed triggers, the Asana API and Asana Webhooks have a ton of hidden functionality!

MAJOR potential pitfall: it is possible to have an infinite loop of dependencies in Asana! Task A can block B, Task B can block C, and Task C can block A. If you do that in Asana, it won't be possible to mark any of the tasks as complete, but it would mean that if triggered, this automation script would run forever! I used the automation platform Tray.io, but that isn't required.

You could probably set this up to run off a Raspberry Pi running as a home server. The Asana API documentation explains how to setup a webhook and how to update a task. Tray.io makes setting up and modify an Asana webhook extremely easy.