Awork Task Dependency and Subtask Completion Enforcer - n8n Workflow

Use this n8n workflow to ensure Awork tasks cannot be marked complete until all dependencies and subtasks are finalized. Automated status rollback and commenting.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Project managers relying on strict task order in Awork.
Development teams using Awork for granular dependency tracking.
Organizations seeking reliable n8n templates for custom task management automation.
Users looking for advanced n8n workflow solutions to overcome platform API limitations.

Overview

This robust automation provides a crucial workaround for limitations in the Awork platform, which currently lacks native enforcement for task dependencies and subtask completion before a parent task can be marked 'done'. This detailed n8n workflow monitors task status changes via a webhook. When a user attempts to set a task to a 'done' state, the n8n automation instantly verifies if all required preceding tasks (dependencies) or child tasks (subtasks) are also complete.

If any prerequisites are still open, the n8n workflow automatically rolls the task status back to its previous, unfinished state. This utilizes custom logic and the HTTP Request n8n node to interact directly with the Awork API. Furthermore, it uses the configuration settings within the n8n node structure to optionally add a detailed comment to the task, informing the user exactly why the status change was undone. This ensures accountability and maintains data integrity within your project task management system.

How it Works

The process begins with the Webhook call by Awork n8n trigger, which activates whenever a task status changes in Awork.


  1. Configuration Check: The workflow first runs through the Workflow config n8n node to load user-defined settings, such as which labels count as 'finished,' whether to check dependencies (useDependencies), and whether to check the tree structure (useTreeStructure).

  2. Status Identification: It isolates the task status change property using the Split out task changes n8n node and filters to ensure the event is indeed a status change where the new status is marked as 'done' (using the conditions defined in the Check if task done n8n node).

  3. Dependency Validation: If enabled, the n8n workflow uses an HTTP Request n8n node (Load dependencies for task) to fetch all predecessor IDs. A custom Code n8n node formats these IDs, allowing the workflow to query Awork for the current status of all linked tasks. If the Check if open tasks exist n8n node finds any uncompleted dependencies, it triggers the rollback sequence.

  4. Subtask Validation: If dependencies pass (or are disabled), the flow proceeds to check the tree structure. The workflow verifies if the task has any subtasks (Check subtasks). If so, it uses an HTTP Request to load all subtasks not marked as 'done' (Load all open sub tasks). If any are found, the Check open subtasks n8n node initiates the rollback.

  5. Automated Rollback: Upon detecting incomplete prerequisites, the core logic executes the Roll back task status HTTP Request n8n node. This API call reverts the task status back to the original value (old status) captured in the initial webhook payload.

  6. User Notification: Finally, if configured, the workflow uses an If n8n node (Check if comments are enabled) to decide whether to add a clarifying comment (Add comment to tasks) explaining the automated status reversal. This comprehensive n8n template ensures accurate project management.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON into your self-hosted or cloud n8n instance using the 'New > Import from JSON' option.

  2. Webhook Setup: The Webhook call by Awork n8n trigger uses a unique path. Save and activate the workflow, then copy the Production Webhook URL.

  3. Awork Configuration: In Awork, set up a new webhook to fire on Task Status Changes, pointing to the n8n URL you copied. Enabling 'Only events from first level properties' is recommended.

  4. Awork Credentials: All HTTP Request n8n node steps require authentication.

Generate a new API key in Awork.
In n8n, create a new 'HTTP Header Auth' credential (e.g., 'Awork Api').
Set the Name field to Authorization and the Value field to Bearer XXX, replacing XXX with your Awork API key.
Apply this credential to all relevant HTTP Request n8n node instances in the workflow.

  1. Workflow Customization: Open the Workflow config n8n node and adjust parameters like finishedStateLabels (if your 'done' status uses different terminology) and the boolean flags (useDependencies, useTreeStructure) to fit your needs.

Node Details

Webhook call by Awork (n8n trigger): The entry point for this n8n template. It receives POST data from Awork upon any task status change.
Workflow config (Set n8n node): Defines user-configurable parameters crucial for the execution of the n8n workflow, including custom finished labels, toggles for dependency checks, and the text for rollback comments.
Filter task status change (Filter n8n node): Uses a strict filter to ensure the workflow proceeds only if the property changed in Awork was the TaskStatusId.
Load dependencies for task (HTTP Request n8n node): Communicates with the Awork API to retrieve all prerequisite tasks necessary for the current task to be completed.
Build filter params (Code n8n node): A custom n8n node that transforms the raw list of dependency IDs into the OData filter format required for querying the Awork API efficiently.
Roll back task status from done to previous state (HTTP Request n8n node): The core action, which utilizes the Awork changestatuses endpoint to revert the task status ID to the old status captured by the n8n trigger.
Load all open sub tasks (HTTP Request n8n node): Queries the Awork API using filter parameters (parentid eq guid'...' and taskstatus/type ne 'done') to identify any incomplete subtasks linked to the parent task.
Check if open tasks exist (If n8n node): A conditional logic n8n node that checks if the list of uncompleted dependencies or subtasks is non-empty, determining whether the rollback must occur.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Gregor
Gregor

Featured*