Papers
Topics
Authors
Recent
2000 character limit reached

Fault2Flow: Automated Power Grid Fault Diagnosis

Updated 24 November 2025
  • Fault2Flow is an end-to-end LLM-based multi-agent system that translates regulatory documents into executable, verified fault-diagnosis workflows for power grids.
  • It integrates document parsing, human-in-the-loop verification, and evolutionary optimization to systematically reduce manual engineering overhead.
  • Experimental evaluations demonstrate provable topological consistency and end-to-end reachability coverage, ensuring high semantic fidelity and process transparency.

Fault2Flow is an end-to-end, LLM-based multi-agent system for automating the translation of unstructured regulatory documentation and expert knowledge into verified, executable power-grid fault-diagnosis workflows. The framework is engineered for operational deployment, integrating document parsing, formal logic extraction, human-in-the-loop verification, evolutionary optimization, and final workflow synthesis into n8n automations. Experimental results demonstrate that Fault2Flow achieves provable topological consistency and reachability coverage, reducing engineering overhead while ensuring semantic fidelity and process transparency (Wang et al., 17 Nov 2025).

1. Motivation and System Architecture

The diagnosis of power grid faults—such as transformer overheating, insulation breakdown, and partial discharge—is conventionally a manual and error-prone process. Operators must decipher dense regulatory standards, construct ad hoc diagnostic logic, and incorporate tacit field knowledge. This manual approach renders the workflow brittle, difficult to maintain, and susceptible to error, especially when regulations are updated or new experiential data becomes available. Fault2Flow aims to automate this process by:

  1. Automatically extracting formal reasoning logic from unstructured regulatory texts.
  2. Integrating and verifying this logic with expert domain knowledge through an interactive, human-in-the-loop interface.
  3. Optimizing the resulting logical structures for readability and correctness via evolutionary search.
  4. Synthesizing fully executable, verified diagnostic workflows suitable for n8n deployment.

The architecture of Fault2Flow encompasses: a document parsing pipeline, LLM-enabled logic extraction agents, a human-in-the-loop web front-end, the AlphaEvolve optimizer, and a workflow synthesis engine targeting the n8n automation platform.

2. PASTA-Formatted Fault Tree Extraction

At the core of Fault2Flow’s extraction process is the conversion of regulatory Markdown into fault trees expressed in the PASTA domain-specific language (DSL). A fault tree, FT=(N,G,E)FT = (N, G, E), is composed of nodes N=NBNIN = N_B \cup N_I (with NBN_B denoting basic events and NIN_I intermediate logic gates), a mapping G:NI{AND, OR}G: N_I \rightarrow \{\text{AND, OR}\}, and the directed edge set EE encoding child-parent logical relationships.

The extraction pipeline proceeds as follows:

  • The system ingests structured Markdown derived from regulatory PDFs using MinerU.
  • A Mind-Map Agent generates a PlantUML tree capturing the underlying decision criteria.
  • The Fault-Tree Translation Agent then produces PASTA code representing the complete fault logic, e.g.,
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    FAULT_TREE TransformerThreeRatio {
      OR Node ThreeRatioPattern {
        AND Node PartialDischarge {
          BasicEvent b1: C2H2/C2H4 < 0.1
          BasicEvent b2: CH4/H2 > 0.2
        }
        AND Node Overheating {
          BasicEvent b3: C2H4/C2H6 > 1.5
          BasicEvent b4: Temp > 150°C
        }
      }
    }
  • PASTA enforces syntactic correctness and can annotate event probabilities.

This formalization enables systematic mapping of regulatory logic into an executable computational structure, while capturing explicit Boolean relationships and associated thresholds.

3. Human-in-the-Loop Verification and Refinement

Fault2Flow utilizes a Vue3 + ElementPlus web interface to enable expert engagement during critical stages of knowledge structuring:

  • Experts can upload and review parsed regulatory Markdown.
  • Graphical editors (ECharts-based) permit high-fidelity inspection and direct modification of both PlantUML mind maps and PASTA fault trees.
  • Workflow synthesis can be triggered, and generated n8n flows inspected for further refinement.

Upon expert intervention, all edits are round-tripped—serialized back into PlantUML/PASTA and re-ingested by the LLM agents for propagation. The human-in-the-loop verification function iteratively:

  1. Synthesizes the n8n workflow from the current tree.
  2. Generates and executes test cases, comparing outcomes with expected results.
  3. If discrepancies are observed, extracts error traces and uses these as feedback for LLM-based refinement.
  4. Repeats this process to convergence or until a verification error is detected.

This interactive loop ensures semantic fidelity and incorporates tacit expertise without compromising the integrity or maintainability of the resulting logic.

4. Evolutionary Optimization via AlphaEvolve

