> 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/rule-based-configuration/rule-actions.md).

# Rule Actions

Explore the variety of actions available for different types of rules.

Actions transform rule evaluation from passive observation into active response. They're the "then do this" part of your automation—what actually happens when conditions match.

## Understanding Actions

Every rule must configure at least one action, otherwise there's no point in evaluating criteria. Actions might send notifications to communication platforms, create tickets in bug tracking systems, archive data for compliance, or trigger custom integrations. The available actions depend on your rule's purpose and what external systems you've integrated.

Multiple actions can be configured on a single rule, executing together when the rule fires. This lets you simultaneously alert a team, page on-call engineers, and create a tracking ticket—a common pattern for critical conditions that need attention through multiple channels.

Action execution is generally immediate and parallel. When a rule fires, all configured actions attempt to execute essentially simultaneously. Some contexts ensure logical ordering where necessary—archiving data before deleting it, for instance—but most actions run independently without strict sequencing.

## Types of Actions

Actions fall into several categories based on their purpose and effect.

### Communication Actions

The most common actions send notifications to where your team works. These integrate with platforms like Microsoft Teams, Slack, email, and PagerDuty, delivering contextual alerts that include relevant error information and links back to Pharos for investigation.

Communication actions use message templates with merge fields—placeholders that get replaced with actual data when the action executes. A subject line might read "New Critical Error: {!Summary}" where {!Summary} gets replaced with the actual error summary. This dynamic content ensures notifications carry specific, actionable information rather than generic alerts.

Different platforms have different characteristics worth considering. Teams handles long messages gracefully with auto-expansion, making it suitable for detailed notifications. Slack is more compact and benefits from concise messages. Email serves as a reliable fallback and works well for digest-style summaries. PagerDuty creates incidents that route through your on-call schedules, appropriate for conditions requiring immediate human response.

### Integration Actions

Some actions create records in external systems. Ticketing integration actions automatically generate bug reports, tasks, or issues in systems like Jira, Azure DevOps, or GitHub. This bridges the gap between error detection and work tracking without manual ticket creation.

Ticketing actions require field mapping configuration—connecting Pharos data to the external system's fields. You specify which Pharos fields populate the ticket's title, description, priority, labels, and custom fields. This mapping lets you automate ticket creation with appropriate context already filled in.

### Data Management Actions

Other actions manage data lifecycle rather than communicating about it. Archival actions preserve log data in long-term storage before removing it from active use. Removal actions delete data to free up storage capacity. External export actions send data to systems outside Salesforce for compliance or analysis purposes.

Data management actions often work together. A common pattern archives logs to cheaper storage (like Salesforce Big Objects) before removing them from standard storage. The system ensures safe ordering—data gets preserved before deletion regardless of how you configure the actions.

{% hint style="info" %}
**Context-Specific Actions**

The actions available when configuring a rule depend on that rule's context and purpose. Communication-oriented rules offer notification actions, data management rules offer archival and deletion actions, and so on. The interface shows only relevant actions for your rule type.
{% endhint %}

## Configuring Actions

Action configuration varies by type but follows consistent patterns. The interface guides you through required fields and available options specific to each action type.

### Notification Configuration

Notification actions require a destination and a message template. The destination might be a Teams channel, a Slack workspace and channel combination, email addresses, or a PagerDuty service. You select from integrations you've already configured—the action setup doesn't handle integration authentication, just uses existing connections.

The message template consists of a subject and body, both supporting merge fields. These merge fields are placeholders that get replaced with actual data when the action executes. The available merge fields depend on what object triggered the rule—logs have log fields, issues have issue fields, and so on.

Effective notification templates balance completeness with conciseness. Always include a link back to the Pharos record so recipients can investigate further. Include enough context for initial assessment—category, type, perhaps user count—without overwhelming the message with every available field. The "Details" merge field can be especially voluminous; use it cautiously and consider that some platforms handle long messages better than others.

### Integration Configuration

Ticketing integration actions involve more setup because they bridge between Pharos data and external system schemas. You select which integration and project to use, then map fields between the systems.

Field mapping connects Pharos data to ticket fields in the external system. The ticket title typically pulls from the issue summary, while the description might combine multiple Pharos fields plus a link back for reference. Priority mapping might translate Pharos priority levels to the external system's priority scheme. Labels and tags can be static values (like "pharos-auto" to identify auto-created tickets) or dynamic from Pharos fields.

Good field mapping provides context that makes the ticket actionable. Someone looking at the ticket should understand the problem without needing to immediately click through to Pharos, though the link should be there for deeper investigation.

### Data Management Configuration

Data management actions like archival and removal require minimal configuration beyond selection. The rule's criteria and timing determine what data gets affected—the action configuration just specifies what to do with matching data. Select archive to preserve it, remove to delete it, or both to archive then delete.

When combining multiple data management actions, the system ensures logical execution order automatically. Archive operations complete before removal operations regardless of the order you add them, preventing accidental data loss.

## Action Execution

Actions execute when their rule's conditions match, with timing and frequency depending on the rule's context. Some rules respond to record creation, firing actions within seconds of a log or issue being created. Others evaluate on schedules, executing actions in batches at regular intervals. Still others continuously monitor for threshold breaches, firing actions the moment a threshold is crossed.

When a rule configures multiple actions, they generally execute in parallel. All actions attempt to complete simultaneously rather than waiting for each other. The exception is when logical dependencies exist—data preservation must complete before data deletion, for instance. The system handles these dependencies automatically, ensuring safe execution order regardless of how you configure the actions.

Across multiple rules, execution patterns vary. Sequential evaluation systems fire only the first matching rule, preventing duplicate actions. Parallel evaluation systems fire all matching rules independently. Understanding your rule type's evaluation pattern helps you design action strategies that avoid unintended duplication or gaps.

