feat(uipath-api-workflow): add api workflow skills#530
feat(uipath-api-workflow): add api workflow skills#530rares-baesu-uipath wants to merge 1 commit intomainfrom
Conversation
|
Claude finished @rares-baesu-uipath's task in 4m 50s —— View job Review of PR #530 —
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | Issue | [PREVIEW] prefix violates current skill-structure.md rules; description is 787 chars (under 1024 ✓), front-loads identity ✓, includes → redirects ✓ |
| E2E Tests | Issue | No tests/tasks/uipath-api-workflow/ directory |
| Skill Body | OK | Strong Critical Rules, clear workflow phases, good anti-patterns section |
| References & Assets | Issue | Troubleshooting has wrong loop-variable fix; expressions doc has contradictory catch rows; task-types Assign example contradicts Critical Rules 4a/4b |
| Repo Hygiene | Issue | CODEOWNERS has unrelated guardrails removal; no secrets/personal paths ✓; no cross-skill refs ✓ |
Issues for Manual Review
- Runtime accuracy of templates: The templates should be verified with
uip api-workflow run --no-auth --output jsonas described in the test plan. I cannot execute CLI commands to confirm. - StudioWeb roundtrip: The PR claims templates roundtrip cleanly through StudioWeb — this needs manual verification in alpha.uipath.com.
- Trigger scope overlap: Verify the skill doesn't false-trigger on prompts about
.flowfiles or other UiPath project types. The→redirects look correct but real-world trigger matching should be tested. $-prefix behavior claim: The skill asserts the executor binds loop variables with a literal$prefix (e.g.,$currentItem), citing empirical verification. This is a foundational claim — if wrong, most templates would fail. The templates reportedly pass, which validates it indirectly.
Conclusion
Request changes. The skill is well-crafted with excellent domain knowledge, but has three issues that need fixing before merge:
- High — Remove
[PREVIEW]from description (SKILL.md:3): Violates currentskill-structure.mdrules onmain. Move preview status to a body callout. - High — Fix wrong loop-variable reference in troubleshooting (troubleshooting.md:80-83): Currently suggests
${currentItem}instead of${$currentItem}— following this advice introduces the exact bug the skill warns about. - Medium — Remove contradictory catch binding row (expressions-and-context.md:16): Duplicate row says
${error}without$, contradicting the correct row above it. - Medium — Fix Assign example to match Critical Rules (task-types.md:60-67): Multi-key
setwith unwrapped string literal contradicts rules 4a and 4b. - Medium — Separate unrelated CODEOWNERS removal (CODEOWNERS): Guardrails directory still exists; removing its ownership entry should be confirmed with listed owners or done in a separate PR.
|
Consider adding smoke tests before merging. |
91ac765 to
023fe8f
Compare
…cturing
New skill for authoring API workflow JSON files (CNCF Serverless Workflow
DSL 1.0.0 with UiPath extensions) executed by uip api-workflow run.
Scope: Sequence, Assign, JavaScript, If (with #Wrapper/#Then/#Else),
ForEach, DoWhile, Break, TryCatch, Wait, Response — including deeply
nested patterns (If-in-loop, TryCatch-around-loop, conditional Break,
multi-way branching via chained Ifs).
HTTP/Connector activities are intentionally out of scope. They require
StudioWeb-side editor metadata (metadata.configuration blob plus a real
connection UUID) that the CLI cannot generate cleanly today; users who
need outbound calls are pointed to author those activities in StudioWeb
and merge them in.
Skill contents:
- SKILL.md with 15 critical rules covering structure, nesting, key
uniqueness, the $-prefix convention for loop iterators and catch error
variables, JS_Invoke globals binding
- references/control-flow-patterns.md — pattern catalog for hierarchical
structures
- references/{task-types, workflow-file-format, expressions-and-context,
cli-reference, troubleshooting}.md
- assets/templates/{api-workflow-template, conditional-workflow-example,
loop-aggregation-example, nested-control-flow-example}.json
Adapted from the Autopilot StudioWeb api-workflow-architect skill;
HTTP/Connector content stripped, control-flow content strengthened with
nesting examples and a dedicated patterns reference.
All four templates verified end-to-end via uip api-workflow run --no-auth.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
023fe8f to
1a8c8ed
Compare
|
we need template examples and references in workflows towards Connector activities, (Unified HTTP Activity, Connector HTTP activities like Slack Http Request or regular DAP connectors like Slack Send Reply.) |
|
I think we should also address uip cli version pinning for capabilities tied to a specific version. The CLI is changing fast and this will help both us users and agents. |
|
|
||
| ### 4. ForEach inside ForEach (nested iteration) | ||
|
|
||
| Outer and inner loops MUST use distinct iterator/index names. |
There was a problem hiding this comment.
we can also add incremental, besides distinct here.
| "document": { | ||
| "type": "object", | ||
| "properties": { | ||
| "lastTerm": { "type": "number" }, |
There was a problem hiding this comment.
there is a type mismatch here, the Response task produces an output with classified property as well, and the property is missing here
| | `$input` | The **current task's input** = the previous task's `$output`. **NOT the workflow's input arguments.** Only equals workflow input on the very first task. | Per-task | | ||
| | `$context` | Mutable shared state: `$context.variables.<name>`, `$context.outputs.<TaskName>` | Workflow run | | ||
| | `$output` | The current task's raw output. | This task only | | ||
| | Loop bindings | `${$currentItem}`, `${$currentItemIndex}` (note the `$` prefix — `for.each: "currentItem"` binds the global as `$currentItem`, with the `$` literal in the identifier name) | Inside the loop body | |
There was a problem hiding this comment.
here we can mention that currentItem and currentItemIndex can be also renamed and we can also use the renamed versions as well
| @@ -0,0 +1,204 @@ | |||
| # API Workflow File Format | |||
|
|
|||
| JSON files conforming to **CNCF Serverless Workflow DSL 1.0.0** with UiPath task-type extensions. Executed by `@uipath/api-workflow-executor` via `uip api-workflow run`. | |||
There was a problem hiding this comment.
here the conformation may be misleading. we are not 100% following the spec in some aspects. I hope this wouldn't lead to hallucinated versions from the spec into the workflow. to mitigate this I think we can address having enough workflow examples for the agent to mitigate spec losses.
| python: {} | ||
|
|
||
| initial_prompt: | | ||
| Make a UiPath API Workflow JSON file at Workflow.json that: |
There was a problem hiding this comment.
here I think a scenario that is more close to real usage would help, like fetching some data and verifying the data is correct
Summary
https://uipath.atlassian.net/browse/SW-26889
Introduces
uipath-api-workflow, a new skill for authoring API workflow JSON files executed byuip api-workflow run. Focused on logical/hierarchical structuring — Sequence, Assign, JavaScript, If, ForEach, DoWhile, Break, TryCatch, Wait, Response — including deeply nested patterns. HTTP and Integration Service Connector activities are intentionally out of scope.Adapted from the Autopilot StudioWeb
api-workflow-architectskill; HTTP/Connector content stripped, control-flow content strengthened with nesting examples and a dedicated patterns reference.What's in scope
task-types.mdcontrol-flow-patterns.md: nested If, multi-way branching via chained Ifs, ForEach with per-iteration If, nested loops with distinct iterators, conditional Break, exit-nested-loops via flag variable, TryCatch-around-loop vs TryCatch-inside-body, decision cheat sheetuip api-workflow run --no-auth:api-workflow-template.json— empty skeletonconditional-workflow-example.json— TryCatch + ForEach + chained Ifs (multi-way branching)loop-aggregation-example.json— DoWhile (Fibonacci) + ForEach (classification)nested-control-flow-example.json— ForEach > DoWhile > TryCatch > If > Break (5 levels)uip api-workflow run,uip solution pack,uip solution publishWhat's deliberately out of scope
HTTP Request and Integration Service Connector activities. Both require StudioWeb-side editor metadata (a
metadata.configurationblob plus a real connection UUID) that the CLI cannot generate cleanly today. Rather than emit broken cards that show as "blocked" in the StudioWeb designer, the skill explicitly directs users to author such activities directly in StudioWeb and merge them in. A follow-up could adduip case registry-backed metadata generation for known activity types — that path is identified introubleshooting.md.Key design decisions
The skill encodes several empirically verified runtime behaviors that an unaided agent gets wrong:
arguments[0]. Verified against@uipath/api-workflow-executorsource — the script handler binds$context/$workflow/$inputonglobalThisviasetVariables; the task body'sargumentsfield is editor scaffolding that the runtime ignores.$prefix.for.each: "currentItem"binds the global as$currentItem(the$is part of the identifier, not syntax). Same forfor.atandcatch.as. Forgetting the$produces<name> is not defined.$erroris a ProblemDetails object, not a JS Error. Use$error.title/$error.detail/$error.originatingTaskName. There is no.message.Assign.setandResponse.responseMUST be wrapped as"${'literal'}". StudioWeb's designer normalizes unwrapped strings to${literal}on save, turning them into bare-identifier references that throwReferenceErrorat runtime.setblocks to a single key on save, silently dropping the rest. Multi-variable updates split into N sequential Assigns.#Wrapper/#Then/#Else/#Bodysuffixes.Each of these is a Critical Rule in
SKILL.mdwith a correspondingtroubleshooting.mdentry covering symptom + cause + fix.Files
SKILL.mdreferences/workflow-file-format.mdreferences/task-types.mdreferences/control-flow-patterns.mdreferences/expressions-and-context.md$context/$input/$workflowscopes, JS globals, strict-mode gotchasreferences/cli-reference.mduipcommands relevant to API workflowsreferences/troubleshooting.mdassets/templates/*.jsonTest plan
uip api-workflow run --no-auth --output jsonand confirm success:conditional-workflow-example.jsonwith--input-arguments '{"transactions":[{"amount":1500},{"amount":2500},{"amount":300}]}'→ expectstier: "GOLD",totalAmount: 4300,highValueCount: 2conditional-workflow-example.jsonwith negative amount input → expectstier: "INVALID",errorMsgpopulated from$error.titleloop-aggregation-example.jsonwith'{"termCount":5}'→ expectslastTerm: 8,fibSum: 19, classified array of 5 termsnested-control-flow-example.jsonwith the 3-task input → expectscompleted: 2,failed: 1bash hooks/validate-skill-descriptions.shexits 0/skills/uipath-api-workflow/ @rares-baesu-uipathscoreinput and returns{grade}...") in a Claude Code session with the skill loaded; verify the output workflow respects single-key Assigns + wrapped literals +$-prefix loop vars + WorkflowStart on first attempt without manual fix-ups