Why the Workflow Metadata Type Is Still Critical After Workflow Rule Retirement

A common misconception among developers is that because Salesforce retired Workflow Rules (WorkflowRule), the Workflow metadata type (workflows/<ObjectName>.workflow-meta.xml) is obsolete. In reality, Workflow is the metadata container for four reusable action primitives that modern Salesforce features still depend on every day:

  1. WorkflowAlert (Email Alerts): Directly invoked by Record-Triggered Flows (emailAlert action), ApprovalProcess, and EntitlementProcess milestone actions.
  2. WorkflowFieldUpdate (Field Updates): Required for initial submission, approval, rejection, and recall actions inside every ApprovalProcess and EntitlementProcess.
  3. WorkflowOutboundMessage (Outbound Messages): Declarative SOAP XML webhook notifications with automatic 24-hour retry queues, invocable directly from Record-Triggered Flows.
  4. WorkflowTask (Task Actions): Assigned tasks triggered by Approval Processes and Entitlement Milestones.
Workflow Metadata(workflows/Opportunity.workflow-meta.xml) WorkflowAlert(<alerts>) WorkflowFieldUpdate(<fieldUpdates>) WorkflowOutboundMessage(<outboundMessages>) WorkflowTask(<tasks>) Used by: Flow, ApprovalProcess, EntitlementProcess Used by: ApprovalProcess & EntitlementProcess Used by: Record-Triggered Flow & ApprovalProcess

Granular Child Metadata Types Supported in package.xml

Even though SFDX stores all actions for an object inside a single workflows/<Object>.workflow-meta.xml file, you can retrieve and deploy individual actions using their granular metadata type names:

Child Metadata Type XML Element in .workflow-meta.xml package.xml Member Syntax
WorkflowAlert <alerts> <ObjectName>.<AlertDeveloperName>
WorkflowFieldUpdate <fieldUpdates> <ObjectName>.<FieldUpdateDeveloperName>
WorkflowOutboundMessage <outboundMessages> <ObjectName>.<OutboundMessageDeveloperName>
WorkflowTask <tasks> <ObjectName>.<TaskDeveloperName>
WorkflowRule <rules> <ObjectName>.<RuleName> (Legacy maintenance only)

Real-World XML Example (workflows/Quote.workflow-meta.xml)

XML
<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
    <alerts>
        <fullName>Quote_Approved_Customer_Notification</fullName>
        <ccEmails>deal-desk@acme.example.com</ccEmails>
        <description>Notifies the primary contact and deal desk when a Quote is approved.</description>
        <protected>false</protected>
        <recipients>
            <field>ContactId</field>
            <type>contactLookup</type>
        </recipients>
        < recipients>
            <type>owner</type>
        </recipients>
        <senderAddress>quotes@acme.example.com</senderAddress>
        <senderType>OrgWideEmailAddress</senderType>
        <template>Sales_Templates/Quote_Approval_Confirmation</template>
    </alerts>
    <fieldUpdates>
        <fullName>Set_Status_To_Approved</fullName>
        <field>Status</field>
        <literalValue>Approved</literalValue>
        <name>Set Status To Approved</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
        <reevaluateOnChange>false</reevaluateOnChange>
    </fieldUpdates>
    <outboundMessages>
        <fullName>Sync_Approved_Quote_To_ERP</fullName>
        <apiVersion>68.0</apiVersion>
        <endpointUrl>https://erp-gateway.acme.example.com/soap/quote-sync</endpointUrl>
        <fields>Id</fields>
        <fields>QuoteNumber</fields>
        <fields>GrandTotal</fields>
        <includeSessionId>false</includeSessionId>
        <integrationUser>integration.bot@acme.example.com</integrationUser>
        <name>Sync Approved Quote To ERP</name>
        <protected>false</protected>
        <useDeadLetterQueue>false</useDeadLetterQueue>
    </outboundMessages>
</Workflow>

Querying WorkflowAlert, WorkflowFieldUpdate, and WorkflowOutboundMessage via Tooling API

You can audit email alerts, outbound webhook endpoints, and field updates across your org using the Tooling API.

1. Audit All Email Alerts and Their Sender Addresses (Tooling API)

SQL
SELECT Id, DeveloperName, EntityDefinition.QualifiedApiName,
       SenderType, Description, CcEmails, LastModifiedDate
FROM WorkflowAlert
WHERE NamespacePrefix = null
ORDER BY EntityDefinition.QualifiedApiName, DeveloperName

2. Audit All Outbound Message Endpoints and Integration Users (Tooling API)

SQL
SELECT Id, Name, EntityDefinition.QualifiedApiName, EndpointUrl,
       ApiVersion, IntegrationUserId
FROM WorkflowOutboundMessage
WHERE NamespacePrefix = null

Senior Architect Gotchas

Warning

Environment-Specific <integrationUser> and <senderAddress>: Notice that <WorkflowOutboundMessage> hardcodes <integrationUser> by username, and <WorkflowAlert> hardcodes <senderAddress> when <senderType>OrgWideEmailAddress</senderType> is used. Both will fail CI/CD deployment to Sandboxes or Scratch Orgs unless you configure replacements in sfdx-project.json!

Frequently asked questions

If Salesforce retired creating new Workflow Rules, why is the Workflow metadata type still actively used?

While creating new WorkflowRule definitions is retired in favor of Flow, the four child action types inside Workflow metadata (WorkflowAlert, WorkflowFieldUpdate, WorkflowOutboundMessage, and WorkflowTask) are still required by ApprovalProcess, EntitlementProcess, and Flow Email Alerts.

How do you deploy a single Email Alert without deploying the entire object Workflow file?

In package.xml, you can use the granular child metadata type name WorkflowAlert (along with WorkflowFieldUpdate, WorkflowOutboundMessage, or WorkflowTask) using the format ObjectName.DeveloperName, such as Case.High_Priority_SLA_Alert.

What happens if an OrgWideEmailAddress used as senderAddress in a WorkflowAlert is not verified in the target org?

Deploying a WorkflowAlert with senderType set to OrgWideEmailAddress will fail if that exact Org-Wide Email Address does not exist and is not verified in the target Sandbox or Production org.

Can you query Workflow Alerts, Field Updates, and Outbound Messages using the Tooling API?

Yes. Using the Tooling API, you can query WorkflowAlert, WorkflowFieldUpdate, WorkflowOutboundMessage, WorkflowTask, and WorkflowRule to inspect configurations, templates, and endpoint URLs.

Comments

Questions, corrections and tips are welcome. Comments are GitHub Discussions, so you sign in with GitHub.