# pai-notification

Part of **PAI**

# Platform for AI (PAI) Monitoring & Observability Console Guide

## Operations Overview

| Operation | Console Entry Path | Prerequisites | Description |
|----------|-------------------|--------------|-------------|
| Configure Event Notifications | Console > PAI > Workspace > Workspace Details > Configuration > Event Notification Configuration | EventBridge activated for the account, service-linked role AliyunServiceRoleForPAIWorkspace created, webhook and signing key ready (if using DingTalk), webhook URL ready (if using WeCom or Lark), message receiving settings configured (if using voice call, text message, or email) | Set up event-driven notifications for PAI resources like DLC jobs, Flow tasks, DSW instances, and model versions |

## Step-by-Step Instructions

### Configure Event Notifications

**Navigation**: Console > PAI > Workspace > Workspace Details > Configuration > Event Notification Configuration

**Prerequisites**:
- EventBridge activated for your Alibaba Cloud account
- Service-linked role **AliyunServiceRoleForPAIWorkspace** must be created (or you have permission to create it)
- If using DingTalk: webhook URL and signing key prepared
- If using WeCom or Lark: webhook URL ready
- If using voice call, text message, or email: message receiving settings configured in advance

1. Navigate to the **Workspace Details** page  
   - Element: **Workspace Details** (link) — located in the top navigation panel  
   - Notes: Ensure you are in the correct PAI workspace

2. Click the **Configuration** tab  
   - Element: **Configuration** (tab) — in the top navigation panel  

3. Select the **Event Notification Configuration** tab  
   - Element: **Event Notification Configuration** (tab) — in the top navigation panel  

4. Enable EventBridge by clicking **Activate for Free**  
   - Element: **Activate for Free** (button) — on the Event Notification Configuration tab  
   - Notes: After activation, a custom event bus named `pai-system-${workspace_name}` is automatically created

5. Grant necessary permissions by clicking **Grant Access**  
   - Element: **Grant Access** (button) — on the Event Notification Configuration tab  
   - Notes: This creates the service-linked role **AliyunServiceRoleForPAIWorkspace**

6. Begin rule creation by clicking **Create Notice Rule**  
   - Element: **Create Notice Rule** (button) — on the Event Notification Configuration tab  

7. Select the event source and specific event types  
   - Element: **Event Source** (dropdown) — in the "Configure event types" section  
   - Notes: Choose from **Flow task**, **DLC job**, **Model**, or **DSW instance**. Multiple event types can be selected per source

8. Choose a delivery method for notifications  
   - Element: **Delivery Method** (dropdown) — in the "Configure event targets" section  
   - Notes: Options include **DingTalk notification**, **WeCom notification**, **Lark notification**, **HTTP/HTTPS**, or **Voice call, text message, and email**. Each contact added for voice/text/email consumes one quota unit

9. Enter required credentials (e.g., webhook URL and signing key)  
   - Element: **Webhook** (text_input) — in the "Configure event targets" section  
   - Element: **Signing Key** (text_input) — appears only when **DingTalk notification** is selected  
   - Notes: Save the signing key and webhook URL securely for future reference

10. Verify your setup by clicking **Test Connectivity**  
    - Element: **Test Connectivity** (button) — in the "Configure event targets" section  
    - Notes: This button is only available for **DingTalk**, **WeCom**, and **Lark** delivery methods. Wait for the success confirmation message

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Event Source | dropdown | Yes | Flow task, DLC job, Model, DSW instance | Select the type of PAI resource to monitor |
| Event Types | checkbox | No | Task Failed, Task Finished (covers both success and failure), Job progress (Queued, Bidding Started, Running, Failed), Automatic fault tolerance, Job timeout, Other events (preempted, manually stopped), Model version approved for deployment, Model version status changed, Instance status changes (Creating, Instance Failed), Image saving (Saving Image, Image Saved Successfully, Image Save Failed), Instance shutdown (Instance Stopped, Stopping) | Choose specific lifecycle events that trigger notifications |
| Delivery Method | dropdown | Yes | DingTalk notification, WeCom notification, Lark notification, HTTP/HTTPS, Voice call, text message, and email | Determines how the notification is delivered |
| Webhook | text_input | Yes | — | The endpoint URL for DingTalk, WeCom, Lark, or custom HTTP/HTTPS services |
| Signing Key | text_input | Yes | — | Authentication key required only for DingTalk integration |

## FAQ

Q: Where can I find the Event Notification Configuration page?
A: Go to Console > PAI > Workspace > select your workspace > Workspace Details > Configuration tab > Event Notification Configuration.

Q: What happens if I don’t create the service-linked role?
A: Without the **AliyunServiceRoleForPAIWorkspace** role, PAI cannot publish events to EventBridge, and notifications will not be triggered.

Q: Can I modify an existing notification rule after creation?
A: Yes, you can edit or delete rules from the Event Notification Configuration page at any time.

Q: Why is the Test Connectivity button disabled?
A: The button is only enabled for DingTalk, WeCom, and Lark delivery methods. It is not available for HTTP/HTTPS or voice/text/email targets.

Q: How many event targets can I add per rule?
A: By default, up to 5 event targets per rule. You can request a quota increase to support up to 100 targets.

## Pricing & Billing

### Billing Model
Billed per notification request after free tier usage.

### Price Reference
Free tier: 500 free event notifications/month. Additional events billed at $0.001 per notification.

### Free Tier
500 free event notifications per month per Alibaba Cloud account.

### Billing Notes
- Each contact added for voice call, text message, or email consumes one quota unit.
- Contacts are counted cumulatively and not deduplicated across rules or delivery methods.
- Quota limit: 5 event targets per rule (maximum 100 with quota increase request).