- Overview
- Get started
- Concepts
- Using UiPath CLI
- How-to guides
- CI/CD recipes
- Command reference
- Overview
- Exit codes
- Global options
- uip codedagent
- uip coder
- uip context-grounding
- uip docsai
- uip function
- uip guardrails
- uip llm-configuration
- uip llm-gateway
- uip model-hub
- add-test-data-entity
- add-test-data-queue
- add-test-data-variation
- analyze
- build
- create-project
- diff
- find-activities
- get-analyzer-rules
- get-default-activity-xaml
- get-errors
- get-manual-test-cases
- get-manual-test-steps
- get-library-object-repository
- get-object-repository
- get-versions
- get-workflow-example
- indicate-application
- indicate-element
- inspect-package
- install-data-fabric-entities
- install-or-update-packages
- list-data-fabric-entities
- list-instances
- list-workflow-examples
- pack
- publish
- remote
- restore
- run, debug & execution
- run-file
- search-templates
- start-studio
- stop-execution
- tm
- uia
- uip tasks
- uip traces
- uip traces feedback
- Migration
- Reference & support
uip function
Syntax and options for `uip function`, which builds, serves, runs, and publishes UiPath JS/TS and Python Functions.
uip function builds, serves, and publishes UiPath Functions — small JS/TS or Python handlers packaged and run on the UiPath platform. uip function is the canonical group name; uip functions (plural) is accepted as an alias.
Concepts
- This is a language dispatcher, not a native tool. Every verb except
setupis a thin forwarder: the CLI detects your project's language (fromuipath.json,package.json, orpyproject.tomlin the current directory, or--language/-lonnew) and routes the raw arguments to either an in-process JS/TS CLI (@uipath/coded-functions-js-cli) or a spawned Python CLI. Flags the wrapper does not declare are forwarded unchanged to the underlying CLI. - Language resolution matters for
initandnew.initis Python-only — for JS/TS, scaffold instead withnew --empty.newauto-detects; when detection is inconclusive, it defaults to TypeScript with a logged warning, unless you pass--language js|ts|py/python. setupverifies the toolchains. It checks Node.js ≥20 for JS/TS projects, and Python with theuipathpackage for Python projects. The Node.js check also runs automatically beforenewforwards to the JS/TS CLI. Python Functions commands fail with aConfigErrorthat points touip function setupuntil Python is configured.publishvs.pushtarget different destinations:publishuploads the packed.nupkgto an Orchestrator feed;pushsyncs the project directly into a Studio Web project. Both accept--url/--org/--token(or the matchingUIPATH_URL/UIPATH_ORGANIZATION_NAME/UIPATH_ACCESS_TOKENenv vars).- Solution auto-registration. A successful Python
initauto-registers the project into a parent.uipxsolution when one exists (same pattern asagent/case/flowinit) — pass--skip-solution-registrationto opt out. This reports via a separateFunctionsInitSolutionRegistrationsuccess envelope after the underlying Python CLI's own init output.
Synopsis
uip function setup [--force]
uip function new [name] [--name <name>] [-l, --language ts|js|py] [--empty]
uip function init [--language py] [--skip-solution-registration]
uip function serve [--port <port>] [--runtime node|deno]
uip function run [name] [--input <json>] [--input-file <path>]
uip function pack
uip function push [--url <url>] [--project-id <id>] [--org <org>] [--token <token>]
uip function publish [--url <url>] [--org <org>] [--token <token>] [--feed-id <id>]
uip function runtime-install [--path <folder>]
uip function setup [--force]
uip function new [name] [--name <name>] [-l, --language ts|js|py] [--empty]
uip function init [--language py] [--skip-solution-registration]
uip function serve [--port <port>] [--runtime node|deno]
uip function run [name] [--input <json>] [--input-file <path>]
uip function pack
uip function push [--url <url>] [--project-id <id>] [--org <org>] [--token <token>]
uip function publish [--url <url>] [--org <org>] [--token <token>] [--feed-id <id>]
uip function runtime-install [--path <folder>]
uip function setup
Verify the toolchains a Functions project needs: Node.js v20 or later for JS/TS, and Python with the uipath package for Python. A missing or outdated Node.js fails the command with a ConfigError. A missing Python configuration is reported but does not fail the command, so JS/TS-only machines are not blocked. The result is cached and shared with uip codedagent setup, so running either command configures Python for both.
Options
| Long | Value | Description |
|---|---|---|
--force | flag | Re-run the verification even when a cached result exists. Default: false. |
Example
uip function setup --force
uip function setup --force
uip function new
Scaffold a new Functions project, including a hello-world function by default.
Arguments
| Name | Required | Purpose |
|---|---|---|
[name] | no | Project name / directory. Default my-functions. May also be passed as --name. |
Options
| Long | Value | Description |
|---|---|---|
--name <name> | string | Alternative to the positional argument. |
-l, --language <lang> | ts (default) | js | py/python | Project language. |
--empty | flag | Skip the hello-world function — empty project. JS/TS only. |
Examples
uip function new my-fn --language ts
uip function new my-fn --language py
uip function new my-fn --language ts
uip function new my-fn --language py
Data shape (--output json)
{ "Code": "NewComplete", "Data": { "Message": "Project created at ./my-fn" } }
{ "Code": "NewComplete", "Data": { "Message": "Project created at ./my-fn" } }
uip function init
Python-only: discover entrypoints and (re)generate entry-points.json/bindings.json/project.uiproj. Must run before pack/push for a Python project. For JS/TS, use new --empty instead — init fails with an explicit "Python-only" error against a JS/TS project or an undetected language.
Options
| Long | Value | Description |
|---|---|---|
--language py | flag/value | Force Python language resolution when detection would otherwise be ambiguous. |
--skip-solution-registration | flag | Do not auto-register the project in a parent .uipx solution. |
Example
uip function init
uip function init
Data shape (--output json)
{ "Code": "InitComplete", "Data": { "Message": "Project initialized." } }
{ "Code": "InitComplete", "Data": { "Message": "Project initialized." } }
Followed by a second success envelope reporting solution registration:
{
"Code": "FunctionsInitSolutionRegistration",
"Data": { "SolutionRegistration": { "Status": "Registered", "...": "..." } }
}
{
"Code": "FunctionsInitSolutionRegistration",
"Data": { "SolutionRegistration": { "Status": "Registered", "...": "..." } }
}
SolutionRegistration.Status is "NotInSolution" when no parent solution exists, or "OptedOut" when --skip-solution-registration was passed — always present, never omitted.
uip function serve
Start the local function server with hot reload. JS/TS only.
Options
| Long | Value | Description |
|---|---|---|
--port <port> | integer | Port to listen on. Default 7070. |
--runtime <runtime> | node (default) | deno | Runtime to serve under. |
Example
uip function serve
uip function serve
Data shape (--output json)
{ "Code": "ServeStarted", "Data": { "Message": "Listening on http://localhost:7070" } }
{ "Code": "ServeStarted", "Data": { "Message": "Listening on http://localhost:7070" } }
uip function run
Run one function once and print its result. The function name comes from your project's function list.
Arguments
| Name | Required | Purpose |
|---|---|---|
[name] | no | Name of the function to run. |
Options
| Long | Value | Description |
|---|---|---|
--input <json> | JSON | Input payload. Default {}. |
--input-file <path> | path | Path to a JSON input file. On JS/TS projects, takes precedence over --input. |
Examples
# Python project: run the 'hello' function once with a JSON payload and read the result as JSON
uip function run hello --input '{"name":"Ada"}' --output json
# Python project: run a function with a payload kept in a file
uip function run hello --input-file ./payload.json --output json
# Python project: run the 'hello' function once with a JSON payload and read the result as JSON
uip function run hello --input '{"name":"Ada"}' --output json
# Python project: run a function with a payload kept in a file
uip function run hello --input-file ./payload.json --output json
Data shape (--output json)
{ "Code": "RunComplete", "Data": { "message": "Hello, Ada!" } }
{ "Code": "RunComplete", "Data": { "message": "Hello, Ada!" } }
The structured result applies to Python projects when you pass --output json or --output yaml explicitly:
Datais the function's own output, with its field names kept exactly as the function declares them.- When the function returns a scalar, an array, or nothing, the value is placed under a single
Outputkey. - Progress and the run's own logs go to stderr, so stdout carries only the envelope.
- A failed run returns
Result: "Failure"withErrorCode: "unknown_error"and the run's exit code inMessage; the run's own error is on stderr.
Without an explicit --output json/yaml, or with table or plain, run prints the underlying CLI's own output. On JS/TS projects, --output is not supported by run: the CLI prints a notice and the function's own output follows unchanged.
uip function pack
Pack the project into a .nupkg for deployment. The project's lock file is always included in the package.
Example
uip function pack
uip function pack
Data shape (--output json)
{ "Code": "PackComplete", "Data": { "Message": "Package created: my-fn.0.0.1.nupkg" } }
{ "Code": "PackComplete", "Data": { "Message": "Package created: my-fn.0.0.1.nupkg" } }
uip function push
Sync the project to Studio Web — generates entry points and uploads changed files.
Options
| Long | Value | Required | Description |
|---|---|---|---|
--url <url> | url | no | UiPath platform URL. Falls back to UIPATH_URL. |
--project-id <id> | GUID | conditionally | Studio Web project ID. Mandatory, but may come from UIPATH_PROJECT_ID instead of the flag. |
--org <org> | string | no | Organization name. Falls back to UIPATH_ORGANIZATION_NAME. |
--token <token> | string | no | Access token. Falls back to UIPATH_ACCESS_TOKEN. |
Example
uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001
uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001
Data shape (--output json)
{ "Code": "PushComplete", "Data": { "Message": "Push complete." } }
{ "Code": "PushComplete", "Data": { "Message": "Push complete." } }
uip function publish
Upload the latest .nupkg to an Orchestrator folder. Without --feed-id, prompts interactively for a feed (ESC to cancel) — pass --feed-id for CI use to skip the picker.
Options
| Long | Value | Description |
|---|---|---|
--url <url> | url | UiPath platform URL. Falls back to UIPATH_URL. |
--org <org> | string | Organization name. Falls back to UIPATH_ORGANIZATION_NAME. |
--token <token> | string | Access token. Falls back to UIPATH_ACCESS_TOKEN. |
--feed-id <id> | GUID | Feed to publish to — skips the interactive picker. |
Examples
# Interactive feed picker
uip function publish
# CI use — skip the picker
uip function publish --feed-id 9b2c1d4e-0000-0000-0000-000000000001
# Interactive feed picker
uip function publish
# CI use — skip the picker
uip function publish --feed-id 9b2c1d4e-0000-0000-0000-000000000001
Data shape (--output json)
{ "Code": "PublishComplete", "Data": { "Message": "Package published." } }
{ "Code": "PublishComplete", "Data": { "Message": "Package published." } }
uip function runtime-install
Create a runner folder with its own package.json and install runtime dependencies into it. JS/TS only.
Options
| Long | Value | Description |
|---|---|---|
--path <folder> | path | Target folder to create and install runtime dependencies into. |
Example
uip function runtime-install --path .uipath/runner
uip function runtime-install --path .uipath/runner
Data shape (--output json)
{ "Code": "RuntimeInstallComplete", "Data": { "Message": "Runtime installed at .uipath/runner" } }
{ "Code": "RuntimeInstallComplete", "Data": { "Message": "Runtime installed at .uipath/runner" } }
Error behavior
initagainst a JS/TS project or an undetected language:Failure,Message: "'init' is not applicable to JS/TS projects."(or"'init' is Python-only."), withInstructionsnamingnew --empty/--language.newwith no detectable language and no--language: defaults to TypeScript with a logged warning rather than failing.- No Functions project detected for any other verb:
Failure,Message: "No Functions project detected in this directory.", withInstructionsto run from a directory containinguipath.json/package.json/pyproject.toml, or pass--languageexplicitly. - Node.js missing or below v20 (JS/TS path):
ConfigErrornaming the required version and a link to install it. This check runs insetupand automatically beforenewforwards to the JS/TS CLI. - Python or the
uipathpackage not configured (Python path):ConfigErrorwithInstructionsto runuip function setup.
See also
- Tools (plugins)
uip codedapp— a similarly-shaped build/pack/publish/push/pull lifecycle for coded apps.- Global options
- Exit codes
- Concepts
- Synopsis
- uip function setup
- Options
- Example
- uip function new
- Arguments
- Options
- Examples
- Data shape (--output json)
- uip function init
- Options
- Example
- Data shape (--output json)
- uip function serve
- Options
- Example
- Data shape (--output json)
- uip function run
- Arguments
- Options
- Examples
- Data shape (--output json)
- uip function pack
- Example
- Data shape (--output json)
- uip function push
- Options
- Example
- Data shape (--output json)
- uip function publish
- Options
- Examples
- Data shape (--output json)
- uip function runtime-install
- Options
- Example
- Data shape (--output json)
- Error behavior
- See also