Files
2026-06-13 19:50:42 +05:30

10 KiB
Raw Permalink Blame History

Workflow Repair

ComfyFlow Insight

Technical Documentation


Overview

The Workflow Repair Engine is responsible for transforming workflow analysis findings into actionable repair plans.

While Workflow Advisor identifies what should be improved, Workflow Repair focuses on how those improvements can be performed safely.

The Workflow Repair Engine acts as a workflow safety system by helping users understand:

  • Which nodes may be removed safely
  • Which repairs require manual review
  • Which workflow components are critical
  • What risks exist before making changes
  • How workflow stability may be affected

Why Workflow Repair Exists

Large workflows evolve over time.

As workflows grow, they often accumulate:

Unused Nodes

Broken Connections

Experimental Components

Dead-End Chains

Orphaned Sections

Duplicate Logic

Abandoned Branches

Removing components manually can be dangerous.

Example:

CheckpointLoader
      ↓
   KSampler
      ↓
   SaveImage

Removing:

KSampler

would break:

SaveImage

Workflow Repair helps identify these risks before changes are made.


Core Objective

The Workflow Repair Engine provides safe, explainable repair recommendations.

It does not modify workflows automatically.

Instead, it provides a repair roadmap for users.


Design Philosophy

ComfyFlow Insight follows a strict principle:

Analyze First

Recommend Second

Modify Never

The system never automatically deletes, rewires, or alters workflow nodes.

All decisions remain under user control.


Workflow Repair Pipeline

Workflow Repair receives information from:

Health Analyzer
        ↓

Dependency Graph
        ↓

Impact Analysis
        ↓

Workflow Advisor
        ↓

Workflow Repair

Each engine contributes evidence used to generate repair recommendations.


Repair Categories

The Workflow Repair Engine classifies repairs into two categories:

Safe Repairs

Manual Repairs

Safe Repairs

Definition

Safe Repairs are low-risk recommendations that are unlikely to affect workflow functionality.

These repairs are typically associated with:

Disconnected Nodes

Unused Components

Isolated Structures

Redundant Elements

Example

Workflow:

LoadImage
     ↓
SaveImage


PreviewImage

Node:

PreviewImage

has:

Dependencies = 0

Dependents = 0

Result:

Potentially Safe To Remove

Important Note

Safe does not mean automatic.

A node may be intentionally disconnected for:

Future Development

Testing

Workflow Templates

Debugging

Users should always verify workflow intent.


Manual Repairs

Definition

Manual Repairs require human review.

These recommendations affect workflow behavior.


Example

Workflow:

KSampler

without:

SaveImage

Repair Recommendation:

Add SaveImage Node

This recommendation changes workflow behavior and therefore requires manual implementation.


Why Manual Repairs Exist

The system cannot determine:

User Intent

Creative Goals

Expected Outputs

Preferred Workflow Design

Human review is always required.


Repair Recommendation Structure

Every repair recommendation contains:

Repair Type

Severity

Node Information

Issue Description

Recommended Action

Risk Level

Example Recommendation

Repair Type:
Missing Output

Severity:
Medium

Node:
KSampler

Issue:
No output node detected.

Recommended Action:
Add SaveImage node.

Repair Severity Levels

The Repair Engine assigns severity levels.


Low Severity

Characteristics:

Cosmetic Issues

Unused Nodes

Minor Warnings

Examples:

Disconnected Preview Node

Unused Utility Node

Medium Severity

Characteristics:

Workflow Quality Issues

Missing Components

Optimization Opportunities

Examples:

Missing SaveImage

Redundant Branches

High Severity

Characteristics:

Critical Workflow Problems

Execution Risks

Output Failures

Examples:

Broken Dependency Chain

Missing Critical Node

Disconnected Core Workflow

Risk Assessment

Purpose

Risk Assessment estimates the likelihood that workflow modifications may cause problems.


Risk Factors

The Repair Engine evaluates:

Dependency Complexity

Impact Analysis

Branch Complexity

Critical Nodes

Workflow Health

Risk Levels

Low

Medium

High

Low Risk

Characteristics:

Minimal Dependencies

No Critical Impact

Isolated Components

Example:

Unused Preview Node

Medium Risk

Characteristics:

Moderate Dependencies

Limited Workflow Impact

Example:

Optional Processing Branch

High Risk

Characteristics:

Critical Dependencies

Large Downstream Impact

Core Workflow Components

Example:

CheckpointLoader

