WorkflowOtherOpen

n8n Subworkflow Dependency Graph & Auto-Tagging

Triggered on a schedule. Connects Aggregate, Code, Condition, Filter, HTTP request, Loop, N8N, Quick Chart. n8n Subworkflow Dependency Graph & Auto-Tagging The script builds a dependency graph of workflows by identifying which workflows call others (via execution nodes) while preserving workflow names, caller relationships, and tags. Here we filter out any workflows that are not [sub-workflows]({{

Front matter
name: n8n Subworkflow Dependency Graph & Auto-Tagging
description: Triggered on a schedule. Connects Aggregate, Code, Condition, Filter, HTTP request, Loop, N8N, Quick Chart. # n8n Subworkflow Dependency Graph & Auto-Tagging The script builds a dependency graph of workflows by identifying which workflows call others (via execution nodes) while preserving workflow names, caller relationships, and tags. Here we filter out any workflows that are not [sub-workflows]({{ $env.WEBHOOK_URL }} (i.e. executed by other workflows). We verify that the sub-workflows we intend to tag exist in our instance (not old workflow ids left over after importing a workflow from another insta
category: Automation
kind: Workflow
software: Aggregate|Code|Condition|Filter|HTTP request|Loop|N8N|Quick Chart|Respond To Webhook|Schedule|Split Out|Webhook

n8n Subworkflow Dependency Graph & Auto-Tagging

Triggered on a schedule. Connects Aggregate, Code, Condition, Filter, HTTP request, Loop, N8N, Quick Chart. # n8n Subworkflow Dependency Graph & Auto-Tagging The script builds a dependency graph of workflows by identifying which workflows call others (via execution nodes) while preserving workflow names, caller relationships, and tags. Here we filter out any workflows that are not [sub-workflows]({{ $env.WEBHOOK_URL }} (i.e. executed by other workflows). We verify that the sub-workflows we intend to tag exist in our instance (not old workflow ids left over after importing a workflow from another insta

Steps

  • Update workflow tags (httpRequest)
  • GET all workflows (n8n)
  • List callers of subworkflows (code)
  • Exclude uncalled workflows (filter)
  • Exclude missing workflows (filter)
  • And every Sunday (scheduleTrigger)
  • When this workflow is activated (n8nTrigger)
  • GET workflow(s) (n8n)
  • Count callers and identify new callers (set)
  • Loop through workflows (splitInBatches)
  • GET all tags (httpRequest)
  • Remove existing tags from new_callers list (set)
  • If any new callers (if)
  • Split out new callers as new tags (splitOut)
  • Create new tags (httpRequest)
  • Return original pass through values (code)
  • Merge (merge)
  • GET all tags again (httpRequest)
  • Create tag id:name dictionary (set)
  • Retrieve tag ids and names from dictionary (set)
  • Return dependency graph data (set)
  • Combine dependency graph values into labels (aggregate)
  • Visualize subworkflow dependency graph (quickChart)
  • Sticky Note (stickyNote)
  • Sticky Note1 (stickyNote)
  • Sticky Note2 (stickyNote)
  • Sticky Note3 (stickyNote)
  • Sticky Note4 (stickyNote)
  • Sticky Note7 (stickyNote)
  • Sticky Note5 (stickyNote)
  • Sticky Note6 (stickyNote)
  • Sticky Note8 (stickyNote)
  • SET instance_url (set)
  • When viewed in a browser (webhook)
  • Sticky Note9 (stickyNote)
  • Sticky Note10 (stickyNote)
  • Format workflow relationship data for rendering (code)
  • Visualize dependency graph with MermaidJS (respondToWebhook)
  • Sticky Note11 (stickyNote)
  • Sticky Note12 (stickyNote)

Import

Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).

Source: https://github.com/Zie619/n8n-workflows/blob/main/Splitout/1591_Splitout_Code_Automate_Webhook.md

Author: Zie619, n8n workflow collection. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.