WorkflowAlert defines an object-scoped email alert: the email template, recipient selection, and sender identity. It belongs to the alerts collection of the object's Workflow container, not to a single WorkflowRule. The alert defines the email action; the automation that invokes it determines whether and when it runs.
For workflow-rule invocations, activation and conditions belong to WorkflowRule, and delayed execution is configured through WorkflowTimeTrigger. An alert can also be referenced by Flow, ApprovalProcess, and EntitlementProcess. An alert with no workflow-rule references is therefore not necessarily unused.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
Required developer name of the alert within Workflow.alerts. It must be unique, begin with a letter, contain only alphanumeric characters and underscores, and have no spaces, trailing underscore, or consecutive underscores. Selective retrieval uses an object-qualified member name, not this unqualified value alone. |
description |
Required description of the email alert. |
ccEmails |
Up to five additional literal email addresses. Successful sending requires a value in this element, recipients, or both. |
recipients |
Collection of WorkflowEmailRecipient entries. These select recipients through users, groups, roles, teams, record relationships, or fields, separately from the literal addresses in ccEmails. |
recipients.type |
Determines how each recipient entry resolves its audience and whether it uses field or recipient. Common values include user, partnerUser, group, role, roleSubordinates, owner, creator, accountOwner, accountTeam, opportunityTeam, contactLookup, userLookup, and email. |
recipients.field |
Field used to resolve a recipient. contactLookup requires a Contact lookup, userLookup requires a user foreign key field, and email requires an email field. |
recipients.recipient |
Named selection value for applicable recipient types. user and partnerUser use usernames, not record IDs; group uses a group name; role selections use role references. |
senderType |
Controls both From and Reply-To. Allowed values are CurrentUser, DefaultWorkflowUser, and OrgWideEmailAddress. The default is CurrentUser. |
senderAddress |
Organization-wide sender address. It can be specified only when senderType is OrgWideEmailAddress; it is not a general override for other sender types. |
template |
Required named reference to EmailTemplate. The template must exist in the destination, but it need not be included in the deployment archive if it already exists there. |
protected |
Required boolean controlling package extensibility. When true, components created in the installing organization cannot link to or reference the alert. It does not control recipient selection. |
Behavior and Constraints
Delivery and sender identity
An alert needs at least one value in ccEmails or recipients for successful sending. Both can be populated. The five-address limit applies to the additional literal addresses in ccEmails, not to the recipient collection.
-
CurrentUseruses the email address of the person updating the record. -
DefaultWorkflowUseruses the default workflow user's email address. Package installation changes this setting toCurrentUser. -
OrgWideEmailAddressuses a verified organization-wide email address and permitssenderAddressto be specified.
Because senderType governs both From and Reply-To, changing it affects both addresses.
Recipient selection is resolved from the record and organization
The alert definition does not establish a fixed list of actual recipients. Record field values, ownership, team membership, group membership, and role assignments determine the resolved audience.
-
contactLookup,userLookup, andemailread the value from the field named infield. They do not store a fixed destination email address in the alert. -
userandpartnerUseridentify users by username inrecipient. A user record ID is not a substitute. -
groupidentifies a group by group name.roleandroleSubordinatesuse role references and can select multiple users. -
accountTeamapplies only to Account.opportunityTeamapplies only to Opportunity. -
owner,creator, andaccountOwnerderive recipients from record relationships rather than a fixed named recipient. For example,accountOwnercan select the Account owner for an Opportunity.
Activation and timing belong to the caller
For a workflow-rule invocation, WorkflowRule.active controls activation, and the rule's criteria or formula control when it qualifies. Immediate actions reference the alert through WorkflowActionReference.name with type set to Alert. Delayed actions use the same reference structure inside workflowTimeTriggers. Those rule and timing settings are not elements of WorkflowAlert.
Deployment and Retrieval
Container storage and selective retrieval
In Metadata API file format, the object-level Workflow container is stored in the workflows directory with the .workflow suffix. There is one file per standard or custom object that has workflow. The file can contain alerts as well as other workflow components.
To retrieve the complete container for an object, use metadata type Workflow with the object's API name as the member. The Workflow type also supports * in a manifest to retrieve all workflow containers. This wildcard support belongs to the container; it does not establish wildcard behavior for every child type. See the Workflow metadata reference.
For selective retrieval, practitioners report using type WorkflowAlert with member ObjectName.AlertDeveloperName, such as Case.My_Alert. The qualified member identifies one alert, while the fullName inside Workflow.alerts remains the alert's developer name, such as My_Alert. See the object-qualified retrieval example.
Template and recipient dependencies
The common dependency chain is invoking automation, then WorkflowAlert, then EmailTemplate. A deployment of the invoking automation must be able to resolve the alert, and the alert's required template reference must resolve in the destination.
The template does not need to be in the deployment archive if it already exists in the destination. Lightning email templates are not packageable; Classic email templates are recommended for packaging. Recipient configuration can introduce additional field, group, role, and named-user requirements.
A missing alert has been reported as a cause of an action-resolution error when deploying a Flow or Process Builder process. Including only the consumer and its email template does not supply the missing alert.
Package behavior and removal impact
Installing an alert from a package changes senderType from DefaultWorkflowUser to CurrentUser when the alert uses that setting. Package installation can therefore change the sender identity.
Setting protected to true prevents components created in the installing organization from referencing the packaged alert. This is a component-reference restriction, not an email-delivery or recipient-access setting.
Before changing or removing an alert, inspect its actual references across workflow rules, flows, approval processes, and entitlement processes. A workflow-rule usage list alone does not establish that the alert is safe to remove.
Relationships
The alert is contained in an object's Workflow metadata and references its email template directly. Recipient references depend on each entry's type: the possible field, group, and role connections below are alternatives, not dependencies required by every alert. Named-user selections are username-based requirements, separate from these metadata-type references.
References
-
CustomField:fieldwithinrecipients. -
Group:field,recipientwithinrecipients, depending on recipient interpretation. -
Role:field,recipientwithinrecipients, depending on recipient interpretation. -
EmailTemplate:template.
Referenced By
-
ApprovalProcess:namein action references. -
EntitlementProcess:namein action references. -
Flow:actionName. -
Workflow:namein contained action references; also contains the alert definition inalerts. -
WorkflowRule:namein immediateactionsand actions nested underworkflowTimeTriggers, with actiontypeset toAlert.
Documentation Inconsistencies
-
Portal recipient enum names differ. Salesforce documentation lists
customerPortalOwnerfor a specific self-service portal user identified by username. An alternate exposed element schema listscustomerPortalUserinstead and also exposescaseTeam. Do not silently substitute one portal literal for the other, or infer supportedcaseTeambehavior from its name alone. -
ccEmailshas inconsistent cardinality representations. Metadata API documentation defines it asstring[], while an alternate exposed element schema represents it as a scalarstring. The documented five-address limit applies. Scalar exposure alone does not establish a delimiter or file-serialization format.
Reported Issues
- A missing email alert can block deployment of its consumer. Reports from 2020-2022 describe Flow and Process Builder deployments failing with "We can't find an action with the name and action type that you specified" when a referenced email alert was omitted. Including the alert resolved those cases, including a change-set deployment. The email template also had to be available in the destination. This is one reported cause of the error, not its only meaning. Deployment error discussion.
-
User-deactivation warnings can require searching recipient entries, not just additional email addresses. A 2014 report described email-alert references preventing user deactivation and suggested searching workflow metadata for the user reference. Filtering only
ccEmailswould miss a user selected by username inrecipients. Recipient lookup discussion. -
Sandbox deliverability did not selectively suppress additional recipients. In a 2021 report, System Only suppressed the workflow emails, while All Email sent them to the additional addresses too. The proposed approach was to remove
ccEmailsfrom sandbox alerts through metadata updates. That was a reported approach, not a universal requirement or the only supported method. Sandbox additional-address discussion. -
Finding workflow-rule usage through the Tooling API can require per-rule inspection. A 2020 answer described reading
WorkflowRule.Metadata, collecting its action references, and comparing them with the alert list. It reported that theMetadatafield could be queried for only one record at a time. That comparison identifies workflow-rule references, not usage by other automation. Workflow-rule usage analysis. -
Data Loader was not a route for bulk sender updates. In a 2019 discussion about changing the From address across email alerts, the answer directed the administrator to
WorkflowAlertmetadata rather than Data Loader because the alerts are configuration, not ordinary data records. Bulk email-alert update discussion.
Common Questions
How do I retrieve one WorkflowAlert?
Use metadata type WorkflowAlert and an object-qualified member such as Case.My_Alert. The value combines the object's API name and the alert's developer name. To retrieve the entire object's workflow container, use type Workflow with the object name.
Why does my Flow deployment say it cannot find the email alert action?
A missing referenced WorkflowAlert is one reported cause of that action-resolution error. Ensure the destination can resolve the alert and its required EmailTemplate. The template can already exist in the destination instead of being included in the deployment archive.
Why did the email alert sender change after package installation?
Package installation changes senderType from DefaultWorkflowUser to CurrentUser when the alert uses that setting. CurrentUser uses the email address of the person updating the record for both From and Reply-To.
Can I stop additional sandbox recipients without stopping all workflow emails?
The reported deliverability settings did not provide that selective behavior: System Only stopped the workflow emails, and All Email included the additional addresses. One reported approach removed ccEmails from sandbox alert metadata. The alert still needs a value in recipients or ccEmails for successful sending.
Is an email alert unused if no workflow rule references it?
No. Flow, ApprovalProcess, and EntitlementProcess can also reference the alert. Inspect those consumers as well as immediate and time-triggered workflow-rule actions before treating the alert as unused.