> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# オートメーション の概要

> W&B オートメーション API を使用して、ML パイプラインの自動化ワークフローを作成および管理します

W\&B オートメーション API を使用すると、ML パイプライン内のイベントに応じて実行される自動化ワークフローを、プログラムから作成および管理できます。モデル性能のしきい値やアーティファクトの作成など、特定の条件を満たしたときにトリガーされる action を設定できます。

<h3 id="core-classes">
  コアクラス
</h3>

| クラス | 説明 |
| - | - |
| [`Automation`](/ja/products/wandb/ref/python/automations/automation) | 保存済みのオートメーションインスタンスとその設定を表します。 |
| [`NewAutomation`](/ja/products/wandb/ref/python/automations/newautomation) | 新しいオートメーションを作成するためのビルダークラスです。 |

<h3 id="events-triggers">
  イベント (トリガー)
</h3>

| イベント | 説明 |
| - | - |
| [`OnRunMetric`](/ja/products/wandb/ref/python/automations/onrunmetric) | run のメトリクスが指定した条件 (しきい値、変化など) を満たしたときにトリガーされます。 |
| [`OnCreateArtifact`](/ja/products/wandb/ref/python/automations/oncreateartifact) | コレクションに新しいアーティファクトが作成されたときにトリガーされます。 |
| [`OnLinkArtifact`](/ja/products/wandb/ref/python/automations/onlinkartifact) | アーティファクトがレジストリにリンクされたときにトリガーされます。 |
| [`OnAddArtifactAlias`](/ja/products/wandb/ref/python/automations/onaddartifactalias) | アーティファクトにエイリアスが追加されたときにトリガーされます。 |

<h3 id="actions">
  Actions
</h3>

| Action | 説明 |
| - | - |
| [`SendNotification`](/ja/products/wandb/ref/python/automations/sendnotification) | Slack などの統合済みチャンネル経由で通知を送信します。 |
| [`SendWebhook`](/ja/products/wandb/ref/python/automations/sendwebhook) | 外部サービスに HTTP webhook リクエストを送信します。 |
| [`DoNothing`](/ja/products/wandb/ref/python/automations/donothing) | オートメーションの設定をテストするためのプレースホルダー action です。 |

<h3 id="filters">
  フィルター
</h3>

| フィルター | 説明 |
| - | - |
| [`MetricThresholdFilter`](/ja/products/wandb/ref/python/automations/metricthresholdfilter) | メトリクスの値としきい値の比較結果に基づいて run をフィルターします。 |
| [`MetricChangeFilter`](/ja/products/wandb/ref/python/automations/metricchangefilter) | メトリクスの値の経時的な変化に基づいて run をフィルターします。 |

<h2 id="common-use-cases">
  一般的なユースケース
</h2>

<h3 id="model-performance-monitoring">
  モデル性能のモニタリング
</h3>

* モデルの精度がしきい値を下回ったときにアラートを送信する
* トレーニングの損失が頭打ちになったときにチームに通知する
* パフォーマンスメトリクスに基づいて再トレーニングパイプラインを起動する

<h3 id="artifact-management">
  アーティファクト管理
</h3>

* 新しいモデルバージョンが作成されたときに通知を送信する
* アーティファクトにタグが付けられたときにデプロイメントワークフローをトリガーする
* データセットが更新されたときに後続の処理を自動化する

<h3 id="experiment-tracking">
  実験管理
</h3>

* 失敗またはクラッシュした run についてアラートを送信する
* 長時間実行される実験の完了時に通知する
* 実験のメトリクスの日次サマリーを送信する

<h3 id="integration-workflows">
  インテグレーションワークフロー
</h3>

* webhook 経由で外部のトラッキングシステムを更新する
* モデルレジストリをデプロイメントプラットフォームと同期する
* W\&B のイベントに応じて CI/CD パイプラインをトリガーする

<h2 id="example-usage">
  使用例
</h2>

次の例では、`custom-metric` という名前のメトリクスが 10 を超えるたびに Slack 通知を送信するオートメーションを作成します。`custom-metric` は、トレーニング中に `wandb.Run.log({"custom-metric": value })` でログされていることを前提としています。

```python theme={"system"}
import wandb
from wandb.automations import OnRunMetric, RunEvent, SendNotification

api = wandb.Api()

project = api.project("<my-project>", entity="<my-team>")

# チームの最初の Slack インテグレーションを使用する
slack_hook = next(api.slack_integrations(entity="<my-team>"))

# トリガーとなるイベントを作成する
event = OnRunMetric(
     scope=project,
     filter=RunEvent.metric("custom-metric") > 10,
)

# イベント発生時に実行する action を作成する
action = SendNotification.from_integration(slack_hook)

# オートメーションを作成する
automation = api.create_automation(
     event >> action,
     name="my-automation",
     description="Send a Slack message whenever 'custom-metric' exceeds 10.",
)
```

オートメーション API の使用方法の詳細については、[オートメーションガイド](/ja/products/wandb/automations)を参照してください。


## Related topics

- [オートメーションの概要](/ja/products/wandb/automations.md)
