🛑output-workflow-stop
- プラグイン
- outputai
- ソース
- GitHub で見る ↗
説明
実行中のOutput SDK ワークフローを停止します。 次のような場合に使用: - ワークフローをキャンセルしたいとき - 長時間実行中のプロセスを停止したいとき - 応答しなくなったワークフローを強制終了したいとき - 進行中のワークフローを中断する必要があるとき
原文を表示
Stop a running Output SDK workflow execution. Use when cancelling a workflow, stopping a long-running process, terminating a stuck workflow, or when you need to abort a workflow in progress.
ユースケース
- ✓ワークフローをキャンセルしたいとき
- ✓長時間実行中のプロセスを停止したいとき
- ✓応答しなくなったワークフローを強制終了したいとき
- ✓進行中のワークフローを中断する必要があるとき
本文(日本語訳)
ワークフローの実行停止
概要
実行中のワークフローを停止するスキルです。 ワークフローは TERMINATED(終了済み)状態としてマークされ、残りのステップは実行されません。 この操作は取り消しできないため、慎重に使用してください。
次のような場合に使用
- 不要になったワークフローをキャンセルする場合
- 停止しているように見えるワークフローを止める場合
- 長時間実行中のワークフローを終了してリソースを解放する場合
- 誤ったインプットで起動したワークフローを中断する場合
- 予期しない動作が発生した際の緊急停止
次のような場合には使用しないこと
- ワークフローがまもなく完了する場合(そのまま完了させてください)
- 停止が安全かどうか不明な場合
- デバッグ目的の場合(代わりに
npx output workflow debugを使用) - ワークフローに副作用があり、データが不整合な状態になる可能性がある場合
使用方法
ワークフローの停止
npx output workflow stop <workflowId>
安全性に関する考慮事項
停止前に以下を確認してください:
- 副作用: ワークフローがロールバックが必要な変更を行っていないか?
- 部分的な完了: 副作用を伴って完了済みのステップがあるか?
- 依存関係: 他のワークフローやシステムがこの結果を待機していないか?
- 復旧: 停止後に再起動やクリーンアップが必要か?
使用例
シナリオ: 停止しているワークフローを止める
# ステータスを確認 — ワークフローが長時間実行中
npx output workflow status abc123xyz
# Status: RUNNING (for 2 hours)
# 停止を決定
npx output workflow stop abc123xyz
# Workflow abc123xyz has been stopped
# 終了を確認
npx output workflow status abc123xyz
# Status: TERMINATED
シナリオ: 誤ったインプットで起動したワークフローをキャンセルする
# 起動直後に誤ったインプットに気づいた
npx output workflow start expensive-job '{"wrong": "input"}'
# Workflow ID: job-abc123
# 処理が進む前に停止
npx output workflow stop job-abc123
# 正しいインプットで再起動
npx output workflow start expensive-job '{"correct": "input"}'
シナリオ: 複数のワークフローを停止する
# 実行中のワークフロー一覧を取得
npx output workflow runs list --json | jq '.[] | select(.status == "RUNNING") | .workflowId'
# それぞれを停止(事前に内容をよく確認してください!)
for id in abc123 def456; do
echo "Stopping $id"
npx output workflow stop $id
done
ワークフロー停止後の対応
状態を確認する
npx output workflow status <workflowId>
# Status: TERMINATED
実行内容を確認する
npx output workflow debug <workflowId> --json
以下の情報が表示されます:
- 終了前に完了したステップ
- 部分的な結果や副作用の有無
- ワークフローが停止されたポイント
必要に応じてクリーンアップを行う
ワークフローが途中まで変更を加えていた場合:
- デバッグ出力を確認して、完了済みのステップを把握する
- 必要であれば副作用を手動で元に戻す
- 同様のシナリオに備えたクリーンアップ用ワークフローの作成を検討する
必要であれば再起動する
# 新たに実行を開始する
npx output workflow start <workflowName> '<input>'
停止時に起こること
- Temporal サーバーが終了リクエストを受信する
- 現在実行中のステップが完了または中断される
- 以降のステップは実行されない
- ワークフローのステータスが TERMINATED に変わる
- ワークフローが完了していないため、結果は取得できない
トラブルシューティング
「Workflow not found」と表示される場合
- ワークフロー ID が正しいか確認してください
npx output workflow runs listで有効な ID を確認してください
「Workflow already completed」と表示される場合
- 停止コマンドの前にワークフローが完了しています
- 必要に応じてステータスを確認し、結果を取得してください
「Workflow already terminated」と表示される場合
- ワークフローはすでに停止されています
- 対応は不要です
停止コマンドが応答しない場合
- Temporal サーバーが応答していない可能性があります
- サービスの稼働を確認してください:
docker ps | grep output - サービスの再起動が必要な場合があります
ベストプラクティス
- まずステータスを確認する: ワークフローが実際に RUNNING 状態であることを確認する
- 停止前に内容を確認する:
npx output workflow debugで現在の状態を把握する - 理由を記録する: 将来の参考のため、停止した理由をメモしておく
- クリーンアップを計画する: 手動対応が必要な副作用を事前に把握しておく
- 代替手段を検討する: 場合によっては、停止より待機した方が適切なこともある
関連コマンド
npx output workflow status <id>— 現在のステータスを確認するnpx output workflow debug <id>— 実行の詳細を確認するnpx output workflow start <name>— 新しい実行を開始するnpx output workflow runs list— 実行履歴を表示する
原文(English)を表示
Stop Running Workflow
Overview
This skill stops a running workflow execution. The workflow will be marked as TERMINATED and will not complete its remaining steps. Use this carefully as it cannot be undone.
When to Use This Skill
- Cancelling a workflow that's no longer needed
- Stopping a workflow that appears stuck
- Terminating a long-running workflow to free resources
- Aborting a workflow with incorrect input
- Emergency stop during unexpected behavior
When NOT to Use This
- If the workflow is about to complete (let it finish)
- If you're unsure whether stopping is safe
- For debugging (use
npx output workflow debuginstead) - If the workflow has side effects that may leave data in an inconsistent state
Instructions
Stop a Workflow
npx output workflow stop <workflowId>
Safety Considerations
Before stopping, consider:
- Side effects: Has the workflow made changes that need to be rolled back?
- Partial completion: Are there steps that completed with side effects?
- Dependencies: Are other workflows or systems waiting on this result?
- Recovery: Do you need to restart or clean up after stopping?
Examples
Scenario: Stop a stuck workflow
# Check status - workflow has been running too long
npx output workflow status abc123xyz
# Status: RUNNING (for 2 hours)
# Decide to stop it
npx output workflow stop abc123xyz
# Workflow abc123xyz has been stopped
# Verify it's terminated
npx output workflow status abc123xyz
# Status: TERMINATED
Scenario: Cancel a workflow started with wrong input
# Realized input was wrong immediately after starting
npx output workflow start expensive-job '{"wrong": "input"}'
# Workflow ID: job-abc123
# Stop before it processes too much
npx output workflow stop job-abc123
# Start again with correct input
npx output workflow start expensive-job '{"correct": "input"}'
Scenario: Stop multiple workflows
# Get list of running workflows
npx output workflow runs list --json | jq '.[] | select(.status == "RUNNING") | .workflowId'
# Stop each one (carefully review first!)
for id in abc123 def456; do
echo "Stopping $id"
npx output workflow stop $id
done
After Stopping a Workflow
Check the State
npx output workflow status <workflowId>
# Status: TERMINATED
Review What Happened
npx output workflow debug <workflowId> --json
This shows:
- Which steps completed before termination
- Any partial results or side effects
- The point at which the workflow was stopped
Clean Up If Needed
If the workflow made partial changes:
- Review the debug output to see what completed
- Manually revert any side effects if necessary
- Consider creating a cleanup workflow for this scenario
Restart If Appropriate
# Start a fresh execution
npx output workflow start <workflowName> '<input>'
What Happens When You Stop
- The Temporal server receives the termination request
- The currently executing step may complete or abort
- No further steps are executed
- The workflow status changes to TERMINATED
- The result will not be available (workflow didn't complete)
Troubleshooting
"Workflow not found"
- Check the workflow ID is correct
- Use
npx output workflow runs listto find valid IDs
"Workflow already completed"
- The workflow finished before the stop command
- Check status and get result if needed
"Workflow already terminated"
- The workflow was already stopped
- No action needed
Stop command hangs
- The Temporal server may be unresponsive
- Check if services are running:
docker ps | grep output - May need to restart services
Best Practices
- Always check status first: Confirm the workflow is actually RUNNING
- Review before stopping: Use
npx output workflow debugto understand state - Document why: Note why you stopped the workflow for future reference
- Plan for cleanup: Know what side effects may need manual handling
- Consider alternatives: Sometimes waiting is better than stopping
Related Commands
npx output workflow status <id>- Check current statusnpx output workflow debug <id>- Review execution detailsnpx output workflow start <name>- Start a new executionnpx output workflow runs list- View execution history
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。