@uipath/flow-tool 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,380 @@
1
+ # @uipath/flow-tool
2
+
3
+ CLI tool for managing UiPath Flow processes and jobs. This is a uip plugin that provides Flow-related commands.
4
+
5
+ ## Commands
6
+
7
+ ### `flow init`
8
+
9
+ Create a new Flow project with boilerplate files.
10
+
11
+ ```bash
12
+ uip flow init <projectName> [--force]
13
+ ```
14
+
15
+ ### `flow validate`
16
+
17
+ Validate a `.flow` file against the Flow schema (Zod-based) with structural cross-field checks.
18
+
19
+ ```bash
20
+ uip flow validate <flowFile>
21
+ ```
22
+
23
+ ### `flow pack`
24
+
25
+ Pack a Flow project into a NuGet package (`.nupkg`).
26
+
27
+ ```bash
28
+ uip flow pack <projectPath> <outputPath> [-n <name>] [-v <version>]
29
+ ```
30
+
31
+ ### Known Issues
32
+
33
+ > **Solution integration with Flow projects is currently broken.**
34
+ >
35
+ > The `flow init`, `flow validate`, and `flow pack` commands work correctly on their own. However, when a Flow project is added to a solution via `uip solution project add` and then packed with `uip solution pack`, the resulting `.nupkg` inside the solution zip is **missing critical files** (`.bpmn`, `.flow`, `entry-points.json`, `bindings_v2.json`).
36
+ >
37
+ > **Root cause:** The published `@uipath/tool-flow` npm package has a non-recursive `copyFiles()` method that only copies top-level files from the project directory, silently skipping the `content/` and `flow_files/` subdirectories. The local `flow-pack-service.ts` correctly uses `copyDirectory()` for recursive copies, but the npm-published tool does not.
38
+ >
39
+ > **Workaround:** Use `uip flow pack` directly to produce a correct `.nupkg` for deployment.
40
+
41
+ ### Flow Process Commands
42
+
43
+ #### `flow process list`
44
+
45
+ List available Flow processes.
46
+
47
+ ```bash
48
+ uip flow process list
49
+ ```
50
+
51
+ #### `flow process get`
52
+
53
+ Get Flow process schema and details.
54
+
55
+ ```bash
56
+ uip flow process get "<process-key>" "<feed-id>"
57
+
58
+ # Example
59
+ uip flow process get "MyFlow.flow.Flow:1.0.0" "6d98ceb8-becb-46ec-80d7-df213fbec06c"
60
+ ```
61
+
62
+ #### `flow process run`
63
+
64
+ Run a Flow process.
65
+
66
+ **Syntax:**
67
+
68
+ ```bash
69
+ uip flow process run "<process-key>" "<folder-key>" [options]
70
+ ```
71
+
72
+ **Arguments:**
73
+
74
+ - `<process-key>` - Process package key with version (e.g., `MyFlow.flow.Flow:1.0.0`)
75
+ - `<folder-key>` - Folder key (GUID)
76
+
77
+ **Options:**
78
+
79
+ - `-i, --inputs <json>` - Input parameters as JSON string or @file.json
80
+ - `-t, --tenant <name>` - Tenant name (defaults to authenticated tenant)
81
+ - `--release-key <key>` - Release key (GUID, from list command)
82
+ - `--folder-id <id>` - Folder ID (from list command)
83
+ - `--feed-id <id>` - Feed ID for package lookup (optional)
84
+ - `--robot-ids <ids>` - Comma-separated robot IDs (optional)
85
+ - `--validate` - Validate inputs against project schema before running
86
+
87
+ **Examples:**
88
+
89
+ ```bash
90
+ # Run with JSON inputs
91
+ uip flow process run "TestFlow.flow.Flow:1.0.0" "folder-guid-here" \
92
+ --release-key "release-guid" \
93
+ --folder-id "2553016" \
94
+ --inputs '{"name": "John", "age": 30}'
95
+
96
+ # Run with inputs from file
97
+ uip flow process run "TestFlow.flow.Flow:1.0.0" "folder-guid-here" \
98
+ --release-key "release-guid" \
99
+ --folder-id "2553016" \
100
+ --inputs @inputs.json
101
+
102
+ # Run with piped inputs
103
+ echo '{"name": "John", "age": 30}' | \
104
+ uip flow process run "TestFlow.flow.Flow:1.0.0" "folder-guid-here" \
105
+ --release-key "release-guid" \
106
+ --folder-id "2553016"
107
+ ```
108
+
109
+ ### Flow Job Commands
110
+
111
+ #### `flow job traces`
112
+
113
+ Stream execution traces for a running job.
114
+
115
+ ```bash
116
+ uip flow job traces "<job-key>" [options]
117
+
118
+ # Options:
119
+ # --poll-interval <ms> - Polling interval in milliseconds (default: 2000)
120
+ # --traces-service <name> - Traces service name (default: llmopstenant_)
121
+
122
+ # Example
123
+ uip flow job traces "06478292-f9cf-4234-9d1b-03f4bcd95fed"
124
+ ```
125
+
126
+ #### `flow job status`
127
+
128
+ Get detailed status of a Flow job.
129
+
130
+ ```bash
131
+ uip flow job status "<job-key>" --folder-id "<id>" [options]
132
+
133
+ # Options:
134
+ # --detailed - Show full response with all fields
135
+
136
+ # Example
137
+ uip flow job status "06478292-f9cf-4234-9d1b-03f4bcd95fed" --folder-id "2553016"
138
+ ```
139
+
140
+ ## Complete Workflow
141
+
142
+ ```bash
143
+ # 1. List available processes
144
+ uip flow process list
145
+
146
+ # 2. Get process schema (to see required inputs)
147
+ uip flow process get "MyFlow.flow.Flow:1.0.0" "feed-id-from-list"
148
+
149
+ # 3. Run the process
150
+ JOB_KEY=$(uip flow process run "MyFlow.flow.Flow:1.0.0" "folder-key" \
151
+ --release-key "release-key" \
152
+ --folder-id "2553016" \
153
+ --inputs '{}' 2>/dev/null)
154
+
155
+ # 4. Watch execution traces
156
+ uip flow job traces "$JOB_KEY"
157
+
158
+ # 5. Check final status
159
+ uip flow job status "$JOB_KEY" --folder-id "2553016"
160
+ ```
161
+
162
+ ## Output
163
+
164
+ **Process list**: JSON array with process metadata
165
+ **Process get**: JSON with entry points and schemas
166
+ **Process run**: Job key on stdout, next steps on stderr
167
+ **Job traces**: JSON trace events (one per line) on stdout
168
+ **Job status**: JSON with job details (14 fields default, full with --detailed)
169
+
170
+ **Exit codes:**
171
+
172
+ - `0` - Success
173
+ - `1` - Failure or error
174
+
175
+ ## Flow Registry Commands
176
+
177
+ `flow registry` commands let you browse, search, and inspect the Flow node registry — the building blocks used inside UiPath Flow processes. Nodes include OOTB activities (`uipath.agent`, `uipath.http`, etc.) and connector nodes that call third-party APIs (Slack, Salesforce, etc.). When logged in, the registry also includes connector nodes installed in your tenant.
178
+
179
+ | Command | Description |
180
+ | --------------------------------- | ------------------------------------------------------------------------------ |
181
+ | `flow registry pull` | Fetch and cache all available nodes from the Flow registry |
182
+ | `flow registry list` | List all locally cached nodes |
183
+ | `flow registry search [keyword]` | Find nodes by keyword and/or structured filters |
184
+ | `flow registry get <nodeType>` | Get full node schema; auto-enriches connector nodes with input/output fields |
185
+
186
+ ---
187
+
188
+ ### `flow registry pull`
189
+
190
+ Fetches the node registry and writes it to local cache. Subsequent commands (`list`, `search`, `get`) read from this cache.
191
+
192
+ ```bash
193
+ uip flow registry pull
194
+ uip flow registry pull --force # bypass 30-minute cache, always refresh
195
+ ```
196
+
197
+ **Output fields:**
198
+
199
+ | Field | Description |
200
+ | ------------- | ------------------------------------------------------- |
201
+ | `NodesCount` | Number of nodes cached |
202
+ | `FromCache` | `true` if the cached copy was used without fetching |
203
+ | `AgeMinutes` | Cache age in minutes (only when `FromCache: true`) |
204
+ | `Source` | `"ootb"` (unauthenticated) or `"authenticated"` (tenant-specific) |
205
+ | `CacheWritten` | `true` if cache was updated on this run |
206
+ | `Message` | Human-readable status |
207
+
208
+ **Cache behaviour:**
209
+
210
+ - Cache expires after 30 minutes. Expired or missing cache triggers a live fetch.
211
+ - When not logged in, OOTB nodes are returned without updating the cache.
212
+ - On authenticated fetch failure, falls back to OOTB nodes without updating the cache.
213
+
214
+ ---
215
+
216
+ ### `flow registry list`
217
+
218
+ Lists all nodes in the local cache. If no cache exists, fetches live data first.
219
+
220
+ ```bash
221
+ uip flow registry list
222
+ ```
223
+
224
+ **Output fields:** `NodesCount`, `Nodes[]`
225
+
226
+ ---
227
+
228
+ ### `flow registry search`
229
+
230
+ Searches for nodes by keyword and/or structured filters.
231
+
232
+ ```bash
233
+ uip flow registry search slack
234
+ uip flow registry search slack --filter "displayname:contains=send message"
235
+ uip flow registry search --filter "category=connector"
236
+ ```
237
+
238
+ **Options:**
239
+
240
+ | Option | Description |
241
+ | ----------------- | -------------------------------------------------------------- |
242
+ | `[keyword]` | Searches across `nodeType`, `category`, `tags`, `display.label` |
243
+ | `--filter <expr>` | Structured filter (see filter syntax below) |
244
+
245
+ At least one of `keyword` or `--filter` is required.
246
+
247
+ **Output fields:** `Keyword`, `Filters`, `ResultCount`, `Nodes[]`
248
+
249
+ **Filter syntax:**
250
+
251
+ ```text
252
+ field=value # equality
253
+ field:operator=value # operator variant
254
+ field1=value1,field2=value2 # AND conditions
255
+ ```
256
+
257
+ | Field aliases | Operators |
258
+ | ------------------------------------------------ | --------------------------------------------------------------- |
259
+ | `category`, `cat` | `equals` (default), `contains`, `startsWith`, `endsWith`, `in` |
260
+ | `type`, `nodetype` | |
261
+ | `tags`, `tag` | |
262
+ | `displayname`, `display_name`, `name`, `label` | |
263
+
264
+ Examples:
265
+
266
+ ```bash
267
+ # Connector nodes only
268
+ --filter "category=connector"
269
+
270
+ # Display name contains "slack"
271
+ --filter "displayname:contains=slack"
272
+
273
+ # Tagged with "ai" or "automation"
274
+ --filter "tags:in=ai,automation"
275
+
276
+ # Combined: connector AND display name contains "invite"
277
+ --filter "category=connector,displayname:contains=invite"
278
+ ```
279
+
280
+ ---
281
+
282
+ ### `flow registry get`
283
+
284
+ Returns full details for a single node, looked up by `nodeType` (case-insensitive).
285
+
286
+ ```bash
287
+ uip flow registry get "uipath.agent"
288
+ uip flow registry get "uipath.connector.slack.send-message"
289
+ ```
290
+
291
+ **Output fields:** `Node` (enriched FlowNode object)
292
+
293
+ **Connector enrichment:**
294
+
295
+ For nodes tagged `"connector"`, `registry get` automatically calls the Integration Service API to fetch input and output field definitions and attach them to the result:
296
+
297
+ - `inputDefinition.fields[]` — fields for the request body
298
+ - `outputDefinition.fields[]` — fields returned by the action
299
+
300
+ Each field contains:
301
+
302
+ | Property | Description |
303
+ | ------------- | ------------------------------------------------------------------------ |
304
+ | `name` | JSON key for the request/response |
305
+ | `displayName` | Human-readable label |
306
+ | `type` | Data type (`string`, `boolean`, `integer`, etc.) |
307
+ | `required` | `true` if mandatory (input fields only) |
308
+ | `description` | What the field does |
309
+ | `enum` | Allowed values (if restricted) |
310
+ | `reference` | Object reference metadata — field expects an ID, not a plain name |
311
+ | `responseOnly` | `true` on all output fields |
312
+
313
+ Enrichment requires login. If the IS call fails or the node is not a connector, the node is returned unchanged.
314
+
315
+ ---
316
+
317
+ ### JMESPath output filtering
318
+
319
+ All commands support `--output-filter <expression>` (global option) to extract specific values from the output. The expression is a [JMESPath](https://jmespath.org/) query evaluated against the `Data` field of the JSON response, so top-level keys are the output fields listed above.
320
+
321
+ ```bash
322
+ # List all nodeTypes from a search
323
+ uip flow registry search slack --output-filter "Nodes[*].nodeType"
324
+
325
+ # Get the full enriched node
326
+ uip flow registry get "uipath.connector.slack.send-message" \
327
+ --output-filter "Node"
328
+
329
+ # Extract only the input fields
330
+ uip flow registry get "uipath.connector.slack.send-message" \
331
+ --output-filter "Node.inputDefinition.fields"
332
+
333
+ # Get the node count after a pull
334
+ uip flow registry pull --output-filter "NodesCount"
335
+ ```
336
+
337
+ Combine with `--format json` to get clean JSON output:
338
+
339
+ ```bash
340
+ uip flow registry get "uipath.connector.slack.send-message" \
341
+ --output-filter "Node.inputDefinition.fields" --format json
342
+ ```
343
+
344
+ ---
345
+
346
+ ### Registry command workflow
347
+
348
+ ```bash
349
+ # 1. Pull the registry (once per session)
350
+ uip flow registry pull
351
+
352
+ # 2. Search for candidates
353
+ uip flow registry search slack --filter "displayname:contains=send" \
354
+ --output-filter "Nodes[*].nodeType"
355
+ # → uipath.connector.slack.send-message
356
+ # uipath.agent.resource.tool.connector.slack.send-message
357
+ # Pick the uipath.connector.* variant for direct flow use.
358
+
359
+ # 3. Inspect the full schema (with IS enrichment if logged in)
360
+ uip flow registry get "uipath.connector.slack.send-message" --format json
361
+
362
+ # 4. Extract just the input fields to build a request body
363
+ uip flow registry get "uipath.connector.slack.send-message" \
364
+ --output-filter "Node.inputDefinition.fields" --format json
365
+ ```
366
+
367
+ ---
368
+
369
+ ## Development
370
+
371
+ ```bash
372
+ # Build
373
+ bun run build
374
+
375
+ # Test
376
+ bun test
377
+
378
+ # Lint
379
+ bun run lint
380
+ ```