## Testing and Validation

Before deploying rules to production, testing in a sandbox environment helps verify action behavior. Create the rule, trigger it with test data or error generation tools, and confirm that actions execute as expected—notifications arrive with correct formatting, tickets appear in the external system with proper field mappings, and so on.

Start with a single action and verify it works before adding complexity. Once one action executes reliably, add additional actions incrementally. This approach isolates problems quickly if something doesn't work as expected.

Action execution leaves traces you can examine. Notification delivery can be verified by checking the target channel or inbox. Ticket creation can be confirmed in the external system. Some rule types create audit records showing which actions executed, when, and whether they succeeded. These traces help you validate that automation is working as designed.

### Troubleshooting Action Issues

When actions don't execute, check that the rule is active and that its filter criteria actually match the records in question. Verify that required integrations are configured and authenticated. For sequential evaluation rules, confirm that another rule isn't matching first and preventing your rule from firing.

When notifications don't arrive despite actions executing, verify the destination still exists and the integration user has access. Check for platform rate limiting if you're sending high volumes. For ticketing, confirm that required fields in the external system are being populated and that the integration has necessary permissions.

Failed field mappings often result from missing required fields in the external system or merge fields that don't have values for specific records. The external system's error logs usually provide specific feedback about why ticket creation failed.

## Action Design Principles

Effective action configuration balances completeness with restraint. The goal is appropriate response, not maximum response.

### Notification Design

Keep notification messages focused on essential information that enables quick assessment. A link back to Pharos should always be included—it lets recipients investigate fully while keeping the notification itself concise. Key identifying information like category and type help team members quickly understand what they're looking at without overwhelming them with every available detail.

Consider platform capabilities when designing messages. Teams handles long content gracefully with auto-expansion, making it suitable for more detailed notifications. Slack benefits from tighter messages that don't require scrolling. Email works well for structured summaries that recipients can skim quickly.

If your integration user might also send personal messages in the same channels, consider prefixing automated notifications with a tag like "\[Automated]" to distinguish system messages from human communication.

### Data Management Safety

Data deletion should never be hasty. When configuring retention actions that remove data, always pair them with archival actions first. The system ensures safe ordering—archive completes before removal—but you need to configure both actions for the safety to exist.

Start with conservative retention periods and shorten them based on actual needs. Beginning with a two-year retention period lets you assess whether that data has historical value. If nobody ever queries logs older than six months, you can gradually reduce the retention period. The opposite approach—starting aggressive and discovering you deleted needed data—creates problems that can't be undone.

Test retention rules on small data subsets first. A rule targeting logs older than three years with a specific test category lets you verify behavior before expanding to your full log population.

### Integration Strategy

Ticketing integration should provide enough context to make the ticket actionable. The description should include the error summary, impact metrics like user count, the category or functional area, and most importantly, a link back to Pharos for full investigation. Someone reading the ticket should understand what happened without immediately needing to click through, though deeper investigation should be a click away.

Labels and tags help organize auto-generated tickets. A consistent tag like "pharos-auto" identifies tickets created by automation versus manually reported issues. Dynamic tags from category or functional area fields enable filtering and routing in the external system.

Consider limiting ticketing to high-priority conditions to avoid overwhelming your bug tracking system. Not every error needs a ticket—sometimes a notification suffices. Reserve automatic ticket creation for issues that definitely need tracked work.

## Scale and Resource Considerations

Actions operate within practical constraints worth understanding. External systems have rate limits on how many API calls they'll accept in a given time period. High-volume rules that fire frequently may approach or exceed these limits, causing delayed or failed actions. PagerDuty limits incident creation, Jira and Azure DevOps limit API requests, and messaging platforms limit message posting frequency.

Actions also consume Salesforce platform resources. API callouts count against your org's governor limits. External system latency can add processing time. Configuring many actions across many rules creates more work for the platform. Most typical configurations stay comfortably within bounds, but extreme scenarios deserve monitoring.

Some actions carry direct costs. PagerDuty charges per incident, and high volumes of automated incidents can become expensive. External system API usage may have cost implications depending on your service tier. These aren't reasons to avoid useful automation, but they're factors to consider when deciding what deserves automatic response.

## Common Action Patterns

Effective action strategies often follow recognizable patterns that balance responsiveness with resource efficiency.

**Tiered notification routing** sends critical conditions to interrupt-driven channels like PagerDuty, high-priority issues to dedicated team channels, and lower-priority issues to digest emails or general monitoring channels. Each tier serves appropriate urgency without over-alerting or under-responding.

**Notification plus ticketing** pairs immediate awareness with work tracking. The notification ensures rapid response, while the ticket provides long-term tracking and context for resolution work. This pattern works well for production issues that need both immediate attention and systematic resolution.

**Archive and remove** patterns preserve data before deletion, balancing storage costs with compliance or reference needs. Logs move from expensive standard storage to cheaper archival storage, then get removed from the archive after extended periods. This multi-stage approach maximizes retention while controlling costs.

**Multi-stakeholder notification** routes issues to multiple teams when problems span boundaries. Integration failures might notify both the integration team and the DevOps team responsible for overall system health. This ensures all relevant parties have awareness without requiring manual communication.

{% hint style="success" %}
**Multiple Actions with Purpose**

When configuring multiple actions on a single rule, each action should serve a distinct purpose. Immediate notification, on-call paging, ticket creation, and manager awareness are all potentially valuable distinct responses. Two notifications to different Teams channels visible to the same people just creates duplicate noise.
{% endhint %}

***

**Return to** [**Rule Structure**](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/rule-based-configuration/rule-structure.md) to understand overall rule organization, or review [**Trigger Conditions**](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/rule-based-configuration/trigger-conditions.md) for how rules decide when to fire their actions.
