-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorkflowAlerts Can Only Be Retrieved, Not Deployed via the CLI #2563
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Yes, this behavior is broken and has been for a long time. The workaround is to deploy/retrieve the entire Workflow. I understand that the metadata API allows addressing Workflow children individually so we will be trying to solve this very soon. There is a discussion on this topic here: #2356 |
Internally tracked with W-11385847 |
@shetzel - is there any update on fixing deploying workflow children using the CLI? Last CLI version I checked a few weeks ago still had the issue even with the decomposed workflow preset. Not sure if this is impacted by the upcoming deprecation of workflow rules or if this is still planned for a fix?? When I tested it recently, when I had a decomposed WorkflowAlert in my package, the CLI was able to retrieve the decomposed file but it skipped over it when trying to deploy the same package. |
@mcarvin8 - decomposed Workflows are supposed to solve this. With the If you convert just What is the exact command you were using to deploy? I'll give it a try as well. |
@shetzel - the retrieve with the decomposed workflow preset worked fine. Deploying it failed as the Salesforce CLI skipped over the entry in the package.xml for WorkflowAlert. Just using the standard "sf project deploy start -x manifest/package.xml" in vs code (windows 11). Not in a CI/CD pipeline. Same flags for retrieving the same package. Retrieve works with decomposed preset but deploy "passes" but didn't actually deploy anything. I didn't try the convert command but I deploy with a manifest file so I need that command to run and actually deploy the components. With just WorkflowAlert in the package, component count was 0 and deploy was "successful". |
@shetzel After upgrading to today's latest CLI, I still see the same behavior. With "WorkflowAlert" in the package.xml, it deploys successfully but with 0 components. package.xml <?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account.AlertAccountIdentifiedAtRisk</members>
<name>WorkflowAlert</name>
</types>
</Package> Retrieving the same package.xml has similar behavior. Is there something wrong with this package.xml?? PS C:\Users\matthew.carvin\Documents\carvin> sf project retrieve start -x .\package.xml ────────────── Retrieving Metadata ────────────── Retrieving v59.0 metadata from [email protected] using the v62.0 SOAP API ✔ Preparing retrieve request 21ms Status: Succeeded » Warning: Nothing retrieved CLI version: {
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.69.14",
"nodeVersion": "node-v22.11.0",
"osVersion": "Windows_NT 10.0.22621",
"rootPath": "C:\\Users\\matthew.carvin\\AppData\\Local\\sf\\client\\2.69.14-c6442ee",
"shell": "powershell",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.11 (core)",
"@oclif/plugin-commands 4.1.12 (core)",
"@oclif/plugin-help 6.2.18 (core)",
"@oclif/plugin-not-found 3.2.29 (core)",
"@oclif/plugin-plugins 5.4.19 (core)",
"@oclif/plugin-search 1.2.16 (core)",
"@oclif/plugin-update 4.6.14 (core)",
"@oclif/plugin-version 2.2.16 (core)",
"@oclif/plugin-warn-if-update-available 3.1.24 (core)",
"@oclif/plugin-which 3.2.19 (core)",
"@salesforce/cli 2.69.14 (core)",
"apex 3.6.6 (core)",
"api 1.3.2 (core)",
"auth 3.6.78 (core)",
"data 3.12.3 (core)",
"deploy-retrieve 3.15.17 (core)",
"dev 2.4.2 (user) published 106 days ago (Mon Aug 26 2024) (latest is 2.5.1)",
"info 3.4.25 (core)",
"limits 3.3.42 (core)",
"marketplace 1.3.7 (core)",
"org 5.2.7 (core)",
"packaging 2.9.5 (core)",
"schema 3.3.43 (core)",
"settings 2.4.8 (core)",
"sobject 1.4.46 (core)",
"telemetry 3.6.26 (core)",
"templates 56.3.33 (core)",
"trust 3.7.45 (core)",
"user 3.6.4 (core)",
"apex-code-coverage-transformer 2.0.0 (user) published 51 days ago (Mon Oct 21 2024) (latest is 2.2.0)",
"apex-tests-git-delta 2.0.0 (user) published 51 days ago (Mon Oct 21 2024)",
"apextestlist 1.9.1 (user) published 30 days ago (Sun Nov 10 2024)",
"sf-package-combiner 1.2.3 (user) published 0 days ago (Tue Dec 10 2024)",
"sfdx-git-delta 5.49.0-dev-942.11663286254-1 (user) published 37 days ago (Mon Nov 04 2024) (latest is 5.50.0)"
]
} |
Looks like you're doing everything correct to me. I'm seeing the same behavior so it's doubtful that workflow children were addressable by the CLI (or VS Code extension) like this. The simple way to test this is to do a convert of the source to mdapi format using your manifest. E.g., So this is a bug. You'll have to deploy/retrieve the entire workflow as a workaround. As you pointed out, Workflows are deprecated and that affects the priority of the bug fix but we'll look into it. |
Thanks. Glad to see it's reproducible but I understand it's low priority since workflows are deprecated. |
This issue has been linked to a new work item: W-17422340 |
@mcarvin8 - if you're willing to try this, you could copy the decomposeWorkflowBeta preset into your sfdx-project.json, modify all the workflow children to be addressable (i.e., remove |
Thanks @shetzel . That seems to be a viable workaround. I was able to deploy/retrieve the I'm good with using this workaround for now |
Only thing I'm seeing that's still weird with the decomposed workflow beta preset is that it's missing workflowFlowActions. In its current state, Workflow Flow Actions are added to the I think I figured out how to manually add this to the preset JSON file, which was able to decompose them into a folder with their own files. When the Flow Action is present in the decomposed Here's my sfdx-project.json with the flow actions for ref: {
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": " ",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "59.0",
"sourceBehaviorOptions": ["decomposeCustomLabelsBeta2"],
"registryCustomizations": {
"childTypes": {
"workflowalert": "workflow",
"workflowfieldupdate": "workflow",
"workflowknowledgepublish": "workflow",
"workflowoutboundmessage": "workflow",
"workflowrule": "workflow",
"workflowsend": "workflow",
"workflowtask": "workflow",
"workflowflowaction": "workflow"
},
"strictDirectoryNames": {
"workflows": "workflow"
},
"suffixes": {
"workflow": "workflow"
},
"types": {
"workflow": {
"children": {
"directories": {
"workflowAlerts": "workflowalert",
"workflowFieldUpdates": "workflowfieldupdate",
"workflowKnowledgePublishes": "workflowknowledgepublish",
"workflowOutboundMessages": "workflowoutboundmessage",
"workflowRules": "workflowrule",
"workflowSends": "workflowsend",
"workflowTasks": "workflowtask",
"workflowFlowActions": "workflowflowaction"
},
"suffixes": {
"workflowAlert": "workflowalert",
"workflowFieldUpdate": "workflowfieldupdate",
"workflowKnowledgePublish": "workflowknowledgepublish",
"workflowOutboundMessage": "workflowoutboundmessage",
"workflowRule": "workflowrule",
"workflowSend": "workflowsend",
"workflowTask": "workflowtask",
"workflowFlowAction": "workflowflowaction"
},
"types": {
"workflowalert": {
"directoryName": "workflowAlerts",
"id": "workflowalert",
"name": "WorkflowAlert",
"suffix": "workflowAlert",
"xmlElementName": "alerts"
},
"workflowfieldupdate": {
"directoryName": "workflowFieldUpdates",
"id": "workflowfieldupdate",
"name": "WorkflowFieldUpdate",
"suffix": "workflowFieldUpdate",
"xmlElementName": "fieldUpdates"
},
"workflowknowledgepublish": {
"directoryName": "workflowKnowledgePublishes",
"id": "workflowknowledgepublish",
"name": "WorkflowKnowledgePublish",
"suffix": "workflowKnowledgePublish",
"xmlElementName": "knowledgePublishes"
},
"workflowoutboundmessage": {
"directoryName": "workflowOutboundMessages",
"id": "workflowoutboundmessage",
"name": "WorkflowOutboundMessage",
"suffix": "workflowOutboundMessage",
"xmlElementName": "outboundMessages"
},
"workflowrule": {
"directoryName": "workflowRules",
"id": "workflowrule",
"name": "WorkflowRule",
"suffix": "workflowRule",
"xmlElementName": "rules"
},
"workflowsend": {
"directoryName": "workflowSends",
"id": "workflowsend",
"name": "WorkflowSend",
"suffix": "workflowSend",
"xmlElementName": "send"
},
"workflowtask": {
"directoryName": "workflowTasks",
"id": "workflowtask",
"name": "WorkflowTask",
"suffix": "workflowTask",
"xmlElementName": "tasks"
},
"workflowflowaction": {
"directoryName": "workflowFlowActions",
"id": "workflowflowaction",
"name": "WorkflowFlowAction",
"suffix": "workflowFlowAction",
"xmlElementName": "flowActions"
}
}
},
"directoryName": "workflows",
"id": "workflow",
"inFolder": false,
"name": "Workflow",
"strategies": {
"adapter": "decomposed",
"decomposition": "folderPerType",
"transformer": "decomposed"
},
"strictDirectoryName": true,
"suffix": "workflow"
}
}
},
"replacements": [
{
"glob": "force-app/main/default/bots/**/*.bot-meta.xml",
"regexToReplace": "<botUser>.*?</botUser>",
"replaceWithFile": "scripts/replacementFiles/devBotUser.txt",
"replaceWhenEnv": [{
"env": "AUTH_ALIAS",
"value": "SANDBOX"
}]
}
]
}
ASK: Can a new decomposed workflow beta be released with the WorkflowFlowAction addition? |
I'm glad that worked for you. Based on this we can consider either modifying the existing preset or creating a beta2 and deprecating the old one. Thanks for the quick feedback! |
Decided to create a PR for this on the existing preset. forcedotcom/source-deploy-retrieve#1467 But up to you or your team if you wanna make this a beta2 or not. I wasn't sure how to update the test classes, but it seems like the existing tests should cover this change. But let me know if something's wrong or if you wanna reject it and add your solution instead. No issues either way. |
Summary
The metadata type
WorkflowAlert
can be successfully retrieved from the org using the CLI. However, when you attempt to deploy this metadata type with the same manifest file, the deployment will fail withAn object XXXXXXXX of type WorkflowAlert was named in package.xml, but was not found in zipped directory
. The same applies for other child metadata types under Workflow. The only way to currently deploy workflow related items is by using theWorkflow
metadata type.Please update the CLI to allow deployments with
WorkflowAlert
and other children metadata types underWorkflow
.We are only able to move Email Alerts by themselves via Change Set. The file created by CLI retrievals for Email Alerts matches the file created for a change-set, so it seems to be compatible for deployments.
I found other issues regarding this but they were closed
Workflow
, which deploys the entire Workflow over just the email alert)Steps To Reproduce
WorkflowAlert
Expected result
Retrieve and deploy completes successfully.
Actual result
Retrieve completes successfully. Deploy fails with
An object XXXXXXXX of type WorkflowAlert was named in package.xml, but was not found in zipped directory
.System Information
Seen on Windows 11/PowerShell and Linux Ubuntu/Bash.
The text was updated successfully, but these errors were encountered: