feat(tasks): add QuickForm task creation SDK + agent.json model#1683
feat(tasks): add QuickForm task creation SDK + agent.json model#1683chetanyauipath wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class QuickForm (schema-first HITL) task creation support to the Action Center SDK and extends the agent.json model to represent QuickForm escalation channels/resources.
Changes:
- Added
TasksService.create_quickform_async/create_quickformtargeting/orchestrator_/tasks/GenericTasks/CreateTaskwithtype=6,taskSchemaKey, and inlineschema, plus optional AssignTasks follow-up. - Extended
AgentEscalationChannelwith QuickForm schema fields and addedAgentQuickFormEscalationResourceConfig(escalationType=2) into the escalation discriminated union.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/uipath/src/uipath/agent/models/agent.py | Adds QuickForm schema fields to escalation channels and introduces escalationType=2 resource config in the discriminated union. |
| packages/uipath-platform/src/uipath/platform/action_center/_tasks_service.py | Implements QuickForm task creation request building and exposes sync/async service methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # schema_id is the UUID key under which the schema is registered in Orchestrator's | ||
| # TaskSchemas table. schema is the inline schema body, sent on every task creation | ||
| # so Orchestrator can upsert it (the Agents runtime has no separate registration step). | ||
| schema_id: Optional[str] = Field(None, alias="schemaId") | ||
| schema: Optional[Dict[str, Any]] = Field(None, alias="schema") |
| if is_actionable_message_enabled is not None: | ||
| json_payload["isActionableMessageEnabled"] = is_actionable_message_enabled | ||
| if actionable_message_metadata is not None: | ||
| json_payload["actionableMessageMetaData"] = actionable_message_metadata |
| @traced(name="tasks_create_quickform", run_type="uipath") | ||
| async def create_quickform_async( | ||
| self, | ||
| title: str, | ||
| task_schema_key: str, | ||
| schema: Dict[str, Any], | ||
| data: Optional[Dict[str, Any]] = None, | ||
| *, | ||
| folder_path: Optional[str] = None, | ||
| folder_key: Optional[str] = None, | ||
| assignee: Optional[str] = None, | ||
| recipient: Optional[TaskRecipient] = None, | ||
| priority: Optional[str] = None, | ||
| labels: Optional[List[str]] = None, | ||
| is_actionable_message_enabled: Optional[bool] = None, | ||
| actionable_message_metadata: Optional[Dict[str, Any]] = None, | ||
| creator_job_key: Optional[str] = None, | ||
| source_name: str = "Agent", | ||
| ) -> Task: | ||
| """Creates a new QuickForm task asynchronously. | ||
|
|
||
| QuickForm tasks are schema-first HITL tasks rendered by FormLib in Action | ||
| Center. Both task_schema_key AND schema are required: the Agents runtime | ||
| does not pre-populate TaskSchemas via a package.uploaded subscriber, so | ||
| Orchestrator upserts the schema (keyed by task_schema_key) and creates | ||
| the task in the same call. | ||
|
|
||
| Args: | ||
| title: The title of the task. | ||
| task_schema_key: UUID key of the schema. Used as the key under which | ||
| Orchestrator stores/looks up the schema in TaskSchemas. | ||
| schema: The HITL schema body to register/upsert. Sent inline on every | ||
| call. | ||
| data: Optional dictionary containing input data for the task. | ||
| folder_path: Optional folder path for the task. Required by the | ||
| Orchestrator controller (RequireOrganizationUnit) unless | ||
| folder_key is provided. | ||
| folder_key: Optional folder key, alternative to folder_path. | ||
| assignee: Optional username or email to assign the task to. | ||
| recipient: Optional structured recipient (user id / group id / | ||
| email). Resolved via identity service before assignment. | ||
| priority: Optional priority. Low / Medium / High / Critical. | ||
| labels: Optional list of labels for the task. | ||
| is_actionable_message_enabled: Whether actionable notifications are | ||
| enabled for this task. | ||
| actionable_message_metadata: Optional metadata override. For | ||
| QuickForm, when null, Orchestrator derives it from the | ||
| referenced TaskSchema. | ||
| creator_job_key: Optional. Identifies the job that triggered the | ||
| inline schema creation/upsert. | ||
| source_name: Source name on TaskSource. Defaults to 'Agent'. | ||
|
|
||
| Returns: | ||
| Task: The created task object. | ||
| """ | ||
| spec = _create_quickform_spec( | ||
| title=title, | ||
| data=data, | ||
| task_schema_key=task_schema_key, | ||
| schema=schema, | ||
| creator_job_key=creator_job_key, | ||
| folder_key=folder_key, | ||
| folder_path=folder_path, | ||
| priority=priority, | ||
| labels=labels, | ||
| is_actionable_message_enabled=is_actionable_message_enabled, | ||
| actionable_message_metadata=actionable_message_metadata, | ||
| source_name=source_name, | ||
| ) | ||
|
|
||
| response = await self.request_async( | ||
| spec.method, | ||
| spec.endpoint, | ||
| json=spec.json, | ||
| content=spec.content, | ||
| headers=spec.headers, | ||
| ) | ||
| json_response = response.json() | ||
| if assignee or recipient: | ||
| assign_spec = await _assign_task_spec( | ||
| self, json_response["id"], assignee, recipient | ||
| ) | ||
| await self.request_async( | ||
| assign_spec.method, | ||
| assign_spec.endpoint, | ||
| json=assign_spec.json, | ||
| content=assign_spec.content, | ||
| ) | ||
| return Task.model_validate(json_response) |
| EscalationResourceConfig = Annotated[ | ||
| Union[ | ||
| Annotated[AgentEscalationResourceConfig, Tag(0)], | ||
| Annotated[AgentIxpVsEscalationResourceConfig, Tag(1)], | ||
| Annotated[AgentQuickFormEscalationResourceConfig, Tag(2)], | ||
| ], | ||
| Discriminator(lambda v: v.get("escalation_type") or v.get("escalationType") or 0), | ||
| ] |
de3e012 to
a34ae78
Compare
…orm HITL Adds SDK support for the new TaskType.QuickFormTask (=6) path that targets Orchestrator's GenericTasks/CreateTask endpoint. QuickForm is the schema-first HITL flow where the form is rendered by FormLib in Action Center from a .hitl.json schema persisted in the TaskSchemas table; tasks reference it via taskSchemaKey. Mirrors the existing create_async path but: - POSTs to /orchestrator_/tasks/GenericTasks/CreateTask instead of AppTasks - Sets type=6 (QuickFormTask) and taskSchemaKey (Guid) - Skips the AppTask app-key fetch and action-schema-derived fieldSet/actionSet - Supports optional inline schema body + creatorJobKey for the publish-time race window (when AC has not yet persisted the schema) - Reuses the same OData.AssignTasks flow for recipient assignment Wire contract: UiPath/Orchestrator TaskCreateRequest (Core/Application/Dto/Tasks). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d inline Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- AgentEscalationChannel: new optional schema_id and schema fields, carried through agent.json for QuickForm escalations. - AgentQuickFormEscalationResourceConfig: new resource config for escalationType=2, mirroring the IXP pattern. - EscalationResourceConfig discriminated union extended with Tag(2). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… docstrings Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ssignee coverage Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
8f2843f to
2399ce3
Compare
…to drop duplication Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🚨 Heads up:
|
|
🚨 Heads up:
|


What
TasksService.create_quickform_async/create_quickform— POSTs to/orchestrator_/tasks/GenericTasks/CreateTaskwithtype=6 (QuickFormTask),taskSchemaKey, inlineschema, plus standarddata/priority/labels/actionableMessageMetaData/taskSource. Mirrorscreate_asyncincluding theOData.AssignTasksfollow-up call.AgentEscalationChannel— new optionalschema_id/schemafields for QF channels inagent.json.AgentQuickFormEscalationResourceConfig, new resource config forescalationType=2, mirroring the existing IXP pattern. Wired into theEscalationResourceConfigdiscriminated union viaTag(2).