StudioGraph
See what breaks before you change it. StudioGraph maps the dependencies between your Salesforce OmniStudio components (OmniScripts, Integration Procedures, Data Mappers, FlexCards) and the Apex, LWC, Flows and object fields they use. Pick a component and you see what uses it, what it uses, and how many components a change would affect. A health check finds broken references and risky patterns before you deploy.
Everything runs locally on your project files. Metadata never leaves your computer.
Quick start
- Open a folder that contains
sfdx-project.json. StudioGraph indexes it automatically.
- Open a component file (an Apex class, LWC, FlexCard, OmniScript, Integration Procedure, Data Mapper or Flow) and press
Ctrl+Alt+G (Cmd+Alt+G on macOS). The Dependency Graph opens focused on that component. Press it again on another file and the graph switches to that component. From any other place the shortcut just opens the graph.
- Or click the StudioGraph icon in the Activity Bar (left), StudioGraph in the status bar, or run StudioGraph: Open Graph from the Command Palette (
Ctrl+Shift+P).
Features
Dependency graph
The Dependency Graph tab has three parts:
- Component list (left): all components grouped by type (collapsed at start), with a name filter. Click a component to select it.
- Graph (center): the selected component with the components around it. Nodes are colored by type. The border shows the relation to the selected component: orange = uses it, so a change can affect it; blue = it uses this (a dependency); dashed red = referenced but not found in your sources. Click a node to select it; double-click opens its file.
- Details (right): type with an Open file link, impact numbers, issues found by the health check, and the direct "Used by" and "Uses" lists with the reference mechanism (collapsible, with a filter) (for example
IP Action, bundle, data source IP).
Right-click a component (in the graph, the component list, the details panel, Find Usages or Health Check) for Copy Name and Copy Path. In the graph, Hide removes a component from the diagram; if other components are connected to the diagram only through it, a dialog lists them first, because they are hidden too. Hidden components are listed at the bottom of Filter, where you can show them again; selecting another component shows everything again.
The toolbar above the graph is one row: ← Back, History, Show, Filter, View and Export. When the panel is too narrow, Export, View, History and Filter move into More, in that order. ← Back returns to the previously selected component; History lists the last 20 components you viewed. Show sets how many levels the graph shows (1–99, or all for the whole chain). Filter lists the component types on the current diagram, with their counts, and hides the ones you uncheck (all are shown by default; the selected component always stays).
The legend in the bottom-left corner of the graph explains the borders and can be collapsed. Uncheck ← used by to hide everything that uses the selected component (the orange side, affected by a change), or uses → to hide everything it uses (the blue side, dependencies); both are remembered. ? shows how to use the graph. In the bottom-right corner, + and − zoom, Fit shows the whole diagram and Center moves the selected component to the middle without changing the zoom.
View chooses the Layout, i.e. how the diagram is arranged:
- Classic (default): layers from left to right, with straight edges.
- Layered: the same layers with right-angle edges.
- Columns by type: one column per component type, with a header and a count.
- Impact tree: what uses the component grows to the left, what it uses to the right, and every component appears once. Other links between them show when you hover over a component.
- Routed (beta): layers like Layered, but the edges follow routes computed with the layout, so they go around components and never share a line; crossings are kept low too. On the project's test graphs it had 8 crossings where Classic had 54 and Layered 23, and no edge through a component (Classic 98, Layered 32).
Large groups (also in View) collapses more than 8 components of one type on one level into one node, such as LWC × 15 LWC ▸, with or without their names listed inside. Click a group to show its components one by one; selecting another component collapses the groups again.
Export saves the impact report of the selected component (Markdown, CSV or JSON, see below) or the whole diagram as an SVG image, a PNG image (twice the screen resolution) or a Mermaid diagram for Markdown, GitHub, GitLab or Confluence (saved as .md, it is wrapped in a ```mermaid block). Images have a header with the StudioGraph logo, the component name, the number of components, the depth and the layout; Mermaid files carry the same as a title and comments. The save dialog opens in the folder you used last time, or in the workspace folder. Mermaid viewers render up to 500 links by default: for a larger diagram StudioGraph warns you, so you can hide some types first.
Impact numbers
Every component has four numbers:
| Number |
Meaning |
| used by |
components that reference it directly |
| change affects |
everything that depends on it, directly or indirectly |
| uses |
components it references directly |
| depends on |
everything it needs, directly or indirectly |
StudioGraph gives you the numbers, not a risk score: you decide what they mean for your change.
Find Usages
The Find Usages tab searches component names and the content of their configuration: OmniScript and IP element settings, Data Mapper mappings and filters, FlexCard data sources, SOQL queries and Apex/LWC code. Case does not matter, and Account.Name and Account:Name find the same field.
- Match mode: Word (default) finds the name as a whole word, so
Account finds Account.Name but not AccountService; Exact only the whole identifier or dotted name; Contains any part of a name or text.
- Type filter: chips with the number of matching components per type; pick one or more types, or All.
- Results table: component, type and number of hits, sortable by any column, with a Filter results box. Each hit shows its line number: click it to open the file at that line. Click the component name to select it in the graph.
- Recent searches: the last 20 queries of the workspace, one click to run again.
- Export Results saves the results, with file and line of every hit, as Markdown, CSV or JSON.
From the editor: select a name (or place the cursor on it) and right-click → StudioGraph: Find Usages.
Names written in Apex
Apex often finds profiles, permission sets and queues by name, e.g. [SELECT Id FROM Profile WHERE Name = 'System Administrator'], with the names kept in a constants class. StudioGraph links such a class to the component when the name is:
- a literal in a SOQL condition on
Name or DeveloperName of Profile, PermissionSet, PermissionSetGroup, Group (groups and queues), UserRole or RecordType, also through a related record (FROM User WHERE Profile.Name = …, PermissionSet.Name, RecordType.DeveloperName) and in dynamic SOQL (Database.query('… Name = '' + X + '''));
- a bind to a String constant (
:Constants.ADMIN_PROFILE, also Set<String> and List<String> constants) or to a local String variable; the class that holds the constant is linked too (hardcoded name (constant));
- an argument of a helper method whose parameter goes into such a condition, e.g.
UserUtils.profileId('Sales Rep');
- the name argument of
FeatureManagement.checkPermission('X') (Custom Permission), Type.forName('X') (Apex class), Flow.Interview.createInterview('X', …) (Flow) and System.Label.get('', 'X') (Custom Label), with the same constants and helpers. A namespace other than '' or null means a managed package and is skipped.
Formulas, validation rules, Flows and Visualforce that compare $Profile.Name or $UserRole.Name with a text ($Profile.Name <> "System Administrator", a Flow decision on $UserRole.Name) are linked the same way. CASE($Profile.Name, …) and CONTAINS are not.
SOQL Profile.Name and $Profile.Name are the label: standard profiles are matched to their files (System Administrator → Admin, Standard User → Standard, and so on), custom profiles by name. Names built at runtime or read from records are not found.
Health Check
The Health Check tab lists problems in three groups, which you can filter:
- Errors (will fail at deployment or at runtime):
- a reference to a component that is not in the project;
- a call to an Integration Procedure that has no active version;
- a reference whose name differs from the component's name only in case (the deployment compares names exactly).
- Warnings (works, but is risky):
- Data Mapper, Integration Procedure or Remote Actions inside a Loop Block (one call per iteration, can hit governor limits);
- HTTP / Rest steps in an Integration Procedure without a Try/Catch Block;
- a Data Mapper Load that receives a record Id but does not use it (no upsert key and no mapping to Id), so it inserts a new record instead of updating;
- call cycles between components;
- Apex that looks up a profile, permission set, group, queue, role or record type by a name that is not in the project;
- a record Id written in Apex, a Flow, LWC, Aura, Visualforce or a validation rule (
'00e5g000001AbCdAAK'), with its type (Profile, Record Type, Queue, User and others) and line; Line N opens the file there. IDs differ between orgs, so such code breaks after a deployment. Test classes are skipped.
- Cleanup:
- Data Mappers and Integration Procedures that nothing uses;
- other components with no connections at all;
- old inactive versions next to the active one.
Click an issue to select the component in the graph. The tab also shows how many components of each type the project has.
Check Access
Can this user run this component? The User Access Check tab takes a user (Id, username, e-mail or name) and a component; Check Access… in the details panel and in the right-click menu opens it for that component. After you choose an org, StudioGraph reads the user's profile, Permission Sets and Permission Set Groups, and follows the component's chain: OmniScripts, Integration Procedures, Data Mappers, FlexCards, LWC, Aura, Flows, Visualforce and Apex, class after class. A class called by another class needs no class access, and a query runs in system mode unless it says otherwise: a query WITH USER_MODE or WITH SECURITY_ENFORCED fails for a field the user cannot read (Missing), and a class that uses Security.stripInaccessible may remove it (To confirm). Fields Apex reads in system mode need no permission; they are listed under Not needed. The Markdown export lists every result with the path that needs it, such as Order_Create → Order_Update → OrderService.
Results are split into Missing, To confirm, Already has and Not needed, each with its count. Missing opens first and reads like a Permission Set: Apex Class Access, Visualforce Page Access, Custom Permissions and Field Permissions per object, each field with Read or Edit. Create Permission Set opens that Permission Set as XML in a new editor tab, with read access to the fields' objects (nothing is saved or sent to the org: save it in your project and deploy it when it looks right); Copy list copies the list. Already has shows the profile, Permission Sets or Permission Set Groups that give each item. Hover an item for the full explanation; click a name to show it in the graph. Recent checks under the form lists the last checks of this workspace with how many items were missing: click one to run it again for the same user and org. the gold Save … for later under the form keeps the last checked user there, in every workspace: click the name to fill it in, × to forget it.
| Result |
Meaning |
| Missing |
The user is blocked and Salesforce enforces it: an Apex class called directly from LWC, Aura or Visualforce, a Visualforce page, a field an LWC reads with a schema import or shows in a record form, a field in an Apex query in user mode (also in a class called by another class). |
| Risk |
It works, but it bypasses the user's permissions: a Data Mapper with field security off reads or writes a field the user has no access to. |
| To confirm |
The user lacks this, but it was not confirmed that it blocks them: a class called by an Integration Procedure, a Data Mapper with field security on, a Turbo Extract, a Required Permission, a Data Mapper in a FlexCard, fields of a FlexCard SOQL data source, fields in a Flow. Try these as the user. |
| OK |
The user has it. |
Field access is what the org computes for the user (UserFieldAccess), including muting in Permission Set Groups. A Data Mapper checks field security when Check Field Level Security is on, or when the org turns on EnforceDMFLSAndDataEncryption; both are taken into account. Everything is read with your org login and nothing is changed in the org. Record access (sharing) is not checked.
Click the StudioGraph icon in the Activity Bar. The Current File view follows the file you are editing and shows its component: impact numbers, health check issues, and the direct Used by and Uses lists with the reference mechanism. Click any entry to select it in the graph. The buttons at the top open the graph for the current file and export an impact report. When the focus moves to the panel or another view, the sidebar keeps the last component.
In the editor
- CodeLens above a component file (Apex, LWC, OmniStudio, Flow):
used by · change affects, uses · depends on, the number of issues, and report. Click to open the component in the graph.
- Hover over a component or field name anywhere in your code or metadata (for example
CustomerService or Account.Name) to see its impact numbers, with Show in Graph and Impact Report links.
- Right-click in the editor: Find Usages, Show in Graph, Export Impact Report. Show in Graph is also in the editor title bar and the Explorer context menu.
Impact reports
Export Impact Report (from the details panel, CodeLens, hover or the context menu) creates a report of everything that uses the component and everything it depends on, level by level, with file paths and issues. Choose Markdown (code reviews, tickets), CSV (Excel) or JSON (other tools). The report opens as a new unsaved document.
Retrieve from Org
Retrieve from Org (panel button or Command Palette) lists the orgs authorized in Salesforce CLI, retrieves OmniStudio, Apex, LWC, Flow and custom object metadata from the one you pick, and shows its graph. The metadata is stored in the extension's private storage folder; your project files are not changed. Back to Project switches the panel back.
Org dependencies
Salesforce itself tracks dependencies between Apex classes, triggers, LWC, Flows and custom fields (Tooling API, MetadataComponentDependency). Load Dependencies from Org (Settings tab or Command Palette) reads them from an org and adds the ones the files do not show, for example fields used through relationships or components that are not in the project. Added connections are dashed in the graph; components that exist only in the org have a dotted border and are never reported as missing. The data is kept for the workspace until you refresh or remove it in the Settings tab. OmniStudio components are not part of this org data.
Salesforce does not track names and IDs written as text, so the same command also asks the org about them:
- names that Apex, formulas and Flows look up but the project does not have (profiles, permission sets, groups and queues, roles, record types, Custom Permissions, classes, Flows, labels): if the org has the component, it is shown as existing only in the org; if not, Health Check reports an error, because the lookup will find nothing;
- record IDs written in the code: the warning names the record (e.g. Profile "System Administrator"), an ID of a profile, permission set, queue, role, record type, email template, static resource, class or Flow links to that component in the graph, and an ID the org does not have is reported as probably copied from another org.
The names and IDs are those in the files when you load; load again after changing the code. Records the org user cannot read are skipped.
What StudioGraph detects
| Component |
References detected |
| OmniScript, Integration Procedure |
Data Mapper actions, Integration Procedure actions, Remote Actions (Apex), custom LWCs, embedded OmniScripts, embedded FlexCards (cf<Card>); also from a compiled OmniScript LWC (<name>_def.js) when only that is in the repo |
| Data Mapper |
object fields it reads, writes and filters on (including Extract aliases), Apex functions in formulas (FUNCTION('Class', ...)) |
| FlexCard |
data sources (Integration Procedure, Data Mapper, Apex), child and flyout cards, custom LWCs, OmniScript actions, fields in SOQL data sources; also from a compiled card's definition.js (lwc/cf<Card>/) |
| Apex class, trigger |
other classes, Integration Procedures called through executeIntegrationProcedure or by their Type_SubType key, fields in SOQL queries; profiles, permission sets, groups, queues, roles and record types looked up by name (see below) |
| LWC |
Apex imports, child components, c/ imports, schema field imports, embedded FlexCards, cards shown by name (flexcard-name), Integration Procedures called through IntegrationProcedureService |
| Flow |
started from Apex (new Flow.Interview.X(…), createInterview('X', …)), Apex actions, Integration Procedure actions, subflows and flow actions (Process Builder), LWC and Aura screen components, local actions, Apex-defined variables, email alerts, submit for approval, fields of the triggering record (entry conditions, $Record.X, $Record__Prior.X) and in record lookups, creates and updates |
| Named / External Credential |
Integration Procedure HTTP actions and Apex callout: endpoints use the Named Credential; the Named Credential uses its External Credential |
| Lightning Page (FlexiPage) |
FlexCards, OmniScripts, Flows, Visualforce pages, LWC and Aura components placed on the page; Dynamic Forms fields; Custom Permissions and profiles in visibility rules |
| Custom Label |
used by Apex (Label.X), LWC (@salesforce/label/c.X), Aura and Flow ($Label.X), OmniScripts and FlexCards ($Label.X, {Label.X}) |
| Platform Event |
published by Apex (new X__e), Flows (create records) and Data Mapper Loads; subscribed by triggers, platform-event Flows and LWC (/event/X__e) |
| Custom Metadata Type |
read by Apex, Flows, Data Mappers, FlexCard data sources and LWC (X__mdt); its records are searchable |
| Aura component |
Apex controller, parent component, events (declared, handled or fired with $A.get('e.c:X')), child Aura components and LWC (<c:name>, aura:dependency), labels; placed on Lightning pages |
| Permission Set, Permission Set Group, Profile |
access to Apex classes, fields, record types, Custom Metadata Types, Custom Permissions, Flows and External Credential principals that are in the graph; group members; profile layout assignments |
| Page Layout |
fields on the layout; profiles that assign it |
| Group, Queue, Role |
found by name from Apex; a role's parent role; a queue's member groups and roles |
| Custom Permission |
the permission it requires; used by Apex (FeatureManagement.checkPermission), LWC (@salesforce/customPermission/X), formulas, validation rules, Flows, Aura, Visualforce and OmniStudio ($Permission.X); granted by Permission Sets and Profiles |
| Validation Rule |
fields of its object used in the formula, labels and Custom Metadata Types |
| Record Type |
picklists it restricts; Apex lookups by developer name (getRecordTypeInfosByDeveloperName().get('X')) or label (getRecordTypeInfosByName().get('X')); profiles and Permission Sets that grant or assign it |
| Formula and roll-up field |
fields of the same object used in the formula, and the lookup field of a relationship path (Account__r.Name → Account__c); the summarized child field; the controlling field of a dependent picklist |
| Quick Action |
the Flow, LWC or Aura component it runs and the fields of its layout; page layouts that show the action |
| Lightning App, Tab |
apps: custom tabs, utility bar and page overrides; tabs: the Lightning page, LWC or Aura component they open |
| Workflow Rule, Approval Process |
fields in the criteria and formula; fields the rule updates; email alerts they send; approval email templates and queue approvers; submitted from Flows and Apex (setProcessDefinitionNameOrId) (Process Builder processes are Flows) |
| Email Alert |
its email template and the groups and roles it sends to; sent by workflow rules, Flows and approval processes |
| Email Template |
merge fields ({!Case.Subject}) and labels; email alerts and approval processes that send it; Apex looking it up by name |
| Sharing Rule |
fields in the criteria of criteria-based rules; the groups and roles it shares from and to |
| Decision Matrix, Expression Set, Decision Table |
OmniScript and IP Matrix / Expression Set actions (by name or label), Flow and Apex runDecisionMatrix / runExpressionSet actions; versions belong to their definition; Decision Tables read source object fields |
| Static Resource |
used by LWC (@salesforce/resourceUrl/X), Aura and Visualforce ($Resource.X) and Apex (PageReference.forResource) |
| Visualforce Page, Visualforce Component |
controller and extensions, remote actions ($RemoteAction.Class.method), components, templates, $Page.X links, embedded Flows, resources, labels, standard-controller merge fields, Lightning Out apps; opened from Apex (Page.X), tabs, Quick Actions, layouts and Lightning pages; page access in Permission Sets and Profiles |
| Document Template (Doc Gen) |
the extract and transform Data Mappers and the custom Apex class; read from DataPacks, and from the org's records by Retrieve from Org |
| Global Value Set |
picklist fields that use it; its values are searchable |
| Custom Setting |
Apex (X__c.getInstance(), getOrgDefaults, getValues, getAll), formulas and Flows ($Setup.X__c) |
| Object field |
defined by objects/<Object>/fields/*.field-meta.xml (or objects/<Object>.object from the org), so custom fields appear even when nothing uses them; standard fields appear when referenced |
SOQL fields are read from the SELECT list, WHERE conditions and ORDER BY / GROUP BY, for the queried object only. Names are matched case-insensitively, as Salesforce does. Several versions of the same Integration Procedure or OmniScript are shown as one component.
- SFDX: folders from
packageDirectories in sfdx-project.json (source format from sf project retrieve start), and Metadata API folders.
- Vlocity DataPacks: exports from Vlocity Build Tool or the Vlocity VS Code extension, for native OmniStudio and for the
vlocity_cmt, vlocity_ins and vlocity_ps managed packages. DataPacks folders are detected automatically up to 4 levels deep; the vlocity.projectPath setting is used too.
Both formats can be in the same project: the same component in both is shown once. A FlexCard's compiled LWC (cf<Card>) is recognized as the card itself, not as a separate LWC.
Settings
Most settings can be changed in the panel's Settings tab, which saves them to the project's .vscode/settings.json:
- Metadata sources: enable or disable detected folders and add your own (
studiograph.sfdxPaths, studiograph.dataPackPaths, studiograph.excludedSources).
- Type colors (
studiograph.colors).
- Graph: default number of levels (
studiograph.defaultDepth), default layout (studiograph.defaultLayout) and whether to show object fields (studiograph.showFields).
- Refresh: refresh the graph after a metadata file changes (
studiograph.autoRefresh).
- Editor: CodeLens (
studiograph.enableCodeLens) and hovers (studiograph.enableHover).
To change the Ctrl+Alt+G shortcut, open Keyboard Shortcuts (Ctrl+K Ctrl+S) and search for @command:studiograph.open, or click change in the Settings tab.
Commands
| Command |
What it does |
| StudioGraph: Open Graph |
Ctrl+Alt+G: the Dependency Graph, focused on the component of the current file when there is one |
| StudioGraph: Find Usages |
searches for the selection or the name under the cursor |
| StudioGraph: Show in Graph |
selects the component of the current file in the graph |
| StudioGraph: Export Impact Report |
impact report for the component of the current file |
| StudioGraph: Retrieve from Org |
retrieves metadata from an org and shows its graph |
| StudioGraph: Load Dependencies from Org |
adds the org's dependency data to the project graph |
| StudioGraph: Clear Index Cache |
rebuilds the index from scratch |
Requirements
- VS Code 1.90 or later.
- For Retrieve from Org only: Salesforce CLI (
sf) and an authorized org (sf org login web).
Privacy
StudioGraph reads your files locally and sends nothing over the network. Retrieve from Org connects only to your own org, through sf, using your existing login. The index cache is stored in VS Code's private storage for the workspace, outside your repository.
| |