**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 関数、非構造化調査や分類の場合はエージェント、適格性と代替手段の場合は条件分岐、決定的な変換の場合はコードを優先してください。
曖昧でない既存フィールドをマッピングする際、それを使用するか新しいものを作成するか尋ねないでください。フィールド更新のリクエストに再確認は不要です(すでに値がある場合があるため)。空白補充のみの制限は、ユーザーが明示的に要求しない限り追加しないでください。曖昧なマッピングの場合、妥当なフィールド選択肢と新規フィールド作成オプションを提案してください。必要なフィールドは許可を求めず、workflows スキルの audiences.md に従って作成してください。すでに行われたフィールド選択を再利用してください。
ユーザーがすでに編集を承認していない限り、グラフ編集前に短い計画を提示して承認を得てください。公開前に別途承認を取ってください。テストは承認範囲内である必要があります。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 get からの書き込み可能な形式で clay workflows nodes update を使用して inputMappingConfig を設定してください。
出力先フィールドを以下で検出してください:
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. Resolve the following from the workflow and user instructions, asking only where a choice remains:
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.
Map unambiguous existing fields without asking whether to use them or create new ones. A request
to update a field does not need another confirmation because it may already have values; do not
add a fill-blanks-only restriction unless requested. For ambiguous mappings, offer plausible fields
and a new-field option. Create needed fields without asking permission, following the
workflows skill's audiences.md. Reuse field choices already made.
Present a short plan and get approval before editing the graph unless the user already authorized
the edits. 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 による自動翻訳です。