> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/alerting/issue-level-alerts/create-based-triggering.md).

# Create-based Triggering

Understand creation-based rules, when they're useful, and available filter operations.

Create-based notification rules fire when a **new issue is created**. This is the most common and recommended rule type for production monitoring.

Under the hood, these are `Rule__c` records with `Type__c = "Notification"` and the `Is_Update__c` checkbox unchecked—"create-based" describes that triggering mode, not a separate Rule Type value.

## When Create Rules Fire

A create-based rule evaluates when Pharos creates a new issue record. This happens when:

1. A log is ingested that doesn't match any existing issue fingerprints
2. Pharos creates a new issue to aggregate that log
3. The new issue is evaluated against all active create-based notification rules (top to bottom)
4. The first rule with matching filter criteria fires

**Frequency:**

* Fires **once per issue** when the issue is initially created
* Does NOT fire again when new logs are added to that existing issue
* If the same issue reoccurs after being closed/resolved, a new create notification fires

## Use Cases for Create Rules

Create rules cover most day-to-day monitoring needs, from broad catch-alls to targeted team routing.

### 1. General Production Monitoring

**Scenario:** You want to be notified whenever any new problem appears in production.

**Rule Configuration:**

```
Rule Type: Notification (Is_Update__c = false)
Filter: (no filter criteria - catch all)
Action: Post to Slack #prod-errors
```

### 2. Functional Area Routing

**Scenario:** Route notifications to specific teams based on what part of the system failed.

**Rule Configuration:**

```
Rule 1 (Create):
  Filter: Functional Area contains "License"
  Action: Post to Teams #licensing-team

Rule 2 (Create):
  Filter: Functional Area contains "Sales"
  Action: Post to Slack #sales-automation

Rule 3 (Create):
  Filter: (catch-all for anything not matched above)
  Action: Post to Slack #platform-team
```

{% hint style="warning" %}
**Order Matters**

Remember, rules evaluate top to bottom and stop at the first match. Put specific rules (like "License") before catch-all rules.
{% endhint %}

### 3. Category-Based Filtering

**Scenario:** Only notify about specific types of errors (flows, Apex, integrations).

**Rule Configuration:**

```
Rule 1 (Create):
  Filter: Category = "Flow"
  Action: Post to Slack #flow-errors

Rule 2 (Create):
  Filter: Category = "Apex"
  Action: Post to Slack #dev-team
```

### 4. Priority-Based Escalation

**Scenario:** Critical issues go to PagerDuty, everything else to Slack.

**Rule Configuration:**

```
Rule 1 (Create):
  Filter: Priority = "Highest"
  Action: Create PagerDuty incident

Rule 2 (Create):
  Filter: Priority = "High"
  Action: Post to Slack #high-priority

Rule 3 (Create):
  Filter: (catch-all)
  Action: Post to Slack #all-issues
```

## Available Filter Criteria

Create rules can filter on any field available on the issue object at the time of creation:

**Common Filter Fields:**

* **Category:** Type of error (Flow, Apex, Bulk API, etc.)
* **Functional Area:** Business area or process name
* **Priority:** Lowest, Low, Medium, High, Highest
* **Summary:** The issue title/description
* **Organization:** The org the issue came from — also how you scope a rule to a single environment
* **Regression:** Checkbox flagging an issue that has returned after being resolved

**Impact Fields (at creation):**

* **First Occurred Date**
* **Impacted Users:** Initial count
* **Impacted Objects:** Initial list
* **Impacted Records:** Initial count

{% hint style="info" %}
**Fields Available at Creation**

Note that some fields like Log Count, Frequency, and Daily Volume may have limited data at issue creation since they're calculated over time. Use update-based rules to filter on these metrics as they evolve.
{% endhint %}

## Filter Operators

Pharos rule filters support six comparison operators, usable across text, number, date, and picklist fields:

* Equal
* Not equal
* Greater than
* Greater or equal
* Less than
* Less or equal

## Best Practices

A few habits make create rules easier to manage as they multiply.

### Start with a Catch-All Rule

For teams new to Pharos, start simple:

```
Rule 1 (Create):
  Filter: (none - catch all)
  Action: Post to Slack #prod-errors
```

Run this for 1-2 weeks to understand your error patterns, then add more specific rules.

### Use Functional Area for Routing

Functional Area is automatically populated based on the automation name (flow name, class name, etc.) and is the most reliable way to route notifications to the right team:

```
Good: Functional Area contains "Order Processing"
Better than: Summary contains "Order"
```

### Combine Multiple Criteria

You can combine multiple filter conditions for precise targeting:

```
Rule (Create):
  Filter: Category = "Flow" 
     AND Functional Area contains "Integration"
     AND Organization = "Production"
  Action: Post to Slack #integration-team
```

### Test in Sandbox First

Before rolling out notification rules to production:

1. Set up the rule in a sandbox environment
2. Trigger test errors to verify the rule fires correctly
3. Verify the notification appears in the expected channel
4. Only then replicate the rule in production

## Example: Complete Notification Strategy

Here's a complete example for a team with multiple functional areas:

```
Rule 1 (Create):
  Name: Critical - All Areas
  Filter: Priority = "Highest"
  Action: PagerDuty + Slack #urgent

Rule 2 (Create):
  Name: Sales Automation Errors
  Filter: Functional Area contains "Sales" OR Functional Area contains "Opportunity"
  Action: Slack #sales-automation

Rule 3 (Create):
  Name: Service Cloud Errors
  Filter: Functional Area contains "Case" OR Functional Area contains "Service"
  Action: Slack #service-automation

Rule 4 (Create):
  Name: Integration Errors
  Filter: Functional Area = "Integration"
  Action: Slack #integrations + Teams #api-team

Rule 5 (Create):
  Name: Catch-All
  Filter: (none)
  Action: Slack #platform-team
```

## Deactivating Rules

Each rule can be activated or deactivated. Use deactivation for:

* **Temporary development notifications:** Activate during a deployment, deactivate after
* **Seasonal monitoring:** Activate during high-traffic periods
* **Testing:** Test a new rule configuration without affecting existing rules

## Next Steps

* Learn about [Update-based Triggering](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/alerting/issue-level-alerts/update-based-triggering.md) for advanced escalation scenarios
* Explore [Notification Channels](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/alerting/notification-channels.md) for integration setup (Slack, Teams, PagerDuty)
* Review [Alerting Use Cases](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/alerting/alerting-use-cases.md) for more real-world examples
