Apex Flowchart Generator is an offline VS Code extension visual Aid tool that converts Apex code into structured, flowchart-style diagrams similar to Salesforce Flows.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Apex Flowchart Generator is an offline VS Code extension visual Aid tool that converts Apex code into structured, flowchart-style diagrams similar to Salesforce Flows.
It helps Salesforce developers, administrators, and newbies to visually understand complex Apex logic structure.
Key Features
It detect and visualizes the following:
for loops.
While loops.
If/Else Statements.
Method callout.
SOQL and DML Operations.
Try catch Finally Blocks.
Throw Statements.
Variables declaration and updates.
Continue, Break Statements.
Return Statements
Flowchart Visualization
Generates Mermaid flowchart syntax.
Renders diagrams directly inside VS Code.
Similar visual structure to Salesforce Flows.
Vs Code Commands
ApexViz: Visualize Apex Class - Helps to visualize Apex Class, Extracts All the methods and Visualize these methods individually.
Usage
Open any Apex Class .cls
Run the Command.
Web View will be opened.
Select any Method and click on visualize, mermaid diagram will be rendered.
Limitations
Focused only on structural flow (not variable tracking).
Does not evaluate runtime behavior.
SwitchCase logic is currently not rendered.
Triggers can't be visualized.
Ternary operator(Short-hand if else) is not being visualized.
Constructors are skipped.
Complex dynamic Apex may require future enhancements.
Long text in the rendered Mermaid diagram may be truncated. As a temporary workaround, copy the generated Mermaid code and view it in any Mermaid-supported tool.
Privacy
Completely Offline.
No External API Calls.
Your Code never leaves your machine.
Architecture
Apex Class Code -> Apex ANTLR4 Praser -> AST and Code Structure Extraction -> Mermaid Flow Chart Synatx Generation -> VS Code Webview Rendering.