.xaml.json files being created in Studio

In Studio Desktop, in the Project window, under each xaml file, there is a json file being created with the same name as each xaml file.

I have tried deleting the json files, and everything continues to work without issue, but the json files keep getting created again.

What is the purpose of these files? Is there any impact if we delete them? Is there any way to prevent them from being created?

Using Studio 2024.2.1, with project files stored on my local PC.

image

@KevinE,

Not able to replicate this. Could you be able share the code?

Thanks,
Ashok :slight_smile:

I have just tried creating a brand new blank project, with no activities. Even the Main.xaml file has a Main.xaml.json file created beneath it.

My Studio version is actually Studio 2024.2.1-beta.15932 - 2/23/2024 - are you on that same version?

@KevinE,

I’m using stable version 2023.10.3.

May be the json files being created is the feature in development yet not fully released. If those files are not creating any problem, I would recommend to keep as it is and ignore.

Also can you share that json file here, just to see what’s it is holding.

Thanks,
Ashok :slight_smile:

For the blank process with no activities:

{
“DisplayName”: “Main”,
“Tooltip”: null,
“HelpLink”: null,
“Color”: null,
“OriginalIconFileName”: null,
“Arguments”:
}

For a process with some more activities:

{
“DisplayName”: “Qlik KPIs”,
“Tooltip”: null,
“HelpLink”: null,
“Color”: null,
“OriginalIconFileName”: null,
“Arguments”: [
{
“Name”: “Report_Month”,
“DisplayName”: “Report_Month”,
“Category”: null,
“Tooltip”: null,
“Placeholder”: null,
“Widget”: null,
“IsRequired”: false,
“IsPrincipal”: true,
“ArgumentType”: 0,
“DataSourceItems”: null
},
{
“Name”: “kill_browsers”,
“DisplayName”: “kill_browsers”,
“Category”: null,
“Tooltip”: null,
“Placeholder”: null,
“Widget”: null,
“IsRequired”: false,
“IsPrincipal”: true,
“ArgumentType”: 0,
“DataSourceItems”: null
},
{
“Name”: “WriteRangeConnections_1_Connection0”,
“DisplayName”: “WriteRangeConnections_1_Connection”,
“Category”: null,
“Tooltip”: “Write Range”,
“Placeholder”: null,
“Widget”: “Connection”,
“IsRequired”: true,
“IsPrincipal”: true,
“ArgumentType”: 1,
“DataSourceItems”: null
}
]
}

@KevinE,

I upgraded my studio to your version and I’m not getting those json files.

image

image

Try to reinstall the Studio may be this will solve the behavior.

Thanks,
Ashok :slight_smile:

Is it a Library type of project?

@KevinE & @efelantti ,

Yes json gets created for library type project and it’s expected behavior. Sorry if I missed the project type.

image

For Library type of the project all workflows inside it will have associated json file.

This Json file will contain metadata about the activity like if I right click and click on Activity Layout and add some details about the activity.

image

Json associated with the activity will get updated with that.

image

More details about this json:

In UiPath, a Library project is a type of project that allows you to create reusable components or workflows that can be easily shared and integrated into other automation projects. Each workflow within a Library project can have an associated JSON file, which is known as the project.json file. This file contains metadata and configuration settings for the workflow.

Here’s why a JSON file is associated with each workflow in a Library project:

  1. Metadata: The project.json file contains metadata about the workflow, such as its name, description, version number, author information, and dependencies. This metadata helps users understand the purpose and usage of the workflow.
  2. Configuration Settings: The project.json file also contains configuration settings that define how the workflow is executed, such as its input and output arguments, dependencies on other packages or libraries, and runtime settings.
  3. Integration: Having a JSON file associated with each workflow makes it easier to integrate the workflows into other automation projects. The JSON file provides a standardized way to define the workflow’s metadata and configuration settings, making it easier for other developers to understand and use the workflow.
  4. Versioning and Dependency Management: The project.json file allows you to specify dependencies on other packages or libraries, which are required for the workflow to function correctly. This helps with versioning and dependency management, ensuring that the workflow always uses the correct versions of its dependencies.
  5. Automation of Processes: The JSON file can also be used in automation processes, such as deploying or managing the workflow in an Orchestrator environment. The metadata and configuration settings contained in the JSON file can be accessed programmatically to automate tasks related to the workflow’s lifecycle.

Overall, the JSON file associated with each workflow in a Library project plays a crucial role in defining metadata, configuration settings, and dependencies, making it easier to create, share, and integrate reusable components into automation projects.

Thanks,
Ashok :slight_smile:

@efelantti & @ashokkarale no it isn’t a Library.

When I create a blank process, here is the project panel at first:

image

But if I click Refresh, or update any package, the extra .json file is visible:

image

If I delete the Main.xaml.json, and run the process, it does not get re-created yet.

image

If I create a new Sequence, there is still no extra .json created:

image

But now if I Invoke the new Sequence.xaml from Main.xaml, and either save or run the file, then the Main.xaml.json file gets created again.

Again, I can delete the extra .json file. But now if I make any changes to the Import Arguments, or invoke another workflow file, the extra .json file keeps coming back again. So it seems related to Arguments.

I can’t uninstall / reinstall Studio to test if that changes the behavior.

The Main.xaml.json file in UiPath is a metadata file automatically generated by UiPath Studio for each workflow file (e.g., Main.xaml). Its purpose is to store information about the workflow, including metadata for arguments, variables, dependencies, and activity properties. Here’s a more detailed breakdown of what it typically contains and why it’s important:

Contents of `Main.xaml.json

Workflow Metadata: Information about the structure of the workflow, including argument names, types, and directions (In, Out, or In/Out). It helps UiPath Studio and other tools understand how to interact with the workflow.
Variable and Argument Information: The file may store data about variables and arguments defined within the workflow, including their types and scopes.
Activity Properties: Details about properties of activities within the workflow, which can be helpful for debugging or for tools that need to understand the workflow’s requirements.
Dependencies: Information on dependencies used by the workflow, such as packages required for specific activities or features.

Why is Main.xaml.json Important?

Project Compatibility: When a workflow (.xaml) is loaded, UiPath Studio uses the .json file to understand how to handle different elements within the workflow. This is especially important when workflows have complex arguments or use activities that depend on specific packages.
Studio Features: UiPath Studio uses these .json files for various internal features, such as automatically recognizing arguments when you invoke a workflow within another project.
Version Control: The .json file assists in tracking changes in workflows when using version control systems like Git.

Can You Modify or Delete the Main.xaml.json File?

Direct Modification: Generally, you should not manually edit the .json files because they are auto-generated and managed by UiPath Studio. Editing them might result in inconsistencies or errors when opening or running the workflow.
Deleting the File: If you accidentally delete a .json file, UiPath Studio will typically regenerate it when you open the associated .xaml file. However, it’s best to avoid deleting it, as this might cause temporary issues with loading workflows or configurations.

In summary, Main.xaml.json serves as a supporting metadata file for the corresponding Main.xaml workflow. It is automatically created and managed by UiPath Studio to store essential information that helps with workflow execution and interoperability.

Why would you delete files it’s creating? These files are where various properties/settings are stored.