Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Uipath rpa/Library-authoring-guide
Reference · Uipath rpa

Library-authoring-guide

Part of Uipath rpa. Install the skill and your agent reads this page when it needs the depth.

Library Authoring Guide

How to produce a reusable library: a NuGet package whose public workflows surface as activities in every consuming project's panel. For finding and consuming libraries that already exist, see tenant-library-search-guide.md.

When to Build a Library

Good fit:

Not a fit:

Boundaries:

Need Go to
Start new projects from a standard baseline Project templates — environment-setup.md § Template Selection
Share UI selectors across projects UI Libraries — uia-policies-catalog.md § Object Repository as a Published UI Library
Reuse logic inside one project Separate workflow file — environment-setup.md § Designing for Reuse

Creating and Structuring

uip rpa init \
  --name "<LIBRARY_NAME>" \
  --location "<PARENT_DIR>" \
  --template-id "LibraryProcessTemplate" \
  --expression-language <VisualBasic|CSharp> \
  --target-framework <Windows|Portable> \
  --description "<DESCRIPTION>" \
  --output json

Public vs private workflows

Every workflow file is public by default — packed as an activity. To keep a helper internal, add its filename to project.json:

"designOptions": {
  "libraryOptions": {
    "privateWorkflows": [
      "ValidateEmailFormat.xaml"
    ]
  }
}

Private workflows compile into the package and stay invocable from the library's own workflows, but no activity is generated for consumers.

Activity identity

Activity Layout — the sidecar file

Each public workflow can ship as a rich activity: custom display name, tooltip, color, SVG icon, and per-property display names, placeholders, input widgets, required flags, and category grouping. All of it is authored in a sidecar JSON next to the workflow — <WORKFLOW_NAME>.xaml.json:

{
  "DisplayName": "Send Invoice Notification",
  "Tooltip": "Sends an invoice notification email and returns a delivery summary",
  "Color": "#1F8FFF",
  "OriginalIconFileName": "SendInvoiceNotification.xaml.svg",
  "Arguments": [
    {
      "Name": "in_RecipientEmail",
      "DisplayName": "Recipient email",
      "Category": "Input",
      "Tooltip": "Email address that receives the notification",
      "Placeholder": "someone@company.com",
      "Widget": "TextComposer",
      "IsRequired": true,
      "IsPrincipal": true,
      "ArgumentType": 0
    },
    {
      "Name": "in_UrgentDelivery",
      "DisplayName": "Urgent delivery",
      "Category": "Options",
      "Tooltip": "Send with high priority",
      "Widget": "Toggle",
      "IsRequired": false,
      "IsPrincipal": false,
      "ArgumentType": 0
    }
  ]
}

Rules:

  1. Arguments[].Name must match the XAML argument name exactly — the sidecar decorates arguments, it does not declare them.
  2. The sidecar wins over XAML annotations. Without a sidecar, the argument annotation is the tooltip and the file name is the display name; the sidecar overrides both and adds everything else.
  3. Icon: place an SVG next to the workflow as <WORKFLOW_NAME>.xaml.svg and reference it in OriginalIconFileName. pack embeds it as a package resource.
  4. Widget is the property's input type (Studio: "Input type"). Valid values depend on the argument's type — omit Widget for the type's default editor:
Argument type Widget values
String TextComposer (default), RichTextComposer, Dropdown, AutocompleteForExpression, RadioGroup
Boolean / bool? Toggle (default), ConditionBuilder, NullableBoolean
Numeric Number (default), Dropdown
DateTime Datetime
TimeSpan Timespan
String[] StringArray
Dictionary Dictionary

DataSourceItems (string array of choices) applies only to Dropdown, RadioGroup, and AutocompleteForExpression. 5. Category groups properties in the activity's body, in sidecar argument order; IsPrincipal: true surfaces the property on the activity card, IsRequired: true marks it mandatory. 6. HelpLink is a valid sidecar field but stays design-time only — it does not ship in the compiled activity metadata. 7. ArgumentType is 0 for plain arguments.

pack compiles the sidecar into the activity metadata embedded in the library assembly — consumers see the layout in their Activities panel with no extra steps.

The Public-Workflow Contract — MANDATORY

