出力SDK(開発者向けツール)のワークフロー(一連の処理)を、指定した完了ステップの後から再実行します。その地点までの処理を再度実行してから、以降のステップを改めて実行する新しい実行が作成されます。 **次のような場合に使用:** - 後続するステップのプロンプト(命令文)やロジック(処理方法)を改善する場合に、ワークフロー全体を最初から実行し直したくないとき - 既に成功が確認された地点より後のステップだけに影響する障害から復旧するとき
Re-run an Output SDK workflow from after a specific completed step, creating a new run that replays up to that point and re-executes subsequent steps. Use when iterating on a later step's prompt or logic without re-running the entire workflow, or when recovering from a failure that only affects steps after a known-good point.
このスキルは、ワークフローを特定の完了済みステップの直後から再実行できるようリセットします。 現在の実行は終了され、指定したステップまでのワークフローを再生(記録済みの出力を再利用)したうえで、それ以降のすべてのステップを再実行する新しい実行が作成されます。
次のような場合に使用: 後のステップのみを繰り返し改善したい場合に、LLM 呼び出しや低速な HTTP リクエストなど、コストのかかる初期ステップを再実行しなくて済みます。
npx output workflow stop <id> または terminate <id> で停止する409 が返される)npx output workflow run <name> または workflow start <name> を使用するnpx output workflow reset <workflowId> --step <stepName>
npx output workflow reset <workflowId> --step <stepName> --reason "<理由>"
| フラグ | 省略形 | 必須 | 説明 |
|---|---|---|---|
--step |
-s |
はい | リセット後に再開する、完了済みステップの名前 |
--reason |
-r |
いいえ | 自由記述の理由。監査のために Temporal の履歴に記録される |
workflowId 引数は必須です。ステップ名は、トレースに表示されるステップ関数名を使用します(例: fetchArticle、consolidateCompetitors)。
ステップ名はワークフローの実行トレースから取得します:
npx output workflow debug <workflowId> --json
status: "completed" のステップエントリを探し、その名前を --step に渡します。
成功すると、CLI は元の workflowId と、リセットによって作成された新しい runId を出力します。リセット前の実行は終了されます。
Workflow reset successfully
Workflow ID: lead_enrichment-a1b2c3d4
New Run ID: 8f3e2a91-...
Reset after step: consolidateCompetitors
Reason: retrying with updated prompt
新しい実行の内容を確認するには、新しい runId をピン留めされた workflow runs list で使用してください。
workflowId は変わらないため、workflow status / workflow result はデフォルトで最新の実行を参照します。
シナリオ: 下流のプロンプト修正後に再実行する
# ワークフローが `generateBlogPost` で失敗したが、
# 直前のステップ `consolidateCompetitors` は正常完了していた。
npx output workflow debug lead_enrichment-a1b2c3d4 --json
# ... consolidateCompetitors が完了していることを確認
# src/workflows/lead_enrichment/prompts/generate_blog_post@v1.prompt を編集
# コストのかかる competitor consolidation の LLM 呼び出しをスキップして、
# 最後に正常完了したステップの直後から再実行する。
npx output workflow reset lead_enrichment-a1b2c3d4 \
--step consolidateCompetitors \
--reason "Retry with updated blog-post prompt"
シナリオ: 上流のコストを再負担せず後のステップを繰り返し改善する
# ワークフローは完了したが、ステップの出力が期待通りでない場合。最後のステップのみ再実行する。
npx output workflow reset blog_evaluator-xyz789 --step analyze_claims
# 新しい実行の結果を確認する
npx output workflow result blog_evaluator-xyz789
シナリオ: 監査用の理由を記録する
npx output workflow reset wf-12345 \
--step fetchCompanyData \
--reason "Source API returned stale data; rerunning after cache invalidation"
シナリオ: 後続処理のために新しい実行 ID を取得する
# リセット出力から新しい runId を取得し、実行を監視する
npx output workflow reset lead_enrichment-a1b2c3d4 --step lookupCompany
npx output workflow status lead_enrichment-a1b2c3d4
npx output workflow result lead_enrichment-a1b2c3d4
| エラー | 原因 | 対処法 |
|---|---|---|
404 ワークフローまたはステップが見つからない |
workflowId または --step 名が誤っている |
npx output workflow runs list および workflow debug <id> で確認する |
409 ステップが完了していない |
対象のステップがまだ実行中か、一度も実行されていない | ステップの完了を待つか、より前の完了済みステップを選択する |
| API が無効なレスポンスを返した | 通信障害 | docker ps | grep output および curl http://localhost:3001/health でサービスを確認する |
workflow debug で確認する — リセット地点を選ぶ前に、どのステップが完了しているかを確認する<stepName> の後からすべてを再実行し、そのステップ自体は再実行されない--reason を記録する — Temporal の履歴に表示され、チームメンバーや将来の自分が実行が分岐した理由を把握しやすくなるnpx output workflow debug <id> — --step に渡す完了済みステップ名を確認するnpx output workflow runs list — リセットによって作成された新しい実行と、終了した元の実行を一覧表示するnpx output workflow status <id> — 新しい実行のステータスを確認するnpx output workflow result <id> — 新しい実行の最終出力を取得するnpx output workflow stop <id> / workflow terminate <id> — リセット前に実行中のワークフローを停止するnpx output workflow run <name> / workflow start <name> — 再生なしでゼロからクリーンに実行するThis skill resets a workflow to re-run from after a specific completed step. The current run is terminated and a new run is created that replays the workflow up to the given step (reusing its recorded output), then re-executes every step after it.
Use this to avoid re-running expensive early steps (like LLM calls or slow HTTP requests) when you only need to iterate on a later step.
npx output workflow stop <id> or terminate <id>409)npx output workflow run <name> or workflow start <name>npx output workflow reset <workflowId> --step <stepName>
npx output workflow reset <workflowId> --step <stepName> --reason "<why>"
| Flag | Short | Required | Description |
|---|---|---|---|
--step |
-s |
yes | Name of the completed step to reset after |
--reason |
-r |
no | Free-text reason, recorded in Temporal history for auditability |
The workflowId argument is required. The step name is the step function name as it appears in the trace (e.g. fetchArticle, consolidateCompetitors).
Step names come from the workflow's execution trace:
npx output workflow debug <workflowId> --json
Look for step entries with status: "completed". The step name is the one you pass to --step.
On success the CLI prints the original workflowId and a new runId — the new run created by the reset. The pre-reset run is terminated.
Workflow reset successfully
Workflow ID: lead_enrichment-a1b2c3d4
New Run ID: 8f3e2a91-...
Reset after step: consolidateCompetitors
Reason: retrying with updated prompt
Use the new runId (via the pinned workflow runs list) to inspect the new execution. The workflowId is unchanged, so workflow status / workflow result will target the latest run by default.
Scenario: Rerun after fixing a downstream prompt
# The workflow failed at `generateBlogPost`, but `consolidateCompetitors`
# (the step before it) completed successfully.
npx output workflow debug lead_enrichment-a1b2c3d4 --json
# ... confirms consolidateCompetitors completed
# Edit src/workflows/lead_enrichment/prompts/generate_blog_post@v1.prompt
# Then rerun from after the last good step — skipping the expensive
# competitor consolidation LLM call.
npx output workflow reset lead_enrichment-a1b2c3d4 \
--step consolidateCompetitors \
--reason "Retry with updated blog-post prompt"
Scenario: Iterate on a late step without re-paying upstream costs
# Workflow completed, but step output is wrong. Rerun just the last step.
npx output workflow reset blog_evaluator-xyz789 --step analyze_claims
# Check the new run's result
npx output workflow result blog_evaluator-xyz789
Scenario: Record an audit reason
npx output workflow reset wf-12345 \
--step fetchCompanyData \
--reason "Source API returned stale data; rerunning after cache invalidation"
Scenario: Capture the new run ID for follow-up
# Grab the new runId from the reset output, then watch it
npx output workflow reset lead_enrichment-a1b2c3d4 --step lookupCompany
npx output workflow status lead_enrichment-a1b2c3d4
npx output workflow result lead_enrichment-a1b2c3d4
| Error | Cause | Solution |
|---|---|---|
404 Workflow or step not found |
Wrong workflowId or --step name |
Check with npx output workflow runs list and workflow debug <id> |
409 Step has not completed |
Target step is still running or never ran | Wait for the step to complete, or pick an earlier completed step |
| API returned invalid response | Transport failure | Check services with `docker ps |
workflow debug — confirm which steps completed before picking a reset point<stepName>; the step itself is not re-executed--reason — it shows up in Temporal history and helps teammates (and future you) understand why the run forkednpx output workflow debug <id> — find completed step names to pass to --stepnpx output workflow runs list — see the new run created by reset alongside the terminated originalnpx output workflow status <id> — check the new run's statusnpx output workflow result <id> — get the new run's final outputnpx output workflow stop <id> / workflow terminate <id> — stop a running workflow before resettingnpx output workflow run <name> / workflow start <name> — fresh run from scratch (no replay)原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。