Skip to content

Commit 3658f17

Browse files
feat(agent): add Flow tool type for Maestro Flow processes (#1670)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5d88894 commit 3658f17

4 files changed

Lines changed: 75 additions & 3 deletions

File tree

packages/uipath/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.10.68"
3+
version = "2.10.69"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath/src/uipath/agent/models/agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class AgentToolType(str, CaseInsensitiveEnum):
112112
PROCESS = "Process"
113113
API = "Api"
114114
PROCESS_ORCHESTRATION = "ProcessOrchestration"
115+
FLOW = "Flow"
115116
INTEGRATION = "Integration"
116117
INTERNAL = "Internal"
117118
IXP = "Ixp"
@@ -779,6 +780,7 @@ class AgentProcessToolResourceConfig(BaseAgentToolResourceConfig):
779780
AgentToolType.PROCESS,
780781
AgentToolType.API,
781782
AgentToolType.PROCESS_ORCHESTRATION,
783+
AgentToolType.FLOW,
782784
]
783785
output_schema: Dict[str, Any] = Field(EMPTY_SCHEMA, alias="outputSchema")
784786
properties: AgentProcessToolProperties
@@ -1322,6 +1324,7 @@ def _normalize_resources(v: Dict[str, Any]) -> None:
13221324
"process": "Process",
13231325
"api": "Api",
13241326
"processorchestration": "ProcessOrchestration",
1327+
"flow": "Flow",
13251328
"integration": "Integration",
13261329
"internal": "Internal",
13271330
"ixp": "Ixp",

packages/uipath/tests/agent/models/test_agent.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,75 @@ def test_process_tool_missing_output_schema(self):
35583558
assert isinstance(tool_resource, AgentProcessToolResourceConfig)
35593559
assert tool_resource.output_schema == {"type": "object", "properties": {}}
35603560

3561+
def test_flow_tool_type_enum_value(self):
3562+
"""AgentToolType.FLOW exists with the wire value 'Flow' and is case-insensitive."""
3563+
assert AgentToolType.FLOW.value == "Flow"
3564+
assert AgentToolType("flow") is AgentToolType.FLOW
3565+
assert AgentToolType("FLOW") is AgentToolType.FLOW
3566+
3567+
def test_flow_tool_resource_deserialization(self):
3568+
"""A resource with type='Flow' is parsed as AgentProcessToolResourceConfig."""
3569+
resources = [
3570+
{
3571+
"$resourceType": "tool",
3572+
"type": "Flow",
3573+
"id": "flow-tool-1",
3574+
"inputSchema": {
3575+
"type": "object",
3576+
"properties": {"input": {"type": "string"}},
3577+
},
3578+
"outputSchema": {"type": "object", "properties": {}},
3579+
"arguments": {},
3580+
"settings": {"timeout": 0, "maxAttempts": 0, "retryDelay": 0},
3581+
"properties": {
3582+
"processName": "MyFlow",
3583+
"folderPath": "/Shared/Flows",
3584+
},
3585+
"name": "Flow Tool",
3586+
"description": "Test Flow tool",
3587+
}
3588+
]
3589+
3590+
json_data = self._agent_dict_with_resources(resources)
3591+
config: AgentDefinition = TypeAdapter(AgentDefinition).validate_python(
3592+
json_data
3593+
)
3594+
3595+
tool_resource = config.resources[0]
3596+
assert isinstance(tool_resource, AgentProcessToolResourceConfig)
3597+
assert tool_resource.type == AgentToolType.FLOW
3598+
assert tool_resource.properties.process_name == "MyFlow"
3599+
assert tool_resource.properties.folder_path == "/Shared/Flows"
3600+
3601+
def test_flow_tool_resource_case_insensitive(self):
3602+
"""A resource with lowercase type='flow' also deserializes via CaseInsensitiveEnum."""
3603+
resources = [
3604+
{
3605+
"$resourceType": "tool",
3606+
"type": "flow",
3607+
"id": "flow-tool-2",
3608+
"inputSchema": {"type": "object", "properties": {}},
3609+
"outputSchema": {"type": "object", "properties": {}},
3610+
"arguments": {},
3611+
"settings": {"timeout": 0, "maxAttempts": 0, "retryDelay": 0},
3612+
"properties": {
3613+
"processName": "MyFlow",
3614+
"folderPath": "/Shared/Flows",
3615+
},
3616+
"name": "Flow Tool",
3617+
"description": "Test Flow tool",
3618+
}
3619+
]
3620+
3621+
json_data = self._agent_dict_with_resources(resources)
3622+
config: AgentDefinition = TypeAdapter(AgentDefinition).validate_python(
3623+
json_data
3624+
)
3625+
3626+
tool_resource = config.resources[0]
3627+
assert isinstance(tool_resource, AgentProcessToolResourceConfig)
3628+
assert tool_resource.type == AgentToolType.FLOW
3629+
35613630
def test_escalation_missing_escalation_type_defaults_to_zero(self):
35623631
"""Test that missing escalationType defaults to 0."""
35633632
resources = [

packages/uipath/uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)