Workflow metadata contains many sub-components:
- WorkflowAlert
- WorkflowFieldUpdate
- WorkflowKnowledgePublish
- WorkflowOutboundMessage
- WorkflowRule
- WorkflowTask
It's generally easier to deploy the Workflow
metadata for the given object to make sure all dependent metadata is included rather than specify per each specific sub-component. Be aware this will deploy all related workflow metadata for that given object
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>YourObjectName</members>
<name>Workflow</name>
</types>
<version>52.0</version>
</Package>
If, for whatever reason, you did want to deploy pieces: you'll see that WorkflowTimeTriggers
is within the WorkflowRule
type. You didn't share your full workflow metadata file, but it's surrounded by <rule>
<rules>
<fullName>RuleName</fullName>
<actions>
<name>ActionName</name>
<type>FieldUpdate</type>
</actions>
<active>true</active>
<criteriaItems>
...
</criteriaItems>
<triggerType>onCreateOrTriggeringUpdate</triggerType>
<workflowTimeTriggers>
<actions>
<name>TimeTriggerFieldUpdateName</name>
<type>FieldUpdate</type>
</actions>
<timeLength>30</timeLength>
<workflowTimeTriggerUnit>Days</workflowTimeTriggerUnit>
</workflowTimeTriggers>
</rules>
You can specify the rule by its name, but you also have to make sure to specify any related field update/email alert/outbound message/task used within the time based action separately. Below is an example of time-based trigger with a field update
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>YourObject.RuleName</members>
<name>WorkflowRule</name>
</types>
<types>
<members>YourObject.FieldUpdateName1</members>
<members>YourObject.FieldUpdateName2</members>
<name>WorkflowFieldUpdate</name>
</types>
<version>52.0</version>
</Package>