Each public workflow is an API surface. Apply every rule:

  1. Name workflows verb-noun PascalCase, no spaces — SendNotificationEmail.xaml, DownloadInvoices.xaml. The file name becomes the activity name in the consumer's panel.
  2. Public arguments follow the Workflow Analyzer naming rules in force, as every workflow argument does (SKILL.md Common Rule 4c): PascalCase after whatever prefixes those rules require. Argument names become activity property names, which consumers' XAML attributes and coded calls use as written; give each public argument a display name in the layout sidecar (§ Activity Layout) and the property grid shows readable labels.
  3. Describe every public argument via its sap2010:Annotation.AnnotationText — descriptions ship as property tooltips. For display names, placeholders, widgets, and grouping, add the layout sidecar (§ Activity Layout).
  4. Leave no analyzer naming warning. build/pack report each argument whose name breaks a naming rule in force (Argument <Name> does not respect the set pattern …, doesn't have datatable prefix); rename it before packing. A published library's existing public arguments keep their names and their warnings: renaming one is a breaking change (§ Versioning), and the compatible change, a new argument beside the old, follows the rules.
  5. Return application handles. A workflow that opens or attaches to an app outputs the window/browser object, its card's Close set to Never so the window outlives the call; downstream public workflows accept it as an input argument instead of reopening, and the workflow that ends the application's work closes it with Close Always on its card.
  6. Post-authoring audit: before packing, re-check every public workflow against rules 1-3 — name form, argument naming, argument descriptions.

Error Contract

Versioning

projectVersion in project.json is the package version (override at pack time with --package-version). Follow SemVer:

Bump When Consumer impact
Patch x.x.1 Bug fix, no interface change Safe drop-in
Minor x.1.x New workflow or new optional argument, backward compatible Safe upgrade
Major 1.x.x Renamed/removed workflow or argument, changed behavior Code changes required
  1. Renaming a public workflow or argument is a breaking change — major bump. To change an argument compatibly, add a new one and keep the old.
  2. Never delete published versions from the feed — consumers pin them. libraries delete is for mistaken uploads only.
  3. Consumers pin exact versions in production.

Pack & Publish

uip rpa pack "<PROJECT_DIR>" "<OUTPUT_DIR>" --output json
uip rpa publish "<OUTPUT_DIR>/<LIBRARY_NAME>.<VERSION>.nupkg" --output json
uip or libraries list --search "<LIBRARY_NAME>" --output json

Returns the library with Key = <PackageId>:<Version> and ProjectType: "ProcessLibrary".

Consumption Loop

  1. Discover existing libraries before building new ones — tenant-library-search-guide.md (SKILL.md Rule 9).
  2. Install into the consumer as a dependency — SKILL.md § Resolving Packages & Activity Docs. The install records the dependency in the consumer's project.json; the library's activities become available.
  3. Build-time resolution: signed in, build and pack restore the library from the tenant's libraries feeds, as the install does; no extra NuGet source is needed.
  4. Author against the library in consumer XAML. Once the library is installed, activities find returns its public workflows and activities get-default-xaml returns each one's element with its arguments as properties, without their types or directions — read those from the package itself:
uip or libraries download "<PackageId>:<Version>" --destination "<LOCAL_DIR>/<LIBRARY_NAME>.<VERSION>.nupkg" --output json
uip rpa packages inspect --nupkg-path "<LOCAL_DIR>/<LIBRARY_NAME>.<VERSION>.nupkg" --output json

Declare the namespace and use each public workflow as an element — property names = the library's argument names:

<Activity ... xmlns:lib="clr-namespace:<SANITIZED_NAMESPACE>;assembly=<LIBRARY_NAME>">
  <lib:SendInvoiceNotification in_RecipientEmail="..." in_InvoiceId="..." />

<SANITIZED_NAMESPACE> is the underscore form from § Activity identity. Bind non-literal properties per the project's expression language rules (xaml/xaml-basics-and-rules.md).

  1. Stale design session after the dependency becomes resolvable: build compiles the consumer but validate keeps failing with Cannot create unknown type for the library activity. Run uip rpa project close --project-dir "<CONSUMER_PROJECT_DIR>" and re-run validate; the next command reloads the project.
  2. Same version repacked: the package cache keeps the first package under an id and version and ignores a repack, so bump the library version whenever a consumer must see a change.
  3. Dependency floor: the consumer's version of each package the library depends on is at least the library's. A consumer pinned lower validates and builds with only a warning, Detected package downgrade: <PACKAGE_ID> from <LIBRARY_VERSION> to <CONSUMER_VERSION>, then fails at run time loading the library's assembly version (Could not load file or assembly '<PACKAGE_ID>, Version=…'). Treat that warning as an error: raise the consumer's dependency to the version it names.

Library Patterns

Pattern Shape Example
Wrapper Bundle related operations into one higher-level activity OpenExcelAndReadSheet instead of Open Workbook + Read Range
Connector One library per corporate system — single source of auth, selectors, business rules CompanyERP.Library owns all ERP interactions
Framework Scaffolding consumers extend (REFramework-style) State machine with extension points
Data access Centralize database/API access behind typed activities GetCustomerById returns a row from any backend

Pitfalls

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.