@@ -222,6 +222,64 @@ case $? in
222222esac
223223```
224224
225+ ## Inspecting and editing workflows
226+
227+ Find the workflow in its workspace before reading its draft:
228+
229+ ``` bash
230+ sim workspaces list --output json
231+ sim workflows list --workspace " $workspace_id " --search " Daily report" \
232+ --folder Reports --deployed-only --output json
233+ ```
234+
235+ ` --search ` matches names; ` --folder ` and ` --deployed-only ` narrow the results.
236+ These lists [ follow pages automatically] ( #pagination ) . There is no account-wide
237+ workflow-content search: use metadata to narrow candidates, then inspect them.
238+
239+ Start with a compact diagnostic view, then fetch editable state when you need to
240+ change the saved workflow:
241+
242+ ``` bash
243+ sim workflows inspect " $workflow_id " --output json
244+ sim workflows inspect " $workflow_id " --block-id " $block_id " --include-code --output json
245+ sim workflows state get " $workflow_id " --output json > state.json
246+ ```
247+
248+ Inspection includes block IDs, names, enabled states, parents, connections, and
249+ bounded inputs. It omits code by default and withholds credential fields and
250+ opaque credential values; check ` omittedInputs ` and ` truncated ` for missing detail.
251+ Redaction cannot recognize every secret embedded in arbitrary text or code.
252+ The diagnostic view is not a format to save back.
253+
254+ A tool ID from ` tools get ` selects a standalone operation. A block type and its
255+ operation from ` blocks get ` define workflow behavior; a block ID identifies one
256+ instance in the saved workflow. These IDs are not interchangeable. Preserve the
257+ saved block type/version when editing; an unversioned catalog name can resolve
258+ to a newer definition with different fields.
259+
260+ For in-place edits, preserve the IDs and credential/table references from
261+ ` state get ` , then validate with ` state replace --dry-run ` before saving.
262+ ` workflows export ` is a sanitized portable format with credential bindings cleared;
263+ use it for [ import and sync] ( /cli/workflow-sync ) , not to replace editable state.
264+ Review validation coverage, skipped checks, warnings, and ` removedBindings ` .
265+ Static validation cannot prove provider access, model behavior, or runtime success.
266+
267+ For a small change, use the existing operations command. An enablement-only batch
268+ needs no graph edit:
269+
270+ ``` bash
271+ sim workflows operations apply " $workflow_id " --dry-run --atomic \
272+ --set-block-enabled " [{\" block_id\" :\" $block_id \" ,\" enabled\" :false}]"
273+ ```
274+
275+ Inspect ` applied ` , ` skipped ` , and ` inputValidationErrors ` before committing with
276+ ` --yes ` in place of ` --dry-run ` . ` --atomic ` prevents the batch from saving if an
277+ edit is declined or an input would be dropped. When adding blocks, dry-run
278+ ` previewBlockIds ` are provisional and ` mintedBlockIds ` is empty; use the IDs from
279+ the committed response. Read the saved state before deploying. Validation executes
280+ no blocks; it is not a mode that suppresses external writes during a later run.
281+ See the [ workflow command reference] ( /cli/workflows ) for full edit and validation flags.
282+
225283## Selecting workflow output
226284
227285` --select-output ` returns the named values in ` blockOutputs ` on a sync run, or
@@ -242,9 +300,22 @@ sim workflows runs get "$run_id" --workflow 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8
242300 --select-output 1d4c8f02-7b63-4a19-8e52-63f0a7c5d9b1.content --output json
243301```
244302
303+ To inspect an intermediate result, combine a selector with ` --stop-after ` :
304+
305+ ``` bash
306+ sim workflows run " $workflow_id " --stop-after " $block_id " \
307+ --select-output " $block_id .result" --output json
308+ ```
309+
310+ This executes real actions and stops scheduling after the target finishes.
311+ Already-running parallel branches can still act; a condition that skips the
312+ target can let the remaining path complete. It does not edit the saved graph or
313+ suppress external writes. It cannot be used with ` --async ` , and a later explicit
314+ resume of a paused run does not inherit the limit.
315+
245316## Polling a long run
246317
247- Start the run asynchronously, then use the CLI’s wait command:
318+ Start a deployed run asynchronously, then use the CLI’s wait command:
248319
249320``` bash
250321run_id=$( sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --async --output json | jq -r ' .runId' )
@@ -258,6 +329,55 @@ outcome; `--wait-timeout 0` waits indefinitely.
258329Use ` sim logs get "$run_id" --trace ` for full diagnostics. A run paused for human
259330input includes the context ID needed by ` sim workflows runs resume ` .
260331
332+ Ordinary runs use the active deployment; ` --manual ` , ` --trigger ` , and ` --from-block `
333+ use the current saved draft. Deployed runs support synchronous execution,
334+ ` --follow ` , or ` --async ` . Manual runs support synchronous execution or ` --follow ` ;
335+ ` --async ` cannot be combined with manual execution or ` --follow ` .
336+
337+ The CLI prints a run ID to stderr before sending a manual request. Use it with
338+ ` workflows runs get ` or ` workflows runs wait ` in another terminal. A status record
339+ appears only after server admission, so a rejected request may never have one.
340+ The ID is a one-shot identifier, not a replayable idempotency key. After an
341+ uncertain network failure, inspect that ID before starting another execution;
342+ a fresh ID can repeat external actions.
343+
344+ Deployed runs retain the default API-compatible trigger priority. A deployment
345+ with one other runnable trigger can also run directly. If no API-compatible
346+ entry exists and multiple triggers remain, select the deployed entry through the
347+ API's ` run.entry ` ; the CLI's ` --trigger ` instead selects an entry in the draft.
348+ See the [ run command reference] ( /cli/workflows#run-a-deployed-workflow-or-execute-saved-state-manually )
349+ for all execution flags.
350+
351+ ## Previewing a partial retry
352+
353+ Preview a retry using the source run's persisted upstream outputs before repeating
354+ external actions:
355+
356+ ``` bash
357+ sim workflows runs preview " $workflow_id " \
358+ --from-block " $block_id " --source-run " $source_run_id " --output json
359+ ```
360+
361+ Review ` validation ` , ` rerunBlocks ` , and ` upstreamBlocks ` . Preview reports cached-output
362+ availability without returning values, executing blocks, or reserving a run ID.
363+ Its rerun blocks are candidates, not an execution order: conditions, disabled
364+ blocks, loops, and failures still affect the path. Preview does not lock the draft;
365+ the subsequent manual run uses the draft saved at that time.
366+
367+ After reviewing the preview, start the retry and use its printed run ID to
368+ [ track it] ( #polling-a-long-run ) :
369+
370+ ``` bash
371+ sim workflows run " $workflow_id " \
372+ --from-block " $block_id " --source-run " $source_run_id " --follow
373+ ```
374+
375+ An error connection is an alternative path: a consumer reached through an error
376+ bypass may lack the successful path's parser output. Keep required data on the
377+ path that produces it or handle its absence. A disabled block stops its branch;
378+ it is not a pass-through mock. Replay can reuse recorded ancestor outputs from
379+ the selected source run, but cannot supply outputs that run never produced.
380+
261381## Working with folders
262382
263383Every folder-backed resource — ` workflows ` , ` tables ` , ` files ` , ` knowledge ` —
0 commit comments