**Clay workflows — オーディエンス内のデータ充実** 既存のオーディエンス充実ワークフロー(顧客情報をクレイ側で追加・更新するワークフロー)内で、データ充実のステップを構築し、その結果をオーディエンスにマッピングしていきます。 次のような場合に使用: ワークフロー編集画面で、`clay workflows get`コマンドの出力タイプが`audience_enrichment`となっているワークフロー内でのみ
Clay workflows — build enrichment steps and map their results back to Audiences in an existing audience enrichment workflow. Use only while editing a workflow whose `clay workflows get` output has type `audience_enrichment`.
このスキルは、タイプが audience_enrichment である既存のワークフローにのみ使用します。ワークフロー固有の一連の手順を担当します:充実化ステップの構築、共有される最終的なオーディエンス書き込みの確認、充実化結果のオーディエンスフィールドへのマッピングです。
まず、workflows と audiences スキルの完全なドキュメントを読んでください。プロバイダーアクション(外部サービスの処理)を選択する際は /workflows-discover-actions を読み、書き込みのマッピングの前に workflows スキルの audiences.md を読んでください。
すべてのタスクの開始時に、以下を実行してください:
clay workflows get <workflowId>
.type が正確に audience_enrichment である場合のみ続行してください。タイプが null、未設定、account_agents、またはその他の値の場合は、このスキルの使用を中止し、一般的な workflows スキルに戻ってください。ワークフローを暗黙的に変換または再分類してはいけません。
完全なグラフを読み、オーディエンストリガー(開始点)、既存の充実化ステップ、現在の書き込みノードを特定します。ユーザーに以下を確認してください:
audiences スキルを使用してフィールドの入力率を確認し、一致するレコードをカウントします。プロバイダーのデータは直接充実化アクションを、再利用可能なワークスペースロジックは Clay 関数を、非構造化データの調査または分類はエージェント(AI を使った自動処理)を、適格性確認とフォールバック(代替案)は条件分岐を、決定論的な変換はコードを優先してください。
簡潔な計画を提示し、グラフを編集する前に承認を得てください。公開する前に別途承認を得てください。テストは認可されたスコープ内で行い、コスト開示と重大な支出確認については workflows-discover-actions/cost-and-budget.md の共有ポリシーに従ってください。
既存のオーディエンストリガーから構築してください。トリガーと既存の upsert-audiences-record ノードは保持します。
clay workflows actions list と clay workflows actions schema を使用して各充実化アクションを選択し、設定してください。アクション入力の名前、出力パス、認証情報、またはプロバイダーの可用性を推測してはいけません。コストの低い適格性確認を有料アクションの前に配置してください。充実化の結果が空になる可能性がある場合は、ユーザーが選択したフォールバックまたは条件分岐パスを使用し、空の値をそのまま書き込まないようにしてください。
ノード作成、挿入、データ受け渡し、分岐接続には一般的な workflows スキルを使用してください。中間ステップの構築中に、最終的なオーディエンス書き込みを手動で作成または再接続しないでください。
充実化グラフの構造が完成したら、以下を実行してください:
clay workflows ensure-audience-writeback <workflowId>
このコマンドは、オーディエンス充実化エディターと同じサーバー側のヘルパーを呼び出します。正確に 1 つの upsert-audiences-record ノードを作成または再利用し、そのエンティティタイプを検証し、すべての適格な終端ルートを再接続します。手動のノードまたはエッジ編集でこのトポロジー(構造)の変更を再現しないでください。
返されたノードを読んで更新してください。ツール ID と静的な entityType を保持してから、clay workflows nodes update を使用して inputMappingConfig を設定し、clay workflows nodes get から取得した書き込み可能な形式を使用してください。
宛先フィールドを以下で確認してください:
clay audiences fields list --entity-type people
clay audiences fields list --entity-type companies
完全なマッピング形式については、workflows スキルの audiences.md に従ってください。特に以下の点に注意してください:
lookupFields|selectedLookupFields を静的配列 ["id"] に設定してくださいlookupFields|id をオーディエンストリガーレコード ID にバインドしてください:トリガー出力スキーマが fields オブジェクトを含む場合は $.fields.id を使用し、そうでない場合は $.id を使用してください。トリガー出力スキーマを検査し、パスを推測しないでくださいrecordFields|selectedRecordFields にすべての宛先 ID を含め、一致する recordFields|<id> バインディングを提供してくださいrecordFields|removeNullValues を true に設定してください。ただしユーザーが明示的に既存の値をクリアしたい場合を除きます$.result.<outputPath> パスから充実化出力をバインドしてください。パスを創作しないでください書き込みノードを更新後に再度読み込み、マッピングが保持されていることを確認してください。
グラフを検証し、結果のダイアグラム(図)を表示してください。まず小さなオーディエンスサンプルでテストし、充実化出力と最終的なオーディエンス更新の両方を検査し、制限を増やす前にマッピングを修正してください。ユーザーがテスト済みのドラフトを承認した後のみ公開してください。後の編集は、ワークフローが再度公開されるまでドラフトのままです。
Use this skill only for an existing workflow whose type is audience_enrichment. It owns the
workflow-specific sequence: build enrichment steps, ensure the shared final Audiences writeback,
and map enrichment results onto audience fields.
Read the complete workflows and audiences skills first. Read /workflows-discover-actions when
choosing provider actions, and read the workflows skill's audiences.md before mapping the
writeback.
Start every task with:
clay workflows get <workflowId>
Continue only when .type is exactly audience_enrichment. If the type is null, absent,
account_agents, or anything else, stop using this skill and return to the general workflows
skill. Never convert or reclassify a workflow implicitly.
Read the full graph and identify the audience trigger, existing enrichment steps, and current writeback node. Confirm with the user:
Use the audiences skill to inspect field fill rates and count matching records. Prefer direct
enrichment actions for provider data, Clay functions for reusable workspace logic, agents for
unstructured research or classification, conditionals for eligibility and fallbacks, and code for
deterministic transformations.
Present a short plan and get approval before editing the graph. Get separate approval before
publishing. Testing must be within the authorized scope; follow the shared policy in
workflows-discover-actions/cost-and-budget.md for cost disclosure and significant-spend confirmation.
Build from the existing audience trigger. Preserve the trigger and any existing
upsert-audiences-record node.
Use clay workflows actions list and clay workflows actions schema to choose and configure each
enrichment. Never guess action input names, output paths, credentials, or provider availability.
Put cheap eligibility checks before paid actions. When an enrichment can miss, use the user's
chosen fallback or conditional path rather than silently writing a blank value.
Use the general workflows skill for node creation, insertion, data passing, and branch wiring.
Do not manually create or reconnect the final audience writeback while building intermediate
steps.
After the enrichment graph is structurally complete, run:
clay workflows ensure-audience-writeback <workflowId>
This command calls the same server-side helper as the audience enrichment editor. It creates or
reuses exactly one upsert-audiences-record node, validates its entity type, and reconnects every
eligible terminal route. Do not reproduce that topology change with manual node or edge edits.
Read the returned node before updating it. Preserve its tool identity and static entityType, then
configure its inputMappingConfig with clay workflows nodes update using the writable shape from
clay workflows nodes get.
Discover destination fields with:
clay audiences fields list --entity-type people
clay audiences fields list --entity-type companies
Follow the workflows skill's audiences.md for the complete mapping shape. In particular:
lookupFields|selectedLookupFields to the static array ["id"]lookupFields|id to the audience trigger record id: use $.fields.id when the trigger
output schema contains a fields object, otherwise use $.id; inspect the trigger output schema
and never guess the pathrecordFields|selectedRecordFields and provide its matching
recordFields|<id> bindingrecordFields|removeNullValues to true unless the user explicitly wants blanks to clear
existing values$.result.<outputPath> paths; never invent pathsRead the writeback node again after updating it and confirm the mappings persisted.
Validate the graph and show the resulting diagram. Test a small audience sample first, inspect both the enrichment output and the final Audiences update, and correct mappings before increasing the limit. Publish only after the user approves the tested draft. Later edits remain draft-only until the workflow is published again.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。