Sync Wrike task hierarchy recursively

Recipe ToolsProject ManagementMarketing

What it does

When someone calls this function, this automation retrieves a Wrike task and processes all nested subtasks at each level. It logs details throughout and calls itself to handle deeper hierarchy levels.

Who it's for

Operations teams who need to sync complex Wrike task hierarchies across systems without manual intervention.

How teams use this

Sync a multi-level project structure

Retrieve a Wrike project task with all nested subtasks and sync each level in real time. The automation handles any depth of nesting without manual steps.

Mirror Wrike hierarchy to another system

Use the recursive function to pull Wrike task trees and feed them into a downstream system. Only the custom action target changes while the recursion logic stays the same.

Filter subtasks by status before syncing

Add a condition to check task status at each level so only active or pending subtasks are processed. Include a status filter in the custom action to narrow the scope.

How it works

  1. Receive the task ID. A real-time function call passes a Wrike task ID to start the recursive sync process.
  2. Fetch the task and subtasks. Get task by ID in Wrike retrieves the task details and its list of subtasks from Wrike.
  3. Process each subtask level. For each subtask found, log the task data to the job report and run a custom action in Wrike to sync that subtask.
  4. Recurse into nested subtasks. When subtasks exist, call Copy rekursiv asynchronously to process the next level down in the task hierarchy.
  5. Return the result. Once all levels are processed, return the final result to the caller.