AutoResponseRule defines a named rule for sending automatic email responses to Lead or Case submissions based on attributes of the submitted record. It combines an activation setting with rule entries that define matching conditions, the response template, and sender details.
This type represents one rule within the object-scoped AutoResponseRules container. The singular and plural type names select different deployment and retrieval scopes: AutoResponseRule identifies an individual named rule, while AutoResponseRules identifies an object's collection of rules.
Key Elements
Except for fullName, active, and ruleEntry, the elements below belong within a ruleEntry definition.
| Element | What the Element Controls |
|---|---|
fullName |
The individual rule's name within the container. Required and cannot be null when creating, updating, or deleting the rule. |
active |
Whether the rule is active: true or false. Having entries does not by itself activate the rule. |
ruleEntry |
The array of entry definitions containing matching conditions and email-response settings. |
criteriaItems |
Field-based matching conditions. Use either this element or formula for an entry, not both. |
field |
Within criteriaItems, identifies the field to evaluate. It can reference a custom field. |
operation |
Within criteriaItems, selects the comparison. Exposed values are contains, equals, excludes, greaterOrEqual, greaterThan, includes, lessOrEqual, lessThan, notContain, notEqual, startsWith, and within. |
value |
Within criteriaItems, supplies the value used by the comparison. |
booleanFilter |
Advanced Boolean logic for combining criteria-based conditions. |
formula |
A formula used to evaluate response eligibility instead of criteriaItems. It can contain embedded custom-field references. |
template |
The EmailTemplate used for the automatic response. Lightning email templates are not packageable; Classic email templates are recommended. |
senderEmail |
The email address of the person or queue presented as the sender. |
senderName |
The name of the person or queue presented as the sender. |
replyToEmail |
The address placed in the email's Reply-To header, which directs replies separately from the sender settings. |
notifyCcRecipients |
For incoming Email-to-Case messages, determines whether the incoming message's CC recipients are copied on the automatic response: true or false. |
Behavior and Constraints
Activation is separate from entry configuration. A rule can contain matching conditions and response settings while active is false. The presence of populated ruleEntry definitions does not establish that the rule is active.
Choose one condition format per entry. Use either formula or criteriaItems, not both. For criteria-based entries, booleanFilter supplies advanced logic for combining the conditions. The formula evaluates eligibility for an automatic response; it is not a separate ValidationRule component.
Sender identity and reply routing are independent. Changing senderEmail or senderName does not necessarily change where replies go. That address is controlled separately by replyToEmail.
Copying CC recipients changes the response audience. For Email-to-Case, enabling notifyCcRecipients includes the incoming message's CC recipients on the automatic response. It is not merely a display setting.
The shared RuleEntry structure also exposes assignment- and escalation-oriented elements, including assignedTo, businessHours, and escalationAction, along with case-team elements. Their presence does not establish that an AutoResponseRule changes record ownership, applies escalation timing, or manages case teams.
Deployment and Retrieval
In package.xml, use the type and member combination that matches the scope you want:
| Metadata Type | Manifest Member | Selected Scope |
|---|---|---|
AutoResponseRule |
Case.samplerule |
One named rule on Case, using the pattern ObjectName.RuleName. |
AutoResponseRules |
Case |
All auto-response rules for Case. |
AutoResponseRules |
* |
All auto-response rules for all applicable objects. |
These identities are not interchangeable. For example, Case.samplerule is an individual-rule manifest member, while Case under AutoResponseRules selects the object container.
In file-based Metadata API format, object containers use the .autoResponseRules suffix and reside in the autoResponseRules folder. All Case auto-response rules are represented in autoResponseRules/Case.autoResponseRules. Within that container, each autoResponseRule has its own fullName.
The individual rule's fullName must be supplied and cannot be null for create, update, or delete operations. Do not confuse that name inside the container with the object-qualified manifest member used to select the rule.
Changing sender addresses or response settings across many entries means editing these metadata definitions and deploying the changes. It is not an update to the submitted Lead or Case records.
The selected email template is also a deployment consideration: template references an EmailTemplate, but Lightning email templates are not packageable. Classic email templates are recommended for this use.
Relationships
The response-specific dependencies are the fields used to determine eligibility and the email template used to generate the response. Changes to referenced fields can affect which submissions match; changes to the referenced template can affect response content. The shared entry schema also exposes assignment and escalation references, but those links do not establish those behaviors for an auto-response rule.
References
-
CustomField:fieldwithincriteriaItems, and embedded field references informula. -
EmailTemplate:templatefor the automatic response. The shared escalation structure also exposesassignedToTemplateandnotifyToTemplate; those links do not establish escalation behavior for this type. -
Group:assignedToin the shared entry structure. This schema connection does not establish ownership assignment by an auto-response rule.
Referenced By
-
AutoResponseRules:autoResponseRule, the collection of named rules within the object container.
Documentation Inconsistencies
The shared RuleEntry descriptions call criteriaItems "assignment criteria" and formula a "validation formula." In an AutoResponseRule, these elements define response-matching conditions. Those generic descriptions do not make the rule an assignment rule or a ValidationRule.
Reported Issues
-
A metadata-based approach was proposed for bulk sender changes. In a 2017 discussion, an admin needed to change the "Sent From" email address across more than 400 Case auto-response entries. The answer recommended retrieving and editing the metadata, using
AutoResponseRulesfor all rules or an object container, orAutoResponseRulefor one object-qualified rule. See the bulk sender-update discussion. -
Direct querying from Apex was reported as unavailable. A 2021 answer listed
AutoResponseRuleamong Tooling API types that were not available in the ApexSchemanamespace and could not be queried there. This report concerns Apex queries, not Metadata API retrieval. See the Apex query availability discussion.
Common Questions
Should I use AutoResponseRule or AutoResponseRules in package.xml?
Use AutoResponseRule with an object-qualified member such as Case.samplerule for one rule. Use AutoResponseRules with Case for all Case rules, or with * for all applicable objects.
Why does an auto-response rule have entries but remain inactive?
Entry configuration and activation are separate. The active element controls whether the rule is active; populated ruleEntry definitions alone do not activate it.
Can an auto-response entry contain both formula and criteriaItems?
No. Each entry must use either formula or criteriaItems, not both. Use booleanFilter for advanced logic with criteria-based conditions.
Can I package a Lightning email template with an auto-response rule?
Lightning email templates are not packageable. The rule's template element references an EmailTemplate, and Classic email templates are recommended for this use.
How do I change the sender email across many auto-response entries?
Edit senderEmail in the affected ruleEntry metadata definitions and deploy the changes. These are metadata updates, not Lead or Case record updates. Review replyToEmail separately because changing the sender does not necessarily change the reply destination.