Workflow Rules not allowed in this org
Detection
- String:
Cannot use: WorkflowRule in this organization - Applies to: component errors, deployment errors
Examples
INVALID_TYPE: Cannot use: WorkflowRule in this organization
Resolution
The edition of the target org does not allow Workflow Rules.
- Migrate the Workflow Rules to Flows (Setup -> Migrate to Flow)
- Meanwhile, let the deployment action below remove them from package.xml before each deployment to this org
Deployment action
A deployment action can solve this error. Create it on the Pull Request of the current branch:
sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type remove-packagexml-items --label "Remove Workflow Rules from package.xml" --packagexml-items "WorkflowRule:*"
Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-remove-packagexml-items/