To enhance both structural readability and semantic validity, Fault2Flow incorporates the AlphaEvolve evolutionary optimizer:

  • A population P={T1,...,Tn}P = \{T_1, ..., T_n\} of candidate tree encodings is maintained.
  • For each candidate TT, objectives include freadability(T)f_{\text{readability}}(T) (using code-style heuristics) and fvalidity(T)f_{\text{validity}}(T) (checking logical and gate correctness).
  • The composite fitness score is:

F(T)=αfreadability(T)+βfvalidity(T),α+β=1F(T) = \alpha \cdot f_{\text{readability}}(T) + \beta \cdot f_{\text{validity}}(T), \quad \alpha + \beta = 1

  • A multi-island strategy partitions the population, with intra-island search (LLM-guided prompt composition and mutation) and periodic migration of high-fitness individuals across islands.
  • Optimization halts when no further improvement (>ϵ> \epsilon) is observed for GG generations.

AlphaEvolve ensures that the extracted logical structure is not only executable, but also amenable to subsequent human review and future revisions.

5. Synthesis of Executable Workflows in n8n Format

After verification and optimization, the validated PASTA fault tree is converted into an executable n8n workflow through post-order traversal. Major conventions include:

  • Leaf nodes correspond to n8n “IF” nodes, directly checking regulatory thresholds or logical predicates.
  • AND-gates are constructed through chained IFs, enforcing sequential condition checks.
  • OR-gates generate parallel branches merged by an n8n “Merge” node.
  • The output is serialized to n8n’s JSON workflow specification, with direct API-based deployment support.

An illustrative snippet:

1
2
3
4
5
6
7
8
9
10
11
{
  "nodes": [
    { "parameters": { "path": "/upload" }, "name": "HTTP Trigger", "type": "n8n-nodes-base.httpTrigger" },
    { "parameters": { "operation": "if", "conditions": { "boolean": [ { "value1": "={$json[\"C2H2/C2H4\"]}", "operation": "less", "value2": 0.1 } ] } }, "name": "Check Ratio1", "type": "n8n-nodes-base.if" },
    { "parameters": { ... }, "name": "Overheating Action", "type": "n8n-nodes-base.function" }
  ],
  "connections": {
    "HTTP Trigger": { "main": [[{"node":"Check Ratio1","type":"main","index":0}]] },
    "Check Ratio1": { "main": [[{"node":"Overheating Action","type":"main","index":0}]] }
  }
}
This strategy provides a transparent mapping from formal logic to industrial automation.

6. Experimental Evaluation and Metrics

Evaluation is conducted on 16 transformer-diagnosis cases (9 three-ratio, 7 characteristic-gas), with ground-truth reference PASTA trees and expert-crafted n8n workflows. Key metrics include:

  • Logical Readability & Maintainability (LRM): [1,5], normalized to [0,1] by GPT-5 emulation.
  • Semantic Fidelity (SF): [0,1], reflecting diagnostic equivalence.
  • Topological Consistency (TC):

TC=EPASTAEn8nEPASTATC = \frac{|E_{PASTA} \cap E_{n8n}|}{|E_{PASTA}|}

  • End-to-End Reachability Coverage (E2ERC):

E2ERC=PcovPrefE2ERC = \frac{|\mathcal{P}_{cov}|}{|\mathcal{P}_{ref}|}

Summarized results:

Model LRM SF TC E2ERC Succ./Fail Avg Tokens
Qwen3-80B (E2E) 0.80 0.89 0.81 0.69 14/2 21,334
GPT-4.1 (E2E) 0.77 0.92 0.93 0.71 12/4 19,669
Qwen3-14B (F2F) 0.79 0.90 1.00 1.00 16/0 1,869
GPT-4.1 (F2F) 0.79 0.90 1.00 1.00 16/0 1,888

Fault2Flow achieves TC=1.0TC = 1.0 and E2ERC = 1.0, with a substantial reduction in average token usage, and maintains an SF of 0.9—comparable to large end-to-end LLMs, but without workflow failures.

7. Significance, Limitations, and Future Directions

Fault2Flow establishes a reproducible, human-verified pipeline from unstructured regulations to automated operational workflows by integrating formal regulatory logic, expert intervention, and evolutionary optimization. Key advantages include:

  • Full integration of declarative regulatory knowledge and human corrections.
  • Provably correct logical structures and exhaustive workflow path coverage.
  • Considerable reduction in manual engineering overhead and iteration cycles.

However, the system currently restricts its evaluation to transformer fault standards and may require extension of PASTA-DSL for more complex scenarios (timed gates, dynamic thresholds). Verification is offline; on-line or real-time field feedback is not yet implemented.

Potential future developments encompass expansion to additional grid equipment (e.g., breakers, relays), support for multi-fault scenarios, dynamic adaptation to streaming sensor data, and facilitation of collaborative multi-expert workflows with version control and provenance tracking.

Fault2Flow provides a rigorously engineered, verifiable, and human-centric solution to the challenge of operationalizing regulatory knowledge for automated fault diagnosis in power systems (Wang et al., 17 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)
Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to Fault2Flow.