ワークフロー(自動処理の流れ)の問題をデバッグします。 **次のような場合に使用:** - ユーザーがワークフローの失敗、エラー、処理停止、または予期しない結果について報告している - ワークフロー実行のデバッグ、トラブルシューティング(問題解決)、調査をユーザーが依頼している
Debug Output SDK workflow issues. Use when user reports a workflow failing, erroring, hanging, producing wrong results, or asks to debug, troubleshoot, or investigate a workflow execution.
ローカル開発環境で Output SDK ワークフローの問題を体系的にデバッグするタスクです。
ユーザーが提供した情報には、発生している問題の説明と、特定のワークフロー ID が含まれている場合があります。
todo ツールを使用して、デバッグプロセスを通じた進捗を追跡してください。
ワークフロー実行の問題を特定して解決するため、体系的なアプローチに従います。インフラストラクチャの確認、情報収集、実行履歴(トレース)の分析、対象を絞った修正の適用を行います。
前提チェック実施: Claude Skill: output-meta-pre-flight
デバッグを開始する前に、すべての必要なサービスが稼働していることを確認します。output-services-check スキルが詳しいガイダンスを提供します。
確認コマンド:
# Docker コンテナが稼働しているか確認
docker ps | grep output
# Output サービスが応答しているか確認
curl -s http://localhost:3001/health || echo "API が応答していません"
# Temporal UI(ワークフロー管理画面)にアクセスできるか確認
curl -s http://localhost:8080 > /dev/null && echo "Temporal UI にアクセス可能" || echo "Temporal UI にアクセスできません"
判定と対応:
docker compose up -d を実行して起動待機(30~60 秒)npx output dev を実行期待される状態:
output の Docker コンテナが稼働中http://localhost:3001 で応答http://localhost:8080 でアクセス可能失敗したワークフロー実行を特定するため、最近の実行一覧を表示します。output-workflow-runs-list スキルが詳細なフィルタリング方法を提供します。
一覧表示コマンド:
# 最近のワークフロー実行をすべて表示
npx output workflow runs list
# 特定のワークフロータイプでフィルタ(判明している場合)
npx output workflow runs list <workflowName>
# 詳細な JSON 形式で出力
npx output workflow runs list --json
# 最新 10 件に限定
npx output workflow runs list --limit 10
確認のポイント:
判定と対応:
npx output workflow list でワークフロー自体が存在するか確認し、必要に応じて npx output workflow run <name> で実行特定されたワークフローの実行履歴を取得して分析します。output-workflow-trace スキルが分析手法を提供します。
デバッグコマンド:
# 実行履歴をテキスト形式で表示
npx output workflow debug <workflowId>
# 完全な実行履歴を JSON 形式で表示(詳細分析に推奨)
npx output workflow debug <workflowId> --json
ヒント: 完全で無制限の履歴データを得るには --json オプションを使用してください。
分析チェックリスト:
Temporal UI(ビジュアル検査用):
Temporal Web UI(http://localhost:8080)を開いてワークフローを視覚的に確認できます:
実行履歴の分析に基づいて、エラーパターンを特定し、対象を絞った修正案を提示します。症状に応じて関連するエラー対応スキルが呼び出されます。
エラーマッチング表:
| 症状 | 対応スキル |
|---|---|
| スキーマ互換性エラー、型エラー | output-error-zod-import |
| リプレイ失敗、一貫性のない結果 | output-error-nondeterminism |
| リトライが機能しない、エラーが抑制される | output-error-try-catch |
| 型エラー、ステップ境界での undefined | output-error-missing-schemas |
| ワークフロー停止、決定性エラー | output-error-direct-io |
| トレースされないリクエスト、axios エラー | output-error-http-client |
判定と対応:
修正後の検証:
# ワークフローを再実行して修正を確認
npx output workflow run <workflowName> --input '<json>'
# または非同期で実行して結果を確認
npx output workflow start <workflowName> --input '<json>'
npx output workflow status <workflowId>
npx output workflow result <workflowId>
# 修正が特定ステップのみに影響する場合、
# 前のステップまでスキップして再実行(それ以前の処理はやり直さない)
npx output workflow reset <workflowId> --step <lastGoodStep> --reason "<修正の説明>"
修正後の対象を絞った再実行については、output-workflow-reset スキルを参照してください。
終了時チェック実施: Claude Skill: output-meta-post-flight
ユーザーが提供した問題説明とワークフロー ID(オプション)を参考にしてください。
Your task is to systematically debug an Output SDK workflow issue in a local development environment.
The arguments the user provided describe the problem they're experiencing, and may include a specific workflow ID.
Use the todo tool to track your progress through the debugging process.
Follow a systematic approach to identify and resolve workflow execution issues: verify infrastructure, gather evidence, analyze traces, and apply targeted fixes.
<pre_flight_check>
EXECUTE: Claude Skill: output-meta-pre-flight
</pre_flight_check>
<process_flow>
<step number="1" name="verify_services">
Before debugging, confirm that all required services are operational. The output-services-check skill provides comprehensive guidance.
<verification_commands>
# Check Docker containers are running
docker ps | grep output
# Verify Output services respond
curl -s http://localhost:3001/health || echo "API not responding"
# Check Temporal UI is accessible
curl -s http://localhost:8080 > /dev/null && echo "Temporal UI accessible" || echo "Temporal UI not accessible"
</verification_commands>
<decision_tree> IF docker_not_running: RUN: docker compose up -d WAIT: for services to start (30-60 seconds) IF output_dev_not_running: RUN: npx output dev WAIT: for services to initialize IF all_services_running: PROCEED: to step 2 </decision_tree>
Expected State:
output are runninghttp://localhost:3001http://localhost:8080</step>
<step number="2" name="list_workflow_runs">
Identify the failing workflow execution by listing recent runs. The output-workflow-runs-list skill provides detailed filtering guidance.
<list_commands>
# List all recent workflow runs
npx output workflow runs list
# Filter by specific workflow type (if known)
npx output workflow runs list <workflowName>
# Get detailed JSON output for analysis
npx output workflow runs list --json
# Limit results to most recent
npx output workflow runs list --limit 10
</list_commands>
<identification_criteria> Look for:
<decision_tree>
IF user_provided_workflow_id:
USE: provided workflow ID
PROCEED: to step 3
IF failed_runs_found:
SELECT: most recent failed run
NOTE: workflow ID from output
PROCEED: to step 3
IF no_runs_found:
CHECK: workflow exists with npx output workflow list
IF workflow_not_found:
REPORT: workflow doesn't exist
SUGGEST: verify workflow name and location
ELSE:
SUGGEST: run the workflow with npx output workflow run <name>
</decision_tree>
</step>
<step number="3" name="debug_workflow" subagent="workflow-debugger">
Retrieve and analyze the execution trace for the identified workflow. The output-workflow-trace skill provides analysis techniques.
<debug_commands>
# Display execution trace (text format)
npx output workflow debug <workflowId>
# Display full untruncated trace (JSON format) - recommended for detailed analysis
npx output workflow debug <workflowId> --json
</debug_commands>
Tip: Use --json for complete trace data without truncation.
<analysis_checklist>
<temporal_ui_guidance> For visual workflow inspection, open the Temporal Web UI at http://localhost:8080:
</step>
<step number="4" name="suggest_fixes" subagent="workflow-quality">
Based on the trace analysis, identify the error pattern and suggest targeted fixes. Claude will invoke the relevant error skill based on symptoms.
<error_matching>
| Symptom | Skill |
|---|---|
| "incompatible schema" errors, type errors | output-error-zod-import |
| Replay failures, inconsistent results | output-error-nondeterminism |
| Retries not working, errors swallowed | output-error-try-catch |
| Type errors, undefined properties at step boundaries | output-error-missing-schemas |
| Workflow hangs, determinism errors | output-error-direct-io |
| Untraced requests, axios errors | output-error-http-client |
</error_matching>
<decision_tree> IF error_matches_known_pattern: INVOKE: relevant error skill for detailed fix ELSE: CONSULT: workflow-quality subagent for additional patterns SUGGEST: Manual trace inspection in Temporal UI </decision_tree>
<verification> After applying fix:
# Re-run the workflow to verify
npx output workflow run <workflowName> --input '<json>'
# Or start asynchronously and check result
npx output workflow start <workflowName> --input '<json>'
npx output workflow status <workflowId>
npx output workflow result <workflowId>
# Or, if the fix only affects a specific step and earlier steps succeeded,
# re-run from after the last known-good step (skips re-executing earlier work)
npx output workflow reset <workflowId> --step <lastGoodStep> --reason "<fix description>"
For targeted rerun after fixing a downstream step, see the output-workflow-reset skill.
</verification>
</step>
</process_flow>
<post_flight_check>
EXECUTE: Claude Skill: output-meta-post-flight
</post_flight_check>
---- START ----
Use the problem description and any optional workflow ID the user provided.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。