UiPath Documentation
functions
latest
false
函数用户指南
  • 概述
    • 关于函数
  • JavaScript functions
    • 入门指南
    • Building JavaScript functions
    • HTTP triggers and routing
    • Function context
    • 访问平台服务
    • 测试和调试
  • Python 函数
  • 部署并运行
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

关于函数

备注:

此功能目前处于预览阶段。

UiPath® Functions are developer-native, platform-governed units of compute. You write the logic in code, deploy it to UiPath as a standard .nupkg package, and call it from anywhere in a solution:

  • A Maestro process, as a service task.
  • An RPA or API workflow, as a step.
  • An agent, as a tool.
  • An app, as its backend.

They are typed, traceable, testable, and deterministic: no LLM reasoning loop, no model, just code that takes typed input and returns typed output. A function runs alongside RPA robots, agents, and human tasks in the same orchestration layer, and inherits the same platform governance as the rest of your automations:

  • 身份
  • 凭据
  • 审核追踪
  • 访问控制

There is no second stack to host, secure, and keep in compliance.

Choose a language

A function is your code plus a UiPath SDK. Two languages are supported, over one packaging and CLI model.

JavaScript / TypeScriptPython
SDK@uipath/coded-functions-js-sdkuipath
合同TypeScript interfaces, or JSON Schemadataclass or pydantic model
Called asAn HTTP endpoint or an Orchestrator jobAn Orchestrator job
Reach for it whenBacking a Coded App, or writing in the language your web stack already usesData-heavy processing, or the Python ecosystem

Both export their input and output as JSON Schema, so typed fields appear directly in the binding UI on every invocation surface, and both retrieve credentials and platform resources at runtime rather than shipping them in the package.

Every function executes as an Orchestrator job, whichever way it is called. An HTTP trigger creates one per request, so a function called over HTTP still appears in Executions with its input, output, and logs — the two options differ in how you reach a function, not in how it runs.

JavaScript functions

A JavaScript or TypeScript function declares itself with defineFunction. Setting a method and path exposes it as an HTTP endpoint — the shape that backs a Coded App, where the function holds the credentials and business rules the browser must never see. When method and path are not set, the function runs as a job, like its Python counterpart.

Python 函数

A Python function is a typed Python module that runs as an Orchestrator job, retrieves platform resources through the UiPath() client, and emits execution spans through the @traced decorator.

何时使用函数

A function fits wherever a solution needs deterministic, code-first logic — for example:

  • The backend of a Coded App, fetching only what the signed-in user may see and writing back to the system of record.
  • Maestro 流程中的自定义计算或评分步骤。
  • An API integration (NetSuite, SAP, any REST service), or a system with no connector.
  • 流程步骤之间的数据转换或业务规则强制执行。
  • An open-source library, or business logic you already have in code, made reusable across automations.

AI-driven, model-reasoning logic belongs in a coded agent instead.

如何整合在一起

Author (UiPath SDK)Package (pack)  →  Publish
                                              ↓
                                  Orchestrator package feed
                                              ↓
                         Deploy as a process (in an Orchestrator folder)
                                              ↓
  Invoke from:  Maestro Service Task  |  Studio Run Job  |  Orchestrator API  |  Job trigger
                |  an HTTP trigger, for JavaScript functions that declare a route
Author (UiPath SDK)  →  Package (pack)  →  Publish
                                              ↓
                                  Orchestrator package feed
                                              ↓
                         Deploy as a process (in an Orchestrator folder)
                                              ↓
  Invoke from:  Maestro Service Task  |  Studio Run Job  |  Orchestrator API  |  Job trigger
                |  an HTTP trigger, for JavaScript functions that declare a route

后续步骤

  • Choose a language
  • JavaScript functions
  • Python 函数
  • 何时使用函数
  • 如何整合在一起
  • 后续步骤

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新