Loading...
Loading...
UiPath Coded Functions — deterministic Python units built via `uip function` (new/init/run/pack/publish); the `functions` map in `uipath.json`, `entry-points.json`, Pydantic Input/Output. Rule-based logic, data transforms, ERP/Integration Service connector calls — no LLM reasoning or agent loop. For LLM/agentic projects (LangGraph, LlamaIndex, OpenAI Agents, `agent.json`)→uipath-agents.
npx skill4agent add uipath/skills uipath-functions| Surface | How |
|---|---|
| Maestro BPMN | Service Task node |
| Maestro Flow | Coded Agent node or Service Task |
| Coded Agents (LangGraph / LlamaIndex / OpenAI Agents) | Called as a tool or step |
| Other Coded Functions | Direct Python call or Orchestrator job |
| Orchestrator API | |
| CLI | |
| Python Coded Function | JS/TS Function | |
|---|---|---|
| Job semantics | Yes — Orchestrator job ID, audit trail, retry, scheduling | No — inline HTTP only, no job lifecycle |
| Invocation | Maestro, Flow, Agents, Orchestrator API | HTTP endpoint (BFF for Coded Apps) |
| Runtime | Serverless or Local Unattended Robot | Serverless HTTP shared tier |
| SDK access | Full UiPath Python SDK (assets, buckets, queues, connections) | Workload token forwarding only |
| Scaffold | | |
| Init | | Not needed |
| Local dev | | |
| Best for | Agentic process steps, ERP integration, document AI, data pipelines | Backend-for-Frontend for Coded Apps |
uip functionuip function new <name> -l py # scaffold a new Python Functions project (--language py required)
uip function init # Python only — generate entry-points.json, bindings.json, project.uiproj
uip function pack # pack to .nupkg for deployment
uip function publish # upload .nupkg to Orchestrator (prompts for feed, or use --feed-id)
uip function push # sync project to Studio Webworks for both Python and JS/TS.uip function runis JS/TS only — it starts the local HTTP server thatuip function serveinvokes against.run
uip function new <name> --language py # Python Coded Function
uip function new <name> --language ts # TypeScript Function (JS/TS, no job semantics)
uip function new <name> --language js # JavaScript Function (JS/TS, no job semantics)--language py--language-l py--language py--emptyuipath-langchainllama-indexopenai-agentsuip function new -l pylanggraph.jsonmain.pylanggraph.jsonmain.pypyproject.toml[project]dependenciesnewBaseModelpydantic.dataclasses.dataclass@dataclassBaseModelpydantic.dataclasses.dataclassfrom pydantic import BaseModel
class Input(BaseModel):
document_id: str = ""
class Output(BaseModel):
vendor_name: str = ""
total_amount: float = 0.0
error_type: str = "" # populated on failure, empty on success
error_message: str = "" # human-readable error detailfrom __future__ import annotations
from pydantic import BaseModel
from uipath.tracing import traced
from uipath.platform import UiPath
class Input(BaseModel):
document_id: str = ""
class Output(BaseModel):
result: str = ""
error_type: str = ""
error_message: str = ""
# Lazy SDK singleton — never instantiate UiPath() at module level
_sdk: UiPath | None = None
def sdk() -> UiPath:
global _sdk
if _sdk is None:
_sdk = UiPath()
return _sdk
@traced(name="my_function", run_type="uipath")
def my_function(input: Input) -> Output:
out = Output()
try:
# SDK calls, data processing, rule-based logic only
asset = sdk().assets.retrieve("MY_ASSET", folder_path="Shared")
out.result = str(asset.value)
except Exception as exc:
out.error_type = "FAILED"
out.error_message = str(exc)
return outBaseModelpydantic.dataclasses.dataclass@dataclassdefasync defasync def mainUiPath()error_typeerror_message@traced(name=..., run_type="uipath")uipath.json{
"runtimeOptions": { "isConversational": false },
"functions": {
"main": "main.py:my_function"
}
}"<file>:<function_name>"functionsdetermine_project_type()uipath.jsonpyproject.toml[project]
name = "my-function"
version = "0.1.0"
description = "..."
authors = [{ name = "Your Name", email = "you@example.com" }]
requires-python = ">=3.11"
dependencies = [
"uipath",
"httpx>=0.28", # if making HTTP calls
"pydantic-settings>=2", # if using Settings for env/asset config
]authorsuip function packProject authors cannot be empty[build-system]functionsuipath.jsonuip function initentry-points.jsonbindings.jsonproject.uiprojpackpushuipath.jsonsdk()from uipath.platform import UiPath
from uipath.platform.connections.connections import ActivityMetadata, ActivityParameterLocationInfo
# Assets — retrieve named credentials or config values
asset = sdk().assets.retrieve("ASSET_NAME", folder_path="Shared")
value = asset.string_value # or credential_username / credential_password
# Buckets — download files for processing
sdk().buckets.download(
name="BucketName",
blob_file_path="relative/path/file.pdf",
destination_path="/tmp/local.pdf",
folder_path="Shared",
)
# Integration Service connections — invoke connector activities (ERP, CRM, etc.)
result = sdk().connections.invoke_activity(
activity_metadata=ActivityMetadata(
object_path="/executeSuiteQL",
method_name="POST",
content_type="application/json",
parameter_location_info=ActivityParameterLocationInfo(body_fields=["q"]),
),
connection_id="<connection-uuid>",
activity_input={"q": "SELECT id FROM vendor WHERE ..."},
)InputAttachmentfrom pydantic import BaseModel
from uipath.platform.attachments import Attachment
class Input(BaseModel):
attachment: Attachmentuip function initAttachmentx-uipath-resource-kind: JobAttachmententry-points.jsonattachment.full_nameattachment.contentuip function pack # creates .nupkg
uip function publish # upload to Orchestrator (interactive feed picker)
uip function publish --feed-id <FEED_ID> # CI/non-interactiveuip function pushUiPath()functionsuipath.jsondetermine_project_type()uipath.jsonuip function initpackpushentry-points.jsonuip function runuip function serverunuip login --organization "<ORG>" --tenant "<TENANT>" --output json