2

I want to retrieve all my WorkflowAlert, WorkflowFieldUpdate, WorkflowRule from my sandbox and deploy them to another one. Here is my package.xml file :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexComponent</name>
    </types>
        ...
    <types>
        <members>*</members>
        <name>EmailTemplate</name>
    </types>
    <types>
        <members>*</members>
        <name>WorkflowAlert</name>
    </types>
    <types>
        <members>*</members>
        <name>WorkflowFieldUpdate</name>
    </types>
    <types>
        <members>*</members>
        <name>WorkflowRule</name>
    </types>
    <version>48.0</version>
</Package>

I then used this command line to retrieve those metadata :

sfdx force:source:retrieve --manifest /path/to/package.xml

But it return everything except WorkflowAlert, WorkflowFieldUpdate, WorkflowRule.

Please how to retrieve WorkflowAlert, WorkflowFieldUpdate, WorkflowRule ?

2 Answers 2

4

Those elements are still "bundled" in this release (7.50) of DX (and all prior versions). To extract them, use the Workflow object:

<types>
    <members>*</members>
    <name>Workflow</name>
</types>

You'll have files in the folder workflows, named after the object for which the metadata pertains to (e.g. Account.workflow-meta.xml or Custom_Object__c.workflow-meta.xml) which will contain XML like the following:

<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
    <alerts>
      ...
    </alerts>
    <fieldUpdates>
      ...
    </fieldUpdates>
    <flowActions>
      ...
    </flowActions>
    <outboundMessages>
      ...
    </outboundMessages>
    <rules>
      ...
    </rules>
    <tasks>
      ...
    </tasks>
</Workflow>

NOTE: Not all elements are represented here, and not all workflow files will contain all of these elements.

0

sfdx force:source:retrieve -m "WorkflowFieldUpdate:ObjectName.FieldupdateName"

example: sfdx force:source:retrieve -m "WorkflowFieldUpdate:SBQQ__Quote__c.Update_Approval_Status_to_Approved"

for alert replace "WorkflowAlert"

2
  • 2
    Welcome to Salesforce Stack Exchange (SFSE). Firstly, if your answer is something that has been updated or changed in a more recent release of Salesforce DX (or other release), please include that information. Secondly, the OP indicated that they were using a package.xml, so if that now works, please modify your answer. Thirdly, please use the backtick character "`" to surround code or commands in your answer. That will put them in the different font with the gray background for better readability. (You can click the "Help" beside the Comment text box to get more info.)
    – Moonpie
    Commented Aug 25, 2021 at 20:12
  • Can't say this works for us :(
    – Doug
    Commented Feb 6, 2022 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .