Skip to content

Support full rerun from a stable run reference in the engine, CLI, and SDKs #162

Open

Description

@softmarshmallow

User problem

I have a recorded workflow run and want to start it over without losing my bookmark or the earlier result. The immediate example came from #62 dogfooding. After a review deadline passes, I want a new countdown for the same workflow and inputs. Today I can start a separate run and open its new viewer URL. Resuming the original run preserves the original request and deadline. FX named runs · FX run URLs

Resulting behavior

Target 0.13.0 for full rerun and attempt history in the engine, CLI, and SDKs. Viewer controls and history navigation are tracked in #168.

  1. Verify the source. Select one exact recorded attempt. Require an inactive source, including a run parked on an expired review with no active invocation. Reconstruct the source definition, effective inputs, bound routes, takes, and execution mode from verifiable evidence. Check the recorded plan and mode. Refuse before dispatch if the source is active, reconstruction is unavailable, or verification fails. Report the specific reason.
  2. Create and record a fresh attempt. Follow the targeting contract from Define workflow run attempt targeting #165. The stable run reference groups attempts, each with its own run folder and exact selector. Keep existing attempt URLs, names, results, and receipts bound to their original records. A retry of the same start request returns the same accepted attempt. A distinct rerun request creates a new attempt. Run references, attempts and invocations
  3. Run and inspect. Expose full rerun and attempt history through the CLI and provide Python and JavaScript access to the same engine operation. Return the accepted attempt's exact selector. The new attempt can reuse eligible computation under the normal cache rules. When it reaches a waiting step, it opens a fresh request and deadline. New paid work requires current spending approval and limits.

Affected scenarios

  • Rerun a provider-free workflow with an expired review. The old request stays Expired, the new attempt opens a new request with a fresh deadline, and a late answer to the old request stays scoped to the old attempt.
  • Start a rerun through the CLI or an SDK and inspect both attempts. Resume, respond, and cancel still target the exact attempt or invocation under the existing rules.
  • Retry an accepted start request and get the same attempt. Submit a distinct rerun and get a new attempt in the same history.
  • Refuse an active source or an older record with insufficient reconstruction evidence. If the definition, inputs, routes, takes, or mode do not match, report the mismatch before dispatch.

Before and after

Both examples start with the provider-free review-showcase workflow after its thumbnail review expires. Output is faux and reduced to the relevant fields. The proposed CLI spelling and JSON shape are illustrative.

A. Before

$ grida fx inspect review-showcase/review --requests --json
{"requests":[{"id":"original-request","state":{"status":"expired"}}]}
$ grida fx run ./showcase.yaml --name review-again --no-view
run       [new run folder]
result    incomplete
stopped   awaiting workflow input
$ grida fx inspect review-showcase/review-again --requests --json
{"requests":[{"id":"new-request","deadline":"[new deadline]","state":{"status":"pending"}}]}

B. After (proposed)

$ grida fx inspect review-showcase/review --requests --json
{"requests":[{"id":"original-request","state":{"status":"expired"}}]}
$ grida fx rerun review-showcase/review
Started attempt 2 of [stable run reference]
run       [attempt 2 folder]
result    incomplete
stopped   awaiting workflow input
$ grida fx inspect '[attempt 2 folder]' --requests --json
{"requests":[{"id":"new-request","deadline":"[new deadline]","state":{"status":"pending"}}]}
$ grida fx inspect review-showcase/review --requests --json
{"requests":[{"id":"original-request","state":{"status":"expired"}}]}

Demo and evidence

  • GitHub Actions keeps the run ID and increments the attempt number. It exposes earlier attempts, and supports full reruns and reruns of selected or failed jobs. Rerun controls and attempt history · Run and attempt identity
  • AWS Step Functions redrives an unsuccessful execution under the same execution ARN and retains the original definition, inputs, successful results, and history. Argo Workflows can restart a selected node, including a successful one. These are references for a later step-scoped operation. AWS redrive · Argo retry

AWS Step Functions console showing task attempts across an original execution and its redrives

How to test

Use the provider-free review fixture to verify a fresh deadline, a distinct request ID, and durable history across separate CLI invocations. Check that exact selectors and old links still address the original attempt, and that a retry of the same request returns its accepted attempt. Cover concurrent submissions, an active source, unavailable or changed context including defaulted files, prior results and receipts, cache reuse, and spending refusal. Verify CLI and SDK callers share the same engine behavior.

Caveats

V1 uses verified reconstruction from available source and recorded evidence, with no source or dependency snapshotting. Specify selectors, history storage, and start request deduplication in the contract before implementation. Defer forced recomputation, rerun from or after a step, rerun failed work, and new lifecycle vocabulary. The later step-scoped design should target one exact expanded step and define downstream recomputation and provenance for outputs carried forward from unaffected branches.

Activity

  1. changed the title [-]Rerun workflows from a stable run reference in the engine and viewer[/-] [+]Support full rerun from a stable run reference in the engine, CLI, and SDKs[/+] on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions