2.2 Configuration Management: Settings, Constants, and Assets
Key Takeaways
REFramework reads
Data\Config.xlsxinto an in-memoryDictionary(Of String, Object)namedConfigduring the first run of Initialization.The workbook has three sheets: Settings (environment values, including OrchestratorQueueName and OrchestratorQueueFolder), Constants (framework behavior such as MaxRetryNumber, MaxConsecutiveSystemExceptions, and ShouldMarkJobAsFaulted), and Assets (Orchestrator assets to load).
Values in
Configare stored asObjectand must be converted with.ToString,CInt,CBool, orConvertmethods before use.A missing asset only logs a Warn in the standard InitAllSettings.xaml, so mandatory assets need an explicit check.
Store only credential asset names in Config.xlsx; fetch the secret with Get Credential inside the login workflow.
2.2 Configuration Management: Settings, Constants, and Assets
Core Concept: Enterprise automation solutions must strictly separate program logic from operational parameters. UiPath REFramework implements externalized configuration through
Data\Config.xlsxand theInitAllSettings.xamlworkflow. At runtime, these parameters are compiled into an in-memoryDictionary<string, object>, ensuring that environment endpoints, operational thresholds, and Orchestrator assets can be altered without modifying or recompiling the underlying automation package.
Hardcoded strings, static timeouts, and embedded environment URLs represent severe technical debt in enterprise RPA. If a test server changes its DNS hostname or an API gateway timeout requires extension from 30 seconds to 60 seconds, a hardcoded process requires source code modification, version bumping, peer review, and re-deployment through CI/CD pipelines. By isolating variables in Data\Config.xlsx and UiPath Orchestrator, developers ensure that processes remain fully configurable across Development, Test, UAT, and Production environments.
1. Anatomy of Data\Config.xlsx
The standard configuration file is stored in the project's root subdirectory under Data\Config.xlsx. It is structured into three standard worksheets, each serving a distinct operational role:
Data\Config.xlsx
├── [Worksheet] Settings --> Business & Environment-specific parameters (URLs, file paths, switches)
├── [Worksheet] Constants --> Core Framework mechanics & thresholds (MaxRetryNumber, timeouts, queue names)
└── [Worksheet] Assets --> UiPath Orchestrator Assets to fetch dynamically at startup
The Settings Sheet
The Settings sheet houses environment-specific and business-level parameters. It contains three columns: Name, Value, and Description.
Name: The unique string key used to index the configuration dictionary (e.g.,"ACME_URL","InvoiceExportDirectory","BatchProcessingLimit").Value: The setting value (e.g.,"https://acme-test.uipath.com","C:\Automation\Invoices\",50).Description: Human-readable documentation detailing what the parameter controls, its acceptable values, and which systems it impacts.
Typical entries on the Settings sheet include portal URLs, shared network folder paths, email notification distribution lists, and feature toggles (such as "EnableDetailedLogging" = True). The template itself ships with three rows here: OrchestratorQueueName, OrchestratorQueueFolder, and logF_BusinessProcessName.
The Constants Sheet
The Constants sheet defines how the framework itself behaves. Like Settings, it uses Name, Value, and Description columns. The values below are the ones the template ships with. Teams often add rows such as timeout values, but those are project additions, not template defaults.
| Constant | Template value | What it controls |
|---|---|---|
MaxRetryNumber | 0 | Robot-level retries after a System Exception for non-queue data. The template's description says it must stay 0 when working with Orchestrator queues. |
MaxConsecutiveSystemExceptions | 0 | Stops the job after this many System Exceptions in a row; 0 disables the check. |
ExScreenshotsFolderPath | Exceptions_Screenshots | Folder (relative or full path) where TakeScreenshot.xaml saves error screenshots. |
LogMessage_GetTransactionData, LogMessage_Success, LogMessage_BusinessRuleException, LogMessage_ApplicationException | Text | Static parts of the framework's standard log messages. |
ExceptionMessage_ConsecutiveErrors | Text | Message used when the consecutive-exceptions limit stops the job. |
RetryNumberGetTransactionItem, RetryNumberSetTransactionStatus | Number | How many times the framework retries the Orchestrator calls that fetch an item or set its status. |
ShouldMarkJobAsFaulted | False | When True, a System Exception in Initialization (including the consecutive-exceptions stop) ends the job as Faulted instead of Successful. |
Note
OrchestratorQueueName and OrchestratorQueueFolder sit on the Settings sheet, not on Constants. Questions about where a key belongs are common.
The Assets Sheet
The Assets sheet links the robot to centralized, centrally managed configuration objects stored within UiPath Orchestrator. The sheet contains four columns:
Asset: The exact asset name as registered in UiPath Orchestrator.Name: The local key name under which the retrieved asset value will be stored inside theConfigdictionary. In standard implementations,Nameis set identical toAsset.OrchestratorAssetFolder: The Orchestrator folder (such as"Shared","Finance/Production", or empty for default root folder) containing the asset.Description: Informational context outlining the asset's purpose and security classification.
2. Execution Mechanics of InitAllSettings.xaml
The InitAllSettings.xaml workflow is responsible for reading Data\Config.xlsx and constructing the dictionary. The workflow follows a strict sequence of operations:
[Start InitAllSettings]
│
▼
[Initialize Dictionary: Config = New Dictionary(Of String, Object)]
│
▼
[For Each Sheet in {"Settings", "Constants"}]
│
├─► [Read Range: Read sheet into DataTable]
│
└─► [For Each Row in DataTable]
│
├─► [Check: Not String.IsNullOrWhiteSpace(row("Name").ToString.Trim)]
│
└─► [Assign: Config(row("Name").ToString.Trim) = row("Value")]
│
▼
[Read Range: Read "Assets" sheet into dt_Assets]
│
▼
[For Each Row in dt_Assets]
│
└─► [TryCatch Block]
│
├─► [Get Asset Activity (using row("Asset") and folder)]
│
├─► [Assign: Config(row("Name").ToString.Trim) = AssetValue]
│
└─► [Catch Exception: log a Warn message and continue]
│
▼
[Output: out_Config returned to Main.xaml]
Step-by-Step Breakdown:
-
Dictionary Instantiation:
out_Config = New Dictionary(Of String, Object)The dictionary is initialized with string keys and
Objectvalues, allowing it to store heterogeneous data types. -
Parsing Local Sheets (
SettingsandConstants):- The workflow loops over an array of sheet names:
{"Settings", "Constants"}. - The
Read Rangeactivity loads each sheet into a temporaryDataTable. - A
For Each Rowactivity iterates through the rows, filtering out blank lines or header comments:If Not String.IsNullOrWhiteSpace(row("Name").ToString.Trim) Then out_Config(row("Name").ToString.Trim) = row("Value") End If
- The workflow loops over an array of sheet names:
-
Resolving Orchestrator Assets:
- The workflow reads the
Assetssheet intodt_Assets. - For each row containing a non-empty
Assetname, the workflow executes the Get Asset activity. - If an Orchestrator folder is specified in
row("OrchestratorAssetFolder"), the activity directs the query to that specific folder hierarchy. - The returned asset value is stored into the dictionary under
row("Name").ToString.Trim.
- The workflow reads the
-
Defensive Asset Exception Handling:
- Each asset lookup sits inside a
TryCatchactivity. - If an asset cannot be found (misspelled name, wrong folder, or missing permission), the template logs a Warn message such as
Loading asset ACME_URL failed: ...and moves on to the next row. It does not rethrow. - The key is simply never added to
Config, so the problem surfaces later as aKeyNotFoundExceptionthe first time a workflow reads that key. - For assets the process cannot run without, add your own check (or a Rethrow in that Catch) so the job fails fast in Initialization rather than in the middle of a transaction.
- Each asset lookup sits inside a
3. Data Boxing and Type Casting in VB.NET
Because the Config dictionary is defined as Dictionary<string, object>, every value stored inside it is boxed as a System.Object. When accessing parameters in business workflows, developers must unbox or cast the object into its strongly typed representation.
' Common Unboxing and Conversion Patterns in REFramework (VB.NET)
' 1. String Extraction
Dim targetUrl As String = Config("ACME_URL").ToString
' 2. Integer Conversion (Timeouts, Counters, Port Numbers)
Dim timeoutMs As Integer = Convert.ToInt32(Config("TimeoutMedium"))
Dim maxRetries As Integer = CInt(Config("MaxRetryNumber"))
' 3. Boolean Conversion (Feature Flags, Switches)
Dim isDebugMode As Boolean = Convert.ToBoolean(Config("EnableDebugMode"))
Dim autoSendEmail As Boolean = CBool(Config("SendNotificationEmails"))
' 4. Double / Decimal Conversion (Financial thresholds, limits)
Dim approvalThreshold As Double = CDbl(Config("InvoiceThresholdAmount"))
' 5. TimeSpan Conversion
Dim delayDuration As TimeSpan = TimeSpan.FromSeconds(Convert.ToDouble(Config("DelayBetweenRequests")))
Defensive Key Access
Attempting to access a key that does not exist in the dictionary throws a System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
To prevent unhandled runtime errors when reading optional settings, developers use defensive ternary checks:
' Safe Dictionary Access Pattern
Dim reportFolder As String = If(Config.ContainsKey("ReportDirectory"),
Config("ReportDirectory").ToString,
"C:\DefaultReports\")
4. Orchestrator Assets vs. Local Settings
Architecting enterprise automations requires deciding which parameters belong in Data\Config.xlsx and which belong in UiPath Orchestrator Assets:
| Evaluation Criteria | Local Data\Config.xlsx (Settings/Constants) | UiPath Orchestrator Assets |
|---|---|---|
| Update Mechanism | Requires updating file in project package and redeploying. | Real-time update via Orchestrator Web UI or API without package redeployment. |
| Security & Encryption | Plaintext stored on disk; insecure for passwords or secret tokens. | Encrypted in Orchestrator database; supports AES-256 encrypted Credential Assets. |
| Scope & Sharing | Strictly local to the specific robot and process package. | Can be shared across multiple robots, departments, processes, and folders. |
| Environment Promotion | Values must be manually adjusted or swapped per environment branch. | Identical code uses same asset name; Dev/UAT/Prod folders provide environment-specific values. |
| Best Used For | Fixed framework timeouts, internal constants, standard folder naming. | System URLs, API keys, operational feature flags, credentials, environment switches. |
Managing Credentials Securely
Caution
Never store plaintext passwords, secret keys, or access tokens in Data\Config.xlsx.
The enterprise best practice for managing login credentials in REFramework is:
- Store the credential in UiPath Orchestrator as an Asset of type Credential.
- In
Data\Config.xlsxunder theAssetsorSettingssheet, store only the name of the credential asset (e.g.,"ACME_Credential"). - Inside the specific application login workflow (e.g.,
ACME_Login.xaml), passConfig("ACME_Credential").ToStringinto aGet Credentialactivity. - The
Get Credentialactivity outputs the username as aStringand the password as aSystem.Security.SecureString. - Pass the
SecureStringdirectly into modernType Into(withSecureTextenabled) orUse Application/Browseractivities without ever converting it to plaintext in memory.
+-----------------------------------------------------------------------------------+
| SECURE CREDENTIAL ARCHITECTURE |
| |
| [Config.xlsx] [UiPath Orchestrator] |
| Key: "ACME_CredentialName" Asset Name: "ACME_Credential" |
| Value: "ACME_Credential" Type: Credential (Encrypted) |
| │ │ |
| ▼ ▼ |
| [Main.xaml / Config Dictionary] │ |
| Config("ACME_CredentialName") ──────────────┤ |
| ▼ |
| [Get Credential Activity] |
| in_CredentialName = "ACME_Credential" |
| │ |
| ┌────────┴────────┐ |
| ▼ ▼ |
| out_Username out_Password |
| (String) (System.Security.SecureString) |
| │ │ |
| └────────┬────────┘ |
| ▼ |
| [Type Into (Secure)] |
+-----------------------------------------------------------------------------------+
5. Architectural Best Practices for Configuration Management
- Treat
Configas Read-Only at Runtime: TheConfigdictionary should be populated strictly duringInitialization. Do not write code that modifies or inserts keys intoConfigduringProcess Transaction. Mutating global configuration during transactional execution creates race conditions, impairs debugging, and violates modular workflow encapsulation. - Pass
in_ConfigStrictly by Value: When invoking child workflows fromMain.xamlorProcess.xaml, pass the configuration object using the directionIn(in_Config). Do not useInOut(io_Config) unless a workflow's explicit purpose is configuration modification. - Standardize Naming Conventions:
Prefix asset keys logically to clarify their system affiliation and type (e.g.,
ACME_URL,ACME_Credential,SAP_ClientNumber,Timeout_Short). - Modern Folder Scoping:
Always populate the
OrchestratorAssetFoldercolumn when working in modern Orchestrator folder hierarchies. This ensures the robot queries the correct tenant subfolder rather than failing on an ambiguous asset query.
What is the primary rationale for populating configuration parameters into a Dictionary<string, object> rather than a Dictionary<string, string> in REFramework?
It speeds up garbage collection cycles during unattended background execution.
It allows the dictionary to store varied data types such as integers, booleans, and complex objects without pre-converting them to strings.
It enables native JSON serialization without requiring external assembly references.
It avoids KeyNotFoundException errors when attempting to query missing dictionary keys.
In the standard InitAllSettings.xaml, what happens when the Get Asset activity cannot find an asset listed on the Assets sheet?
The workflow creates an empty placeholder asset in the tenant's root folder and continues.
The Try Catch around the lookup logs a Warn message naming the asset and the loop continues, so the key is missing from Config until a workflow tries to read it.
The robot pauses until an administrator creates the asset in Orchestrator.
Initialization always rethrows, so the job ends before Get Transaction Data runs.
Which design pattern represents the recommended enterprise standard for handling sensitive user credentials within REFramework?
Store the Orchestrator Credential asset name in Config.xlsx, and invoke Get Credential within the target login workflow to retrieve a SecureString.
Encrypt the password using Base64 encoding and store the cipher string directly in the Constants sheet of Data\Config.xlsx.
Store the plaintext username and password in the Settings sheet and protect the workbook with a master spreadsheet password.
Hardcode credentials as default values in the workflow argument definitions of InitAllApplications.xaml.
Sections you finish are checked off in the contents.