出力SDK(ソフトウェア開発キット)のワークフロー実行トレース(処理の履歴記録)を分析します。 次のような場合に使用: 特定のワークフローをデバッグ(問題を修正)したい、ステップの失敗を調べたい、入出力データを分析したい、実行の流れを理解したい、または調査対象となるワークフローIDがある場合。
Analyze Output SDK workflow execution traces. Use when debugging a specific workflow, examining step failures, analyzing input/output data, understanding execution flow, or when you have a workflow ID to investigate.
このスキルは、Output CLIを使ってワークフロー実行トレース(実行記録)を取得・分析するための手引きを提供します。トレースには、各ステップの入力・出力、エラー、実行時間などの完全な実行履歴が記録されます。
基本的なトレース(テキスト形式、長い値は省略される場合あり):
npx output workflow debug <workflowId>
完全なトレース(JSON形式、詳細な分析に推奨):
npx output workflow debug <workflowId> --json
ヒント: 完全なトレースデータが必要な場合は、常に --json を使用してください。テキスト形式は長い値を省略するため、重要なデバッグ情報が隠れる可能性があります。
トレースを確認する際は、以下のチェックリストに従ってください:
ブラウザで http://localhost:8080 を開き、ワークフローの見た目での検査ができます:
| エラーメッセージ | 原因の可能性 |
|---|---|
| 「incompatible schema」 | Zodインポートの問題 - zod を使用(正しくは @outputai/core) |
| 「non-deterministic」 | Math.random()やDate.now()などの非決定的な関数をワークフロー内で使用 |
| 「FatalError」リトライコンテキスト付き | ステップ呼び出しをtry-catchでラップしている |
| 「undefined is not a function」 | スキーマ定義が不足している |
| 「workflow must be deterministic」 | ワークフロー関数内での直接的なI/O操作 |
| 「ECONNREFUSED」またはタイムアウト | サービスが起動していないか、ネットワークに問題がある |
JSON トレースを確認する際は、以下のフィールドに注目してください:
steps[].name: ステップの識別子steps[].status: 実行結果steps[].input: ステップに渡されたデータsteps[].output: ステップから返されたデータsteps[].error: 失敗時のエラー詳細steps[].attempts: 実行試行の回数steps[].duration: ステップにかかった時間シナリオ: 失敗したワークフローをデバッグする
# 実行リストからワークフローIDを取得
npx output workflow runs list --limit 5 --json
# 詳細なトレースを取得
npx output workflow debug abc123xyz --json
# 出力から失敗したステップを探す
# 出力の例:
# {
# "workflowId": "abc123xyz",
# "status": "FAILED",
# "steps": [
# { "name": "fetchData", "status": "COMPLETED", ... },
# { "name": "processData", "status": "FAILED", "error": "..." }
# ]
# }
シナリオ: リトライ動作を調査する
npx output workflow debug abc123xyz --json | jq '.steps[] | select(.attempts > 1)'
シナリオ: 特定のステップへの入力を確認する
npx output workflow debug abc123xyz --json | jq '.steps[] | select(.name == "processData") | .input'
workflow-quality サブエージェントに相談npx output workflow run <workflowName> --input '<input>'This skill provides guidance on retrieving and analyzing workflow execution traces using the Output CLI. Traces show the complete execution history including step inputs, outputs, errors, and timing information.
Basic trace (text format, may be truncated):
npx output workflow debug <workflowId>
Full trace (JSON format, recommended for detailed analysis):
npx output workflow debug <workflowId> --json
Tip: Always use --json when you need complete trace data. The text format truncates long values which can hide important debugging information.
Follow this checklist when examining a trace:
Open http://localhost:8080 in your browser for a visual workflow inspection:
| Error Message | Likely Cause |
|---|---|
| "incompatible schema" | Zod import issue - using zod instead of @outputai/core |
| "non-deterministic" | Using Math.random(), Date.now(), etc. in workflow code |
| "FatalError" with retry context | Try-catch wrapping step calls |
| "undefined is not a function" | Missing schema definitions |
| "workflow must be deterministic" | Direct I/O in workflow function |
| "ECONNREFUSED" or timeout | Services not running or network issues |
When examining JSON traces, focus on these fields:
steps[].name: Step identifiersteps[].status: Execution resultsteps[].input: Data passed to the stepsteps[].output: Data returned from the stepsteps[].error: Error details if failedsteps[].attempts: Number of execution attemptssteps[].duration: How long the step tookScenario: Debug a failed workflow
# Get the workflow ID from runs list
npx output workflow runs list --limit 5 --json
# Get detailed trace
npx output workflow debug abc123xyz --json
# Look for the failing step in the output
# Example output structure:
# {
# "workflowId": "abc123xyz",
# "status": "FAILED",
# "steps": [
# { "name": "fetchData", "status": "COMPLETED", ... },
# { "name": "processData", "status": "FAILED", "error": "..." }
# ]
# }
Scenario: Investigate retry behavior
npx output workflow debug abc123xyz --json | jq '.steps[] | select(.attempts > 1)'
Scenario: Check inputs to a specific step
npx output workflow debug abc123xyz --json | jq '.steps[] | select(.name == "processData") | .input'
workflow-quality subagent for best practicesnpx output workflow run <workflowName> --input '<input>'原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。