KSampler

Primary Output Chain

Repair Risk Score

Definition

Repair Risk Score represents the estimated risk associated with workflow modification.


Example

Repair Risk Score = 12

Interpretation:

0–20
Low Risk

21–50
Medium Risk

51+
High Risk

Critical Node Protection

One of the most important responsibilities of Workflow Repair is protecting critical workflow components.


Example

Workflow:

CheckpointLoader
      ↓
KSampler A

KSampler B

KSampler C

Impact:

Multiple Dependents

Recommendation:

Manual Review Required

The engine prevents dangerous removal suggestions.


Safe Removal Detection

Workflow Repair uses Dependency Graph and Impact Analysis results.


Conditions

A node may be flagged as a safe removal candidate when:

No Dependencies

No Dependents

No Workflow Impact

Example

PreviewImage

Result:

Potential Safe Removal

Important Warning

Safe removal is always a recommendation.

Users must confirm:

Node Purpose

Workflow Intent

Future Usage

before deletion.


Missing Output Detection

One common workflow issue is missing outputs.


Example

Workflow:

LoadImage
     ↓
KSampler

No:

SaveImage

detected.

Repair Recommendation:

Add SaveImage Node

Broken Dependency Detection

The Repair Engine detects disconnected workflow chains.


Example

LoadImage

KSampler

No connection exists.

Result:

Broken Dependency Chain

Repair Recommendation:

Review Connection Structure

Branch Repair Recommendations

The Repair Engine evaluates workflow branching.


Example

Branch Count = 12

Advisor Result:

High Branch Complexity

Repair Recommendation:

Review Branch Structure

Remove Redundant Paths

Simplify Processing Chains

Repair Insights

The Repair Engine generates human-readable observations.

Examples:

Workflow contains isolated nodes.

Safe removal candidates detected.

Critical dependencies identified.

Manual review recommended.

Output chain appears incomplete.

Repair Workflow

Recommended process:

Run Analysis
      ↓

Review Advisor
      ↓

Open Workflow Repair
      ↓

Review Safe Repairs
      ↓

Review Manual Repairs
      ↓

Implement Changes
      ↓

Run Analysis Again

This iterative process improves workflow quality over time.


Integration With Workflow Advisor

Workflow Advisor answers:

What should I improve?

Workflow Repair answers:

How should I improve it?

Together they create a complete workflow optimization system.


Integration With Export Center

Repair findings contribute to:

Repair Reports

Portfolio Reports

Workflow Documentation

Engineering Assessments

These reports help users communicate workflow quality and maintenance status.


Example Repair Report

Workflow Repair Report

Safe Repairs:
2

Manual Repairs:
3

Risk Score:
18

Critical Nodes:
4

Repair Status:
Review Recommended

Interpretation:

Workflow is generally healthy.

Minor repairs are recommended.

Low overall modification risk.

Common Repair Scenarios

Scenario 1

Issue:

Disconnected Preview Node

Recommendation:

Review For Removal

Risk:

Low

Scenario 2

Issue:

Missing SaveImage

Recommendation:

Add Output Node

Risk:

Medium

Scenario 3

Issue:

Critical Dependency Chain

Recommendation:

Manual Review Required

Risk:

High

Best Practices

Never Blindly Remove Nodes

Always verify:

Workflow Purpose

User Intent

Future Plans

Review Critical Nodes Carefully

Nodes with many dependents should be modified cautiously.


Re-Analyze After Repairs

After implementing changes:

Run Full Analysis Again

to verify workflow health improvements.


Use Repair Together With Advisor

Workflow Repair is most effective when used alongside Workflow Advisor recommendations.


Relationship With Other Engines

Workflow Repair relies on:

Health Analyzer

Dependency Graph

Impact Analysis

Workflow Advisor

These engines provide the evidence used to generate repair plans.


Summary

The Workflow Repair Engine transforms workflow analysis findings into safe, explainable repair recommendations.

It provides:

Safe Repairs

Manual Repairs

Repair Risk Analysis

Critical Node Protection

Missing Output Detection

Dependency Repair Guidance

Workflow Recovery Strategies

Most importantly, Workflow Repair never modifies workflows automatically.

The user remains in complete control of all workflow changes.

This design ensures workflow safety while still providing actionable engineering guidance.


Next Document

Continue with:

docs/export-center.md

This document explains report generation, portfolio exports, architecture reports, optimization reports, repair reports, and recruiter-focused workflow documentation.