Clay ワークフロー — CLI(`clay workflows` コマンド)を使用して、ワークフローの実行にかかるクレジット(利用料金)と LLM コストを削減します。高額な処理パターンを見つけ出し、より安価な代替案を提案します。
Clay workflows — reduce a workflow's credit and LLM cost via the CLI (`clay workflows` commands). Identifies expensive patterns and suggests cheaper alternatives.
現在のワークフローを分析し、品質を損なわずにクレジット消費とLLMコストを削減する変更提案を行います。
clay workflows graph get <workflowId> --mode full を使ってすべてのノード(処理ステップ)の詳細を取得clay workflows diagram <workflowId> で現在のグラフを表示して、どのノードが費用を増やしているかを明らかにするclay workflows nodes update/create/delete を使用)。許可されたら安全な最適化から順に適用し、品質や動作に大きな影響がある変更については事前に確認するclay workflows graph format <workflowId> を実行して更新されたグラフを表示し、変更を視覚的に確認できるようにする処理全体を説明し、生のノード情報ではなく図を優先して表示する(workflows スキルの presenting.md を参照)。
通常の LLM ノードは、実行ごとに最低でも1回以上の LLM 呼び出しを行います。より高性能なモデルほど費用がかかります。
最適化方法:
static(固定値)または reference(参照値)入力マッピング(inputMappingConfig、workflows スキルの data-passing.md を参照)で設定する。すべてのパラメータが事前設定されていれば、LMパラメータマッピング呼び出しはスキップされますClay アクション実行ごとに、アクションの料金レベルに応じたクレジットが消費されます。
最適化方法:
sourceNodeId/sourcePath)で参照して、再度アクションを呼び出さないclay workflows actions list(/workflows-discover-actions を参照)で選択肢と料金レベルを比較するモデルごとに費用対効果のバランスが異なります。
最適化方法:
マップノードは処理する項目数だけコストが増えます。
最適化方法:
条件付きノード(条件判定ノード)を使って、不要な項目については高額な処理分岐をスキップします。
例:
従来: [すべての項目] → [高額な情報取得] → [処理]
改善後: [すべての項目] → [条件判定: データあり?] → Yes → [処理]
→ No → [情報取得] → [処理]
最適化の機会ごとに、以下を提示します:
提案は削減効果の大きい順に優先順位を付けます。提案一覧と現在のグラフ表示を並べ、高額なノードを目立たせることで、各提案がどこに該当するかを明確にします。
分析または推奨提案の場合は、編集せずに機会を提示します。ユーザーがワークフロー修正を指示したら、明らかに安全な削減を特定した順に適用し、前提条件を説明します。品質・コスト・動作に大きな影響があれば事前に確認してから実行します。その後 clay workflows graph format <workflowId> で検証し、更新されたグラフを表示して、ユーザーが変更前後の違いを確認できるようにします。
Analyze the current workflow and suggest changes to reduce credit consumption and LLM costs without sacrificing quality.
clay workflows graph get <workflowId> --mode full to get all node detailsclay workflows diagram <workflowId>) with the expensive nodes called out so the user can see where the cost livesclay workflows nodes update/create/delete. Once authorized, apply clearly safe optimizations as you go and ask before changes with a material quality or behavior trade-offclay workflows graph format <workflowId> and render the updated graph so the change is visibleNarrate throughout and prefer the diagram over raw node JSON — see the workflows skill's presenting.md.
Every regular (LLM) node makes at least one LLM call per execution. More capable models cost more.
Optimizations:
static or reference input mappings (inputMappingConfig, see the workflows skill's data-passing.md) for parameters that don't need LLM inference. If ALL parameters are pre-mapped, the LLM parameter mapping call is skipped entirelyEach Clay action execution consumes credits based on the action's pricing tier.
Optimizations:
sourceNodeId/sourcePath) instead of calling the action againclay workflows actions list (see /workflows-discover-actions) to compare options and their priority tierDifferent models have different cost/capability profiles.
Optimizations:
Map nodes multiply costs by the number of items processed.
Optimizations:
Use conditional nodes to skip expensive branches for items that don't need them.
Example:
Instead of: [All items] → [Expensive enrichment] → [Process]
Do this: [All items] → [Conditional: has data?] → Yes → [Process]
→ No → [Enrichment] → [Process]
For each optimization opportunity, present:
Prioritize suggestions by impact (highest savings first). Pair the list with the current-graph render, with the expensive nodes called out, so each is easy to locate.
For analysis or recommendation requests, present the opportunities without editing. If the user asks you to modify the workflow, apply clearly safe savings as you identify them and state your assumptions. Ask only when an optimization has a meaningful quality, cost, or behavior trade-off. Then validate with clay workflows graph format <workflowId> and show the updated graph so the user can see the before/after difference.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。