Resuming a workflow with resumeFromRunId and no args drops the original args and exits immediately

Open 💬 0 comments Opened Jul 5, 2026 by jallen

What happens

Resuming a workflow via Workflow({scriptPath, resumeFromRunId}) without re-passing args does not carry forward the original args from the run being resumed. The resumed script re-reads args, finds it empty, and bails before any cached agent replays — defeating the purpose of resume (recovering cached agents after a session-limit abort).

Hit with the bundled deep-research workflow, whose first line is effectively:

const QUESTION = (typeof args === "string" && args.trim()) || ""
if (!QUESTION) return { error: "No research question provided. Pass it as args: ..." }

So a no-args resume exits with {"error":"No research question provided..."} in ~13ms with 0 agents replayed.

Reproduction

  1. Run Workflow({name: 'deep-research', args: '<some question>'}).
  2. Let it abort mid-run (e.g. session limit) so it becomes resumable.
  3. Resume with just Workflow({scriptPath: '<...>/deep-research-<runId>.js', resumeFromRunId: '<runId>'}) (no args).
  • Actual: exits immediately, 0 cached agents replayed, {"error":"No research question provided..."}.
  • Expected: cached agents replay from the journal.
  1. Re-run the identical call with the original args re-passed verbatim → all cached agents replay and it completes.

Reproduced 2026-07-02 on Claude Code 2.1.198.

Root cause / suggested fix

The run snapshot already persists args<claudeDir>/workflows/<runId>.json carries an args field (read by the snapshot loader), and the auto-generated resume prompt already re-emits it (buildResumePrompt: appends , args: ${...} when args !== undefined). The gap is only in the resume call path: when the caller omits args, it doesn't fall back to the recorded snapshot.args.

Suggested one-line fix: on resume (resumeFromRunId present, args omitted), default args to the resumed run's recorded snapshot.args from workflows/<runId>.json. Low-risk — the field is already there.

Failing that: make the bundled deep-research empty-args error name the resume caveat explicitly, e.g. "resume requires the original args — re-pass them alongside resumeFromRunId."

Workaround

Re-pass the original args verbatim alongside resumeFromRunId (the harness's own resume prompt already includes them — copy it whole rather than trimming to {scriptPath, resumeFromRunId}).

View original on GitHub ↗