Automate your W&B workflows.
This is the multi-page printable view of this section. Click here to print.
Automations
- 1: Automation
- 2: DoNothing
- 3: MetricChangeFilter
- 4: MetricThresholdFilter
- 5: NewAutomation
- 6: OnAddArtifactAlias
- 7: OnCreateArtifact
- 8: OnLinkArtifact
- 9: OnRunMetric
- 10: SendNotification
- 11: SendWebhook
1 - Automation
A local instance of a saved W&B automation.
Attributes:
- action (Union): The action that will execute when this automation is triggered.
- description (Optional): An optional description of this automation.
- enabled (bool): Whether this automation is enabled. Only enabled automations will trigger.
- event (SavedEvent): The event that will trigger this automation.
- name (str): The name of this automation.
- scope (Union): The scope in which the triggering event must occur.
2 - DoNothing
Defines an automation action that intentionally does nothing.
Attributes:
- action_type (Literal): The kind of action to be triggered.
- no_op (bool): Placeholder field which exists only to satisfy backend schema requirements. There should never be a need to set this field explicitly, as its value is ignored.
3 - MetricChangeFilter
Defines a filter that compares a change in a run metric against a user-defined threshold.
The change is calculated over “tumbling” windows, i.e. the difference between the current window and the non-overlapping prior window.
Attributes:
- agg (Optional): Aggregate operation, if any, to apply over the window size.
- change_dir (ChangeDir): No description provided.
- change_type (ChangeType): No description provided.
- name (str): Name of the observed metric.
- prior_window (int): Size of the prior window over which the metric is aggregated (ignored if
agg is None
). If omitted, defaults to the size of the current window. - threshold (Union): Threshold value to compare against.
- window (int): Size of the window over which the metric is aggregated (ignored if
agg is None
).
4 - MetricThresholdFilter
Defines a filter that compares a run metric against a user-defined threshold value.
Attributes:
- agg (Optional): Aggregate operation, if any, to apply over the window size.
- cmp (Literal): Comparison operator used to compare the metric value (left) vs. the threshold value (right).
- name (str): Name of the observed metric.
- threshold (Union): Threshold value to compare against.
- window (int): Size of the window over which the metric is aggregated (ignored if
agg is None
).
5 - NewAutomation
A new automation to be created.
Attributes:
- action (Optional): The action that will execute when this automation is triggered.
- description (Optional): An optional description of this automation.
- enabled (Optional): Whether this automation is enabled. Only enabled automations will trigger.
- event (Optional): The event that will trigger this automation.
- name (Optional): The name of this automation.
6 - OnAddArtifactAlias
A new alias is assigned to an artifact.
Attributes:
- event_type (Literal): No description provided.
- filter (Union): Additional condition(s), if any, that must be met for this event to trigger an automation.
- scope (Union): The scope of the event.
method then
then(self, action: 'InputAction') -> 'NewAutomation'
Define a new Automation in which this event triggers the given action.
7 - OnCreateArtifact
A new artifact is created.
Attributes:
- event_type (Literal): No description provided.
- filter (Union): Additional condition(s), if any, that must be met for this event to trigger an automation.
- scope (Union): The scope of the event: only artifact collections are valid scopes for this event.
method then
then(self, action: 'InputAction') -> 'NewAutomation'
Define a new Automation in which this event triggers the given action.
8 - OnLinkArtifact
A new artifact is linked to a collection.
Attributes:
- event_type (Literal): No description provided.
- filter (Union): Additional condition(s), if any, that must be met for this event to trigger an automation.
- scope (Union): The scope of the event.
method then
then(self, action: 'InputAction') -> 'NewAutomation'
Define a new Automation in which this event triggers the given action.
9 - OnRunMetric
A run metric satisfies a user-defined condition.
Attributes:
- event_type (Literal): No description provided.
- filter (RunMetricFilter): Run and/or metric condition(s) that must be satisfied for this event to trigger an automation.
- scope (ProjectScope): The scope of the event: only projects are valid scopes for this event.
method then
then(self, action: 'InputAction') -> 'NewAutomation'
Define a new Automation in which this event triggers the given action.
10 - SendNotification
Defines an automation action that sends a (Slack) notification.
Attributes:
- action_type (Literal): The kind of action to be triggered.
- message (str): The message body of the sent notification.
- severity (AlertSeverity): The severity (
INFO
,WARN
,ERROR
) of the sent notification. - title (str): The title of the sent notification.
method from_integration
from_integration(cls, integration: 'SlackIntegration', *, title: 'str' = '', text: 'str' = '', level: 'AlertSeverity' = <AlertSeverity.INFO: 'INFO'>) -> 'Self'
Define a notification action that sends to the given (Slack) integration.
11 - SendWebhook
Defines an automation action that sends a webhook request.
Attributes:
- action_type (Literal): The kind of action to be triggered.
- request_payload (Optional): The payload, possibly with template variables, to send in the webhook request.
method from_integration
from_integration(cls, integration: 'WebhookIntegration', *, payload: 'Optional[SerializedToJson[dict[str, Any]]]' = None) -> 'Self'
Define a webhook action that sends to the given (webhook) integration.