Repository navigation
feat(workflows): allow and mock child-workflow blocks, and mock from a recorded run - #10413
Open
waleedlatif1 wants to merge 2 commits into
Open
waleedlatif1 wants to merge 2 commits into
waleedlatif1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The changes affect dry-run execution and reruns across the workflow API and CLI. Fix the recorded-output checks and broken Findings
SummaryAdds child-workflow overrides and replay of recorded block outputs through the API and CLI.
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 23 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…n earlier run
--allow and --mock (run.allowBlocks / run.mocks) now also name a block of a
workflow the run calls as <workflow>.<block> (the workflow's id or name, then
the block's id, name or key). A dotted selector names a block of the run's
workflow only by its exact id or display name (keys drop dots, so `slack.send`
never shadows child "Slack" block "Send"); otherwise its workflow part matches
the children Workflow blocks call by a fixed id, at any depth up to the call
chain limit, then, for a child chosen as the run goes, a workflow of the same
workspace by id or exact name, looked up once per request in one query.
Selectors are capped at 256 characters. Matches are deduplicated by workflow
and block; several distinct ones are refused with candidates. Another
workspace's workflow is never found, so its refusal is an unknown id's. A
workflow reachable only as a custom block is refused unless a Workflow block
chooses its child at run time. The policy keys every override by workflow and
block id, so a child's entry applies wherever that workflow runs, at every
depth. The dry-run record adds childAllowBlocks / childMockedBlocks.
Rough edges: loops, parallels, and blocks disabled anywhere up their container
chain are refused as targets; a mock of a block of a locked workflow or folder
returns 423 through requireMutableWorkflow, as any change to one does; a mock
holding a __simLargeValueRef is refused; the duplicate-mock error names both
selectors. sideEffects reports `unused` overrides, `undeclaredMockFields`
(Agent and Function outputs skipped) and `droppedMockFields`, and the CLI
prints a note for each.
run.mocksFrom {runId, blocks} (--mock-from <runId> with a bare --mock <block>)
answers this workflow's blocks with the outputs they recorded in an earlier run
of it, read through readWorkflowRun (read role, logs.trace_spans projection,
secrets redacted). Fields only a block sets are left out and reported. Refused:
a block the run did not execute; one in a loop or parallel unless that run
mocked it; and, from a test run, a block it answered with a placeholder rather
than mocking or allowing it. An unknown run is 404; a running one, or one with
no recorded outputs yet, 409; outputs hidden by the viewer's permission group
403 (readWorkflowRun now says which). A child selector there is refused with a
pointer to run.mocks. Recorded as dryRun.mocksFrom.
next repeats --mock-from; mocks the caller passed to this workflow's blocks are
read back from the failed run itself, and only a child's mock, or one passed
beside --mock-from, comes back as a --mock '<block>=<json>' placeholder, which
the CLI refuses verbatim with a hint to replace it.
… unreached mocks as placeholders in next - run.mocksFrom checks loop ancestry and placeholder answers against the source run's workflow snapshot, not the draft edited since - next reads a passed mock back with --mock-from only when the run reached it (sideEffects.unused); otherwise it prints a <json> placeholder - refuse <workflow>.<block> selectors whose workflow names match more than the lookup cap instead of resolving a partial list - walk mock outputs without spreading into push
waleedlatif1
force-pushed
the
feat/dry-run-child-overrides
branch
from
November 25, 2026 20:58
c3a1dfb to
620e392
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--allowand--mock(v2run.allowBlocks/run.mocks) also take<workflow>.<block>for a child workflow, resolved through the Workflow blocks the run calls (recursively) or a same-workspace workflow chosen at runtime; the entry applies wherever that workflow runs, with the same refusals as top-level blocks--mock-from <runId>with a bare--mock <block>replays the output that block recorded in an earlier run of this workflow (read through the secret-masked run read; billing/trace fields stripped and reported asdroppedMockFields; placeholders a dry source run stubbed are refused)sideEffects.unused; mock fields a block doesn't declare are listed inundeclaredMockFieldsnextrepeats child allows and reads mocks back with--mock-from <thisRun>, so it runs as printedType of Change
Testing
dry-run.integration.ts(real Postgres/Redis): child allow by name and id, grandchild mock, locked child block/workflow, other-workspace id, containers, disabled chains, unused and undeclared fields, mock-from (secret redaction, stripping, 403 hidden vs 409 missing vs 409 running, test-run placeholders), dot shadowing, selector cap; each guard red-proofedChecklist
test-auditauthoring gate)