n8n Subworkflow Dependency Graph & Auto-Tagging

This workflow automatically analyzes and constructs a dependency graph between workflows, helping users identify the callers of sub-workflows and automatically tagging them. Through visual charts, users can intuitively understand the call frequency and structure between workflows, reducing maintenance costs and preventing operational errors. At the same time, this workflow is suitable for teams and enterprises managing complex automation processes, enhancing workflow management efficiency and ensuring the stability and healthy development of processes.

Tags

n8n workflowdependency graph

Workflow Name

n8n Subworkflow Dependency Graph & Auto-Tagging

Key Features and Highlights

This workflow automatically analyzes all workflows within an n8n instance to identify and construct a subworkflow dependency graph, illustrating which workflows invoke which subworkflows. Additionally, it auto-tags subworkflows with labels corresponding to their callers, enabling users to clearly understand the invocation relationships between workflows. The workflow also provides visualization of the dependency graph and call frequency distribution through MermaidJS diagrams and pie charts for intuitive insights.

Core Problems Addressed

In complex n8n automation environments, the large number of workflows and their interdependencies make manual tracking of invocation relationships and dependencies challenging, often leading to maintenance difficulties and potential errors. This workflow automates the construction of dependency graphs and tagging process, enabling comprehensive management of workflow invocation relationships, reducing maintenance overhead, and preventing accidental disruptions to subworkflow logic.

Use Cases

  • Enterprises or teams using n8n to build numerous automation workflows that require management and maintenance of multiple interdependent subworkflows.
  • Situations where a clear understanding of workflow invocation relationships is needed for optimization and documentation purposes.
  • Automation operations personnel who want to monitor subworkflow dependencies and invocation frequencies through visual charts.
  • Scenarios requiring periodic review and updating of subworkflow tags to maintain accurate workflow metadata.

Main Process Steps

  1. Triggered on schedule or manually activated to retrieve all current workflow data from the n8n instance.
  2. Parse and build the subworkflow dependency graph via a code node, identifying callers and the subworkflows they invoke.
  3. Filter out subworkflows that are not called or do not exist to ensure data accuracy.
  4. Count the number of callers for each subworkflow and identify any new callers.
  5. Retrieve all existing tags, exclude those already present, and create new tags for newly identified callers.
  6. Automatically update the corresponding caller tags on subworkflows to implement auto-tagging functionality.
  7. Generate MermaidJS format diagrams representing invocation relationships and provide visualizations via Webhook.
  8. Create pie charts using the QuickChart node to display the distribution of subworkflow invocation frequencies.

Involved Systems and Services

  • n8n built-in API (for retrieving workflows, tags, and updating tags)
  • HTTP Request node for invoking n8n APIs
  • Code node (JavaScript) for dependency calculation and data transformation
  • MermaidJS for generating visual dependency graphs
  • QuickChart for producing invocation frequency pie charts
  • Webhook for displaying dependency diagrams in the browser

Target Users and Value

  • n8n platform administrators and developers
  • Teams and enterprises managing complex automation workflows
  • Automation workflow designers and maintainers
  • Professionals aiming to improve workflow management efficiency and ensure process stability

By leveraging this workflow, users can effortlessly grasp the invocation dependencies among workflows in complex automation environments, automatically maintain caller tags, enhance management transparency and maintenance efficiency, avoid potential disruptions, and promote the healthy development of their automation systems.

Recommend Templates

Backup to GitHub

This workflow automatically backs up all workflow configurations to a specified GitHub repository, ensuring data security and version control. Triggered either on a schedule or manually, the workflow processes configuration files one by one, checking for differences with the files on GitHub and performing the corresponding create or update operations. This process effectively manages workflows, prevents data loss, and saves storage resources, making it suitable for teams and individuals that require regular backups and version management.

n8n BackupGitHub Sync

GitHub Repository Update Triggered Smart Lighting Alert

This workflow enables automatic switching of lights to red through a smart home system when updates occur in a GitHub repository. This physical feedback allows team members to instantly notice code changes, avoiding the neglect and delays associated with traditional notification methods, thereby enhancing response efficiency. It is suitable for software development teams, individual developers, and tech enthusiasts, enhancing the integration of work with smart home environments and improving collaboration and management efficiency.

GitHub AlertsSmart Home

screenshot

This workflow can automatically generate standard screenshots and full-page screenshots of specified web pages, then upload these screenshots to Dropbox and send them via email to designated users. It simplifies the cumbersome process of manually capturing, organizing, and sending emails, enhancing the efficiency of web screenshot capture and sharing. It is suitable for professionals such as product managers, testing engineers, and marketers who need to regularly obtain and distribute web screenshots. With a one-click trigger, it achieves a high level of automation, saving time and labor.

web screenshotauto send

GitHub Star Change Notification

This workflow can monitor the changes in the number of Stars for a specified GitHub repository in real-time, automatically identifying events of new Stars and Star removals. It sends detailed notifications through a Slack channel, including the avatar, username, and link of the triggering user, helping open source project maintainers stay informed about changes in the project's popularity and improving their responsiveness to user interactions. It is suitable for open source teams, community managers, and product operators.

GitHub StarSlack Notification

Click-to-Execute Trigger Workflow

This workflow is initiated by manually triggering a node, allowing for flexible invocation and reuse of other workflows, thereby enhancing the management efficiency of automated tasks. Users can simply click the "Execute" button to trigger preset tasks, making it suitable for scenarios such as testing complex processes, on-demand initiation of customized tasks, and frontend operations triggering backend automation. This workflow provides convenient scheduling capabilities for automation process designers and operations personnel, effectively simplifying the operational process.

Manual TriggerWorkflow Call

Example of Parallel Sub-Workflow Initiation and Synchronized Waiting

This workflow demonstrates how to effectively manage the asynchronous parallel initiation of multiple sub-workflows and achieve pseudo-synchronous waiting through a webhook callback mechanism. Users can initiate multiple tasks simultaneously and proceed with subsequent operations only after all subtasks are completed, thus avoiding the blocking and complex management issues found in traditional processes. It is suitable for scenarios such as large-scale data processing, asynchronous system call waiting, and automated integration, enhancing work efficiency and process stability.

n8n workflowasync parallel

Get a Pipeline in CircleCI

This workflow is manually triggered and automatically calls the CircleCI API to retrieve pipeline information for a specified project, allowing users to monitor the pipeline status in real time. It addresses the inefficiency of development and operations teams frequently switching platforms and manually checking pipeline statuses, enhancing the automation and convenience of data retrieval. This workflow is suitable for individuals who need to quickly understand the build and deployment processes, helping them respond promptly to anomalies and significantly improving work efficiency.

CircleCIPipeline Monitoring

v1 Helper - Find Params with Affected Expressions

This workflow is specifically designed for users after upgrading to a new version. It automatically scans all activated workflows to accurately identify parameters affected by changes in expressions in the new version. By automatically recognizing and summarizing the impacted parameters, users can quickly discover and check for potential compatibility issues, thereby reducing upgrade risks and ensuring that workflows run stably in the new version, avoiding interruptions in the production environment. This tool significantly enhances troubleshooting efficiency and is suitable for operations and maintenance personnel as well as automation developers.

n8n upgradeexpression check