---
schema_version: "1"
id: 03f139f24c72cefd29f77f814a9ca0ac8983049225df0c83b93ec4c31740d267
title: Workflow
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_workflow.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_workflow.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d4c9736405b067021dafba8e8a697c9c8604d12c99ce238029944046737d1527
description: Represents the metadata associated with a workflow rule. A workflow rule sets workflow actions into motion when its designated conditions are met. You can configure workflow actions to execute immediately when a record meets the conditions in your workflow rule, or set time triggers that execute the workflow actions on a specific day. Use this metadata type to create, update, or delete workflow rule definitions.
---
# Workflow

Represents the metadata associated with a workflow rule. A workflow rule sets workflow actions into motion when its designated conditions are met. You can configure workflow actions to execute immediately when a record meets the conditions in your workflow rule, or set time triggers that execute the workflow actions on a specific day. Use this metadata type to create, update, or delete workflow rule definitions.

For more information, see Workflow in Salesforce Help. This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

When using a manifest file, retrieve all workflow components using this code.

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

## Declarative Metadata File Suffix and Directory Location

Workflow files have the suffix .workflow. There’s one file per standard or custom object that has workflow. These files are stored in the workflows directory of the corresponding package.

## Version

Workflow rules are available in API version 13.0 and later.

## Workflow

This metadata type represents the valid types of workflow rules and actions associated with a standard or custom object.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e107">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e110">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e113">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">alerts</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowAlert">WorkflowAlert</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of all alerts for the object associated with the
                workflow.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">fieldUpdates</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowFieldUpdate">WorkflowFieldUpdate</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of all field updates for the object associated with the
                workflow.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname" id="field_flowActions"><a name="field_flowActions"><!-- --></a>flowActions</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowFlowAction">WorkflowFlowAction</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">
                <span class="ph" id="field_flowActions_desc"><a name="field_flowActions_desc"><!-- --></a>An array of flow triggers for the
                  object associated with the workflow.</span> Available in API
                version 30.0 and later.<p class="p">The pilot program for flow trigger
                  workflow actions is closed. If you already enabled the pilot in
                  your org, you can continue to create and edit flow trigger
                  workflow actions. If you didn’t enable the pilot, use Flow
                  Builder to create a record-triggered flow, or use Process
                  Builder to launch a flow from a process.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e113" data-title="Description">The developer name used as a unique identifier for API access.
                The <span class="keyword parmname">fullName</span> can contain only underscores and
                alphanumeric characters. It must be unique, begin with a letter, not
                include spaces, not end with an underscore, and not contain two
                consecutive underscores. This field is inherited from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a>
                component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">knowledgePublishes</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowKnowledgePublish-89EB4B2A">WorkflowKnowledgePublish</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of Salesforce Knowledge Workflow Publishes associated
                with the workflow. Available in API version 27.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">outboundMessages</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowOutboundMessage">WorkflowOutboundMessage</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of all the outbound messages for the object associated
                with the workflow.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">rules</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowRule">WorkflowRule</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of all the objects associated with the workflow.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e107" data-title="Field Name"><span class="keyword parmname">tasks</span></td>

              <td class="entry" headers="d1032074e110" data-title="Field Type">
                <a class="xref" href="#WorkflowTask">WorkflowTask</a>[]
              </td>

              <td class="entry" headers="d1032074e113" data-title="Description">An array of all the tasks for the object associated with the
                workflow.</td>

            </tr>

          </tbody>

        </table>

## WorkflowActionReference

WorkflowActionReference represents one of the workflow actions.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e287">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e290">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e293">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e287" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d1032074e290" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e293" data-title="Description">Required. The name of the workflow action.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e287" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d1032074e290" data-title="Field Type">WorkflowActionType (enumeration of type string)</td>

              <td class="entry" headers="d1032074e293" data-title="Description">Required. Available types of workflow actions:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Alert</samp></li>

                  <li class="li"><samp class="codeph nolang">FieldUpdate</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">FlowAction</samp>—Available in API version
                    30.0 and later
                  </li>

                  <li class="li"><samp class="codeph nolang">OutboundMessage</samp></li>

                  <li class="li"><samp class="codeph nolang">Task</samp></li>

                </ul>
                <p class="p">The pilot program for flow trigger
                  workflow actions is closed. If you already enabled the pilot in
                  your org, you can continue to create and edit flow trigger
                  workflow actions. If you didn't enable the pilot, use Flow
                  Builder to create a record-triggered flow, or use Process
                  Builder to launch a flow from a process.</p>
              </td>

            </tr>

          </tbody>

        </table>

## WorkflowAlert

WorkflowAlert represents an email alert associated with a workflow rule.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e378">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e381">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e384">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname">ccEmails</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">string[]</td>

              <td class="entry" headers="d1032074e384" data-title="Description">Additional email addresses. This field is similar to the CC field
                in email clients.<p class="p">For the email to be sent successfully, set a
                  value for <span class="keyword parmname">ccEmails</span> or
                  <span class="keyword parmname">recipients</span>. You can set values for both
                  fields. The value of <span class="keyword parmname">ccEmails</span> can include
                  up to 5 different email addresses.
                </p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname"><span class="ph" id="descriptionWorkflowAlert"><a name="descriptionWorkflowAlert"><!-- --></a>description</span></span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e384" data-title="Description"><span class="ph" id="descriptionWorkflowAlertDescription"><a name="descriptionWorkflowAlertDescription"><!-- --></a>Required. A
                  description of the email alert. Available in API version 16.0
                  and later.</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e384" data-title="Description">Required. The developer name used as a unique identifier for API
                access. The <span class="keyword parmname">fullName</span> can contain only
                underscores and alphanumeric characters. It must be unique, begin
                with a letter, not include spaces, not end with an underscore, and
                not contain two consecutive underscores. This field is inherited
                from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e384" data-title="Description">Required. Indicates whether this component is protected (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Protected components can’t
                be linked to or referenced by components created in the installing
                organization.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname">recipients</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">
                <a class="xref" href="#WorkflowEmailRecipient">WorkflowEmailRecipient</a>[]
              </td>

              <td class="entry" headers="d1032074e384" data-title="Description">The recipients for the email.<p class="p">For the email to be sent
                  successfully, set a value for <span class="keyword parmname">ccEmails</span> or
                  <span class="keyword parmname">recipients</span>. You can set values for both
                  fields.
                </p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname" id="field_senderAddress"><a name="field_senderAddress"><!-- --></a>senderAddress</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e384" data-title="Description">The address in the From field
                for the email alert. <span class="ph" id="field_senderAddress_action"><a name="field_senderAddress_action"><!-- --></a>With
                  this address, you can use a standard global email address
                  for your organization, such as <samp class="codeph nolang">support@company.com</samp>, instead of the default
                  From field, which is the email address of the person who
                  updates the record.</span> You can only specify a value in
                this field if the <span class="keyword parmname">senderType</span> is set to
                <samp class="codeph nolang">OrgWideEmailAddress</samp>.
                <span class="ph" id="see_orgwide_email"><a name="see_orgwide_email"><!-- --></a>See Organization-Wide Email Addresses in
                  Salesforce Help.</span>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname" id="field_senderType"><a name="field_senderType"><!-- --></a>senderType</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">ActionEmailSenderType (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d1032074e384" data-title="Description">
                <span class="ph" id="field_senderType_desc"><a name="field_senderType_desc"><!-- --></a>The email used as the sender’s
                  From and Reply-To addresses.</span> These values are valid.<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">CurrentUser</samp>—The
                    email address of the person updating the record. This value
                    is the default setting.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang" id="option_DefaultWorkflowUser"><a name="option_DefaultWorkflowUser"><!-- --></a>DefaultWorkflowUser</samp>—The email address
                    of the default workflow user. If the email alert is
                    installed from a package, this field value is changed to
                    <samp class="codeph nolang">CurrentUser</samp>.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang" id="option_OrgWideEmailAddress"><a name="option_OrgWideEmailAddress"><!-- --></a>OrgWideEmailAddress</samp>—A verified global
                    email address for your organization, such as <samp class="codeph nolang">support@company.com</samp>.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e378" data-title="Field Name"><span class="keyword parmname">template</span></td>

              <td class="entry" headers="d1032074e381" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e384" data-title="Description">Required. Named reference to an EmailTemplate. This email
                template isn’t required to exist in the zip file, but it must exist
                in Metadata API.<p class="p">Lightning email templates aren’t packageable. We
                  recommend using a Classic email template.</p>
              </td>

            </tr>

          </tbody>

        </table>

## WorkflowEmailRecipient

WorkflowEmailRecipient represents a recipient for an email alert associated with a workflow rule.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e608">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e611">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e614">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e608" data-title="Field Name"><span class="keyword parmname">field</span></td>

              <td class="entry" headers="d1032074e611" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e614" data-title="Description">Name of the field referenced in <span class="keyword parmname">type</span>. The
                field named is of the type specified in
                <span class="keyword parmname">type</span>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e608" data-title="Field Name"><span class="keyword parmname">recipient</span></td>

              <td class="entry" headers="d1032074e611" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e614" data-title="Description">The recipients for the email. Depending on the type selected,
                this field is required.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e608" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d1032074e611" data-title="Field Type">ActionEmailRecipientTypes (enumeration of type string)</td>

              <td class="entry" headers="d1032074e614" data-title="Description">Named reference to an EmailTemplate component. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">accountOwner</samp>—The email
                    is sent to the record’s account owner. For example, the
                    Account owner for an Opportunity.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">accountTeam</samp>—Only
                    applicable on the Account object. The email is sent to
                    everyone on that Account’s account team.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">campaignMemberDerivedOwner</samp>—Emails are sent to
                    lead and contact owners when contacts are added to a
                    campaign or in response to a campaign.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">contactLookup</samp>—The email
                    is sent to a contact whose value is looked up from a field
                    on the record. For this value, the <samp class="codeph nolang">field</samp> field must reference
                    a Contact.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">creator</samp>—The email is
                    sent to the record’s creator.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">customerPortalOwner</samp>—The
                    email is sent to a specific self-service portal user. For
                    this value, the recipient field must reference a
                    self-service portal user by their username.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">email</samp>—The email is sent
                    to an email address whose value is looked up from a field on
                    the record. For this value, the <samp class="codeph nolang">field</samp> field must reference an email
                    field.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">group</samp>—The email is sent
                    to all users in a group. For this value, the recipient field
                    must reference a group by group name.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">opportunityTeam</samp>—Only
                    applicable on the Opportunity object. The email is sent to
                    everyone on that Opportunity’s opportunity team.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">owner</samp>—The email is sent
                    to the record’s owner.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">partnerUser</samp>—The email
                    is sent to a specific partner user. For this value, the
                    recipient field must reference a partner user by
                    username.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">portalRole</samp> - Like
                    <samp class="codeph nolang">role</samp>, but for
                    portal roles only.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">portalRoleSubordinates</samp>
                    -
                    Like
                    <samp class="codeph nolang">roleSubordinates</samp>,
                    but for portal roles only.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">role</samp>—The email is sent
                    to all users in a role. For this value, the recipient field
                    must reference a role name in the role hierarchy.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">roleSubordinates</samp>—The
                    email is sent to all users in a role subordinate. For this
                    value, the recipient field must reference a role.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">roleSubordinatesInternal</samp>—Like <samp class="codeph nolang">roleSubordinates</samp>, but for
                    internal portal roles only.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">user</samp>—The email is sent
                    to a specific user. For this value, the recipient field must
                    reference a user by username.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">userLookup</samp>—The email is
                    sent to a user whose value is looked up from a field on the
                    record. For this value, the <samp class="codeph nolang">field</samp> field must reference a user foreign key
                    field.
                  </li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## WorkflowFieldUpdate

WorkflowFieldUpdate represents a workflow field update. With field updates, you can automatically update a field value to one that you specify when a workflow rule is triggered.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e807">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e810">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e813">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">The description of the field update. This information is useful
                to track the reasoning for initially configuring the field
                update.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">field</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Required. The field on the object for the workflow to be
                updated.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">formula</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">If the <span class="keyword parmname">operation</span> field value is <samp class="codeph nolang">Formula</samp>, the formula used to
                compute the new field value.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Required. The developer name used as a unique identifier for API
                access. The <span class="keyword parmname">fullName</span> can contain only
                underscores and alphanumeric characters. It must be unique, begin
                with a letter, not include spaces, not end with an underscore, and
                not contain two consecutive underscores. This field is inherited
                from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">literalValue</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">If the <span class="keyword parmname">operation</span> field value is <samp class="codeph nolang">Literal</samp>, the literal value for the
                field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname" id="WorkFlowFieldUpdate_lookupValue"><a name="WorkFlowFieldUpdate_lookupValue"><!-- --></a>lookupValue</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">If the <span class="keyword parmname">operation</span> field value is
                <span class="keyword parmname">lookupValue</span>, the lookup value that is
                referenced.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">lookupValueType</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">LookupValueType (enumeration of type string)</td>

              <td class="entry" headers="d1032074e813" data-title="Description">The type of object that the <span class="keyword parmname">lookupValue</span>
                field value is referencing. The valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Queue</samp></li>

                  <li class="li"><samp class="codeph nolang">RecordType</samp></li>

                  <li class="li"><samp class="codeph nolang">User</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname"><span class="ph" id="nameFieldUpdate"><a name="nameFieldUpdate"><!-- --></a>name</span></span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description"><span class="ph" id="name_added_160"><a name="name_added_160"><!-- --></a>Required. A name for the component. Available in version
                  API 16.0 and later.</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">notifyAssignee</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Required. Notify the assignee when the field is updated.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname" id="WorkflowFieldUpdate_operation"><a name="WorkflowFieldUpdate_operation"><!-- --></a>operation</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">FieldUpdateOperation (enumeration of type string)</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Required. The operation that computes the value with which to
                update the field. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">Formula</samp>—Indicates the
                    field is set to a formula. If set, the formula must be a
                    valid formula.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Literal</samp>—Indicates the
                    field is set to a literal value. If set, the literalValue
                    must be a valid literal value for this field.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">LookupValue</samp>—Similar to
                    Literal, but for an object reference, such as a contact,
                    user, or account. If set, the <samp class="codeph nolang">lookupValue</samp> element must be set. Only User is
                    supported in the current API.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">NextValue</samp>—Indicates
                    that the field will be set to its next value. Only allowed
                    when the field update references a picklist.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Null</samp>—Indicates that the
                    field is set to null.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">PreviousValue</samp>—Indicates
                    that the field is set to its previous value. Only allowed
                    when the field update references a picklist.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Required. Indicates whether this component is protected (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Protected components can’t be
                linked to or referenced by components created in the installing
                organization.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname" id="WorkflowFieldUpdate_reevaluateOnChange"><a name="WorkflowFieldUpdate_reevaluateOnChange"><!-- --></a>reevaluateOnChange</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e813" data-title="Description">When set to <samp class="codeph nolang">true</samp>,
                if the field update changes the field’s value,
                all workflow rules on the associated object are reevaluated. Any
                workflow rules whose criteria are met as a result of the field value
                change are triggered.<p class="p">If any of the triggered workflow rules
                  result in another field update that’s also enabled for workflow
                  rule reevaluation, a domino effect occurs, and more workflow
                  rules can be reevaluated as a result of the newly triggered
                  field update. This cascade of workflow rule reevaluation and
                  triggering can happen up to 5 times after the initial field
                  update that started it.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e807" data-title="Field Name"><span class="keyword parmname">targetObject</span></td>

              <td class="entry" headers="d1032074e810" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e813" data-title="Description">Object set if the change is detected on a child record.
                If set, the object points to the foreign key reference on the
                child object that points to the parent. For example, if
                <samp class="codeph nolang">EmailMessage</samp> child
                record is changed, <samp class="codeph nolang">EmailMessage.ParentId</samp> points to the <samp class="codeph nolang">Case</samp> parent.
                <span class="ph" id="field_targetObject_old_name"><a name="field_targetObject_old_name"><!-- --></a>This field is named
                  <span class="keyword parmname">sourceField</span> before version 14.0. The
                  field name change is automatically handled between versions and
                  doesn’t require any manual editing of existing XML component
                  files.</span>
              </td>

            </tr>

          </tbody>

        </table>

## WorkflowFlowAction

Represents a flow trigger, which is a workflow action that launches a flow. Available in API version 30.0 and later. For more information, see these topics in Salesforce Help.

- Define a Flow Trigger for Workflow (Pilot)
- Flow Trigger Considerations (Pilot)

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

- The pilot program for flow trigger workflow actions is closed. If you already enabled the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you didn’t enable the pilot, use Flow Builder to create a record-triggered flow, or use Process Builder to launch a flow from a process.
- Test mode for flow triggers isn’t supported in the Metadata API. If you want a flow trigger to run the latest flow version when an administrator causes the workflow rule to fire, enable test mode via the user interface after deployment.

| Field Name | Field Type | Description |
| --- | --- | --- |
| description | string | Describes the flow trigger. |
| flow | string | Required. API name of the flow that this workflow action launches. |
| flowInputs | [WorkflowFlowActionParameter](#WorkflowFlowActionParameter)\[\] | An array of values to pass into flow variables when launching the flow. |
| label | string | Required. Name of the flow trigger. |
| language | string | Reserved for future use. |
| protected | boolean | Reserved for future use. |

## WorkflowFlowActionParameter

Represents a value specified in the flow trigger that is passed into a variable when launching the flow.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

The pilot program for flow trigger workflow actions is closed. If you already enabled the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you didn’t enable the pilot, use Flow Builder to create a record-triggered flow, or use Process Builder to launch a flow from a process.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e1276">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e1279">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e1282">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e1276" data-title="Field Name"><span class="keyword parmname" id="field_name"><a name="field_name"><!-- --></a>name</span></td>

              <td class="entry" headers="d1032074e1279" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1282" data-title="Description">Required. API name of the flow variable.<p class="p">The flow variable must
                  have <span class="keyword parmname">isInput</span> set to <samp class="codeph nolang">True</samp>.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1276" data-title="Field Name"><span class="keyword parmname" id="field_value"><a name="field_value"><!-- --></a>value</span></td>

              <td class="entry" headers="d1032074e1279" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1282" data-title="Description">Required. Value to assign to the flow variable when launching the
                flow. <p class="p">If the variable's data type is sObject,
                  <span class="keyword parmname">value</span> must be a merge field that
                  identifies a record—or a lookup relationship field that
                  references a record—of the same object type as the variable. For
                  example:
                </p>
                <ul class="ul bulletList">
                  <li class="li">
                    <kbd class="ph userinput">{!this}</kbd>—Identifies the record that
                    fired the workflow rule.
                  </li>

                  <li class="li">
                    <kbd class="ph userinput">{!Contact}</kbd>—Identifies the contact
                    associated with the record that fired the workflow
                    rule.
                  </li>

                  <li class="li">
                    <kbd class="ph userinput">{!Asset.Account}</kbd>—Identifies the
                    account associated with the asset that is associated with
                    the record that fired the workflow rule.
                  </li>

                  <li class="li">
                    <kbd class="ph userinput">{!SomeObject__r}</kbd>—Uses a lookup
                    relationship field to identify a custom object record
                    associated with the record that fired the workflow
                    rule.
                  </li>

                </ul>
                <p class="p">For variables of other data types, you can enter a merge
                  field or a literal value. Manually enter a literal value when
                  the variable requires the same value every time the flow is
                  launched, regardless of which record fired the workflow rule.
                  For example, you can enter <kbd class="ph userinput">true</kbd> or
                  <kbd class="ph userinput">false</kbd> for a variable of type
                  Boolean.
                </p>
                <p class="p">Supported merge fields identify a global variable
                  or a field of the same data type as the flow variable. For
                  example:</p>
                <ul class="ul bulletList">
                  <li class="li">
                    <kbd class="ph userinput">{!Id}</kbd>—ID of the record that fired the
                    workflow rule.
                  </li>

                  <li class="li">
                    <kbd class="ph userinput">{!Account.Owner.Email}</kbd>—Email address
                    of the account owner for the account associated with the
                    record that fired the workflow rule.
                  </li>

                  <li class="li">
                    <kbd class="ph userinput">{!$Organization.Country}</kbd>—Country of
                    the organization.
                  </li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## WorkflowKnowledgePublish

WorkflowKnowledgePublish represents Salesforce Knowledge article publishing actions and information. Available in API version 27.0 and later.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e1403">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e1406">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e1409">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e1403" data-title="Field Name"><span class="keyword parmname">action</span></td>

              <td class="entry" headers="d1032074e1406" data-title="Field Type">KnowledgeWorkflowAction (enumeration of type string)</td>

              <td class="entry" headers="d1032074e1409" data-title="Description">Required. The article publishing actions available when this rule
                fires. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">PublishAsNew</samp>—Publishes
                    the article as a new article.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Publish</samp>—Publishes the
                    article as a version of a previously published article.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1403" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d1032074e1406" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1409" data-title="Description">A brief article description.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1403" data-title="Field Name"><span class="keyword parmname">label</span></td>

              <td class="entry" headers="d1032074e1406" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1409" data-title="Description">
                <p class="p">Required. Label that represents the article throughout the
                  Salesforce user interface.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1403" data-title="Field Name"><span class="keyword parmname">language</span></td>

              <td class="entry" headers="d1032074e1406" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1409" data-title="Description">The language of the article.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1403" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d1032074e1406" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1409" data-title="Description">Required. Indicates whether this component is protected (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Protected components can’t
                be linked to or referenced by components created in the installing
                organization.</td>

            </tr>

          </tbody>

        </table>

## WorkflowOutboundMessage

WorkflowOutboundMessage represents an outbound message associated with a workflow rule. Outbound messages are workflow and approval actions that send the information you specify to an endpoint you designate, such as an external service. An outbound message sends the data in the specified fields in the form of a SOAP message to the endpoint. For more information, see Outbound Message Actions in Salesforce Help.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e1529">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e1532">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e1535">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname" id="field_apiVersion"><a name="field_apiVersion"><!-- --></a>apiVersion</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">double</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. <span class="ph" id="field_apiVersion_desc"><a name="field_apiVersion_desc"><!-- --></a>The API version of the
                  outbound message. Automatically set to the current API version
                  when the outbound message is created. Valid API versions for
                  outbound messages are 8.0 and 18.0 or later.</span>
                <p class="p">This API
                  version is used in API calls back to Salesforce using the
                  enterprise or partner WSDLs. The <span class="keyword parmname">API
                    Version</span> can only be modified by using Metadata
                  API. It can’t be modified using the Salesforce user interface.
                  This field is available in API version 18.0 and later.</p>
                <p class="p">If
                  you change the <span class="keyword parmname">apiVersion</span> to a version that
                  doesn’t support one of the <span class="keyword parmname">fields</span>
                  configured for the outbound message, the messages fail until you
                  update your outbound message listener to consume the updated
                  WSDL.</p>
                <p class="p">To monitor the status of outbound messages, from
                  Setup, in the Quick Find box, enter <kbd class="ph userinput">Outbound
                    Messages</kbd>, and then select <strong class="ph uicontrol">Outbound
                    Messages</strong> inSalesforce.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Describes the outbound message.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">endpointUrl</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. The endpoint URL to which the outbound message is
                sent.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname" id="field_fields"><a name="field_fields"><!-- --></a>fields</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string[]</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">The named references to the fields to be sent.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. The developer name used as a unique identifier for API
                access. The <span class="keyword parmname">fullName</span> can contain only
                underscores and alphanumeric characters. It must be unique, begin
                with a letter, not include spaces, not end with an underscore, and
                not contain two consecutive underscores. This field is inherited
                from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">includeSessionId</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. Set if you want the Salesforce <dfn class="term">session ID</dfn>
                included in the outbound message. Useful if you intend to make API
                calls and you don’t want to include a username and password.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">integrationUser</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. The named reference to the user under which this
                message is sent.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1535" data-title="Description"><span class="ph" id="nameOutboundMessageDescription"><a name="nameOutboundMessageDescription"><!-- --></a>Required. A name for the
                  component. Available in version API 16.0 and later.</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">Required. Indicates whether this component is protected (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Protected components can’t
                be linked to or referenced by components created in the installing
                organization.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1529" data-title="Field Name"><span class="keyword parmname">useDeadLetterQueue</span></td>

              <td class="entry" headers="d1032074e1532" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1535" data-title="Description">This field is only available for organizations with dead letter
                queue permissions turned on. If set, this outbound message uses
                the dead letter queue if normal delivery fails.</td>

            </tr>

          </tbody>

        </table>

## WorkflowRule

This metadata type represents a workflow rule. This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e1759">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e1762">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e1765">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">actions</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">
                <a class="xref" href="#WorkflowActionReference">WorkflowActionReference</a>[]
              </td>

              <td class="entry" headers="d1032074e1765" data-title="Description">An array of references for the actions that happen when
                this rule fires.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">active</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">Required. Determines if this rule is active.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">booleanFilter</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">For advanced criteria filter, the boolean formula. For example,
                <samp class="codeph nolang">(1 AND 2) OR 3</samp>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">criteriaItems</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm#filteritem">FilterItem</a>[]
              </td>

              <td class="entry" headers="d1032074e1765" data-title="Description">An array of the boolean criteria (conditions) under which this
                rule fires. Either <span class="keyword parmname">criteriaItems</span> or
                <span class="keyword parmname">formula</span> must be set.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">The description of the workflow rule.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">failedMigrationToolVersion</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">The API version in which a migration fails. Used as a reference to
                admins to retry the migration when the next version is released.
                <p class="p">Available in API version 54.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">formula</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">The formula condition under which this rule first must be set,
                either <span class="keyword parmname">formula</span> or
                <span class="keyword parmname">criteriaItems</span>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">The developer name used as a unique identifier for API access.
                The <span class="keyword parmname">fullName</span> can contain only underscores and
                alphanumeric characters. It must be unique, begin with a letter, not
                include spaces, not end with an underscore, and not contain two
                consecutive underscores. This field is inherited from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a>
                component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname">triggerType</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type">WorkflowTriggerTypes (enumeration of type string)</td>

              <td class="entry" headers="d1032074e1765" data-title="Description">Under what conditions the trigger fires. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <span class="ph" id="onAllChanges"><a name="onAllChanges"><!-- --></a><samp class="codeph nolang">onAllChanges</samp></span>—The workflow rule is
                    considered on all changes.
                  </li>

                  <li class="li">
                    <span class="ph" id="onCreateOnly"><a name="onCreateOnly"><!-- --></a><samp class="codeph nolang">onCreateOnly</samp></span>—The workflow rule is
                    considered only on create.
                  </li>

                  <li class="li">
                    <span class="ph" id="onCreateOrTriggeringUpdate"><a name="onCreateOrTriggeringUpdate"><!-- --></a><samp class="codeph nolang">onCreateOrTriggeringUpdate</samp></span>—The
                    workflow rule is considered on create and triggering
                    updates.
                  </li>
                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1759" data-title="Field Name"><span class="keyword parmname" id="workflowTimeTriggers"><a name="workflowTimeTriggers"><!-- --></a>workflowTimeTriggers</span></td>

              <td class="entry" headers="d1032074e1762" data-title="Field Type"><a class="xref" href="#WorkflowTimeTrigger">WorkflowTimeTrigger</a></td>

              <td class="entry" headers="d1032074e1765" data-title="Description">Represents a set of Workflow actions, including Field Updates,
                Email Alerts, Outbound Messages, and Tasks, that executes before or
                after a specified interval of time.</td>

            </tr>

          </tbody>

        </table>

## WorkflowTask

This metadata type references an assigned workflow task.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e1985">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e1988">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e1991">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">assignedTo</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Specifies the user, role, or team to which the workflow rule or
                action is assigned. The field corresponding to the value specified
                here must be the same as the specified
                <span class="keyword parmname">assignedToType</span>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">assignedToType</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">ActionTaskAssignedToTypes (enumeration of type string)</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Valid string values for this type are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">accountCreator</samp>—When
                    set, the task is assigned to the record’s account's
                    creator.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">accountOwner</samp>—When set,
                    the task is assigned to the record’s account owner
                    (Opportunity).
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">accountTeam</samp>—Same as
                    WorkflowAlert type
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">creator</samp>—When set, the
                    task is assigned to the record’s creator.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">opportunityTeam</samp>—Same as
                    WorkflowAlert type
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">owner</samp>—When set, the
                    task is assigned to the record’s owner.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">partnerUser</samp>—When set,
                    the <span class="keyword parmname">assignedTo</span> field references a
                    partner user by username.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">portalRole</samp>—When set,
                    the <span class="keyword parmname">assignedTo</span> field references a Role
                    by role name, a portal role.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">role</samp>—When set, the
                    <span class="keyword parmname">assignedTo</span> field references a Role
                    by role name.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">user</samp>—When set, the
                    <span class="keyword parmname">assignedTo</span> field references a User
                    by username.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">The description of this workflow task.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">dueDateOffset</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">int</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. The offset, in days, from either the trigger date, or
                the date specified in the (optional)
                <span class="keyword parmname">offsetFromField</span>. The offset can be a
                negative number.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. The developer name used as a unique identifier for API
                access. The <span class="keyword parmname">fullName</span> can contain only
                underscores and alphanumeric characters. It must be unique, begin
                with a letter, not include spaces, not end with an underscore, and
                not contain two consecutive underscores. This field is inherited
                from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">notifyAssignee</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. Set to send an email notification when the task is
                assigned.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">offsetFromField</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Optional field reference of the date field from which the <samp class="codeph nolang">dueDate</samp> is computed.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">priority</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. The priority to assign the created task.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">boolean</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. Indicates whether this component is protected (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Protected components can’t
                be linked to or referenced by components created in the installing
                organization.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname">status</span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description">Required. The status to assign the created task.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e1985" data-title="Field Name"><span class="keyword parmname"><span class="ph" id="subjectWorkflowTask"><a name="subjectWorkflowTask"><!-- --></a>subject</span></span></td>

              <td class="entry" headers="d1032074e1988" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e1991" data-title="Description"><span class="ph" id="subjectWorkflowTaskDescription"><a name="subjectWorkflowTaskDescription"><!-- --></a>Required. A subject for
                  the workflow task that’s used if an email notification is sent
                  when the task is assigned. Available in API version 16.0 and
                  later.</span></td>

            </tr>

          </tbody>

        </table>

## WorkflowTimeTrigger

Represents a set of Workflow actions, including Field Updates, Email Alerts, Outbound Messages, and Tasks, that execute before or after a specified interval of time.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1032074e2262">Field Name</th>

              <th class="featureTableHeader  " id="d1032074e2265">Field Type</th>

              <th class="featureTableHeader  " id="d1032074e2268">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1032074e2262" data-title="Field Name"><span class="keyword parmname">actions</span></td>

              <td class="entry" headers="d1032074e2265" data-title="Field Type">
                <a class="xref" href="#WorkflowActionReference">WorkflowActionReference</a>[]
              </td>

              <td class="entry" headers="d1032074e2268" data-title="Description">An array of references for the actions that happen when
                this trigger fires.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e2262" data-title="Field Name"><span class="keyword parmname" id="wf_offsetFromField"><a name="wf_offsetFromField"><!-- --></a>offsetFromField</span></td>

              <td class="entry" headers="d1032074e2265" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e2268" data-title="Description">The date type field name that the time-based workflow triggers
                from, such as <span class="keyword parmname">Created Date</span>, <span class="keyword parmname">Last
                  Modified Date</span>, <span class="keyword parmname">Rule Trigger Date</span>,
                or a custom date field on the object for which the workflow rule is defined.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e2262" data-title="Field Name"><span class="keyword parmname" id="wf_timeLength"><a name="wf_timeLength"><!-- --></a>timeLength</span></td>

              <td class="entry" headers="d1032074e2265" data-title="Field Type">string</td>

              <td class="entry" headers="d1032074e2268" data-title="Description">The numeric value of the time after or before the workflow
                triggers. A negative value represents the time length before the
                trigger fires. The <span class="keyword parmname">timeLength</span> is measured in
                either hours or days, as specified by
                <span class="keyword parmname"><u class="ph u">workflowTimeTriggerUnit</u></span>.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1032074e2262" data-title="Field Name"><span class="keyword parmname" id="workflowTimeTriggerUnit"><a name="workflowTimeTriggerUnit"><!-- --></a>workflowTimeTriggerUnit</span></td>

              <td class="entry" headers="d1032074e2265" data-title="Field Type">WorkflowTimeUnits (enumeration of type string)</td>

              <td class="entry" headers="d1032074e2268" data-title="Description">The unit of time before or after which the time-based workflow
                triggers. Valid string values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Hours</samp></li>

                  <li class="li"><samp class="codeph nolang">Days</samp></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

Here’s the definition of a workflow rule.

<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
    <alerts\>
        <fullName\>Another\_alert</fullName\>
        <description\>Another alert</description\>
        <protected\>false</protected\>
        <recipients\>
            <type\>accountOwner</type\>
        </recipients\>
        <recipients\>
            <field\>Contact\_\_c</field\>
            <type\>contactLookup</type\>
        </recipients\>
        <recipients\>
            <field\>Email\_\_c</field\>
            <type\>email</type\>
        </recipients\>
        <template\>TestEmail/Email Test</template\>
    </alerts\>
    <fieldUpdates\>
        <fullName\>Enum\_Field\_Update</fullName\>
        <description\>Blah</description\>
        <field\>EnumField\_\_c</field\>
        <name\>Enum Field Update</name\>
        <notifyAssignee\>true</notifyAssignee\>
        <operation\>NextValue</operation\>
        <protected\>false</protected\>
    </fieldUpdates\>
    <fieldUpdates\>
        <fullName\>Enum\_Field\_Update2</fullName\>
        <description\>Blah</description\>
        <field\>EnumField\_\_c</field\>
        <literalValue\>PLX2</literalValue\>
        <name\>Enum Field Update2</name\>
        <notifyAssignee\>true</notifyAssignee\>
        <operation\>Literal</operation\>
        <protected\>false</protected\>
    </fieldUpdates\>
    <fieldUpdates\>
        <fullName\>Field\_Update</fullName\>
        <description\>TestField update desc</description\>
        <field\>Name</field\>
        <formula\>Name &amp; &quot;Updated&quot;</formula\>
        <name\>Field Update</name\>
        <notifyAssignee\>false</notifyAssignee\>
        <operation\>Formula</operation\>
        <protected\>false</protected\>
    </fieldUpdates\>
    <fieldUpdates\>
        <fullName\>Lookup\_On\_Contact</fullName\>
        <field\>RealOwner\_\_c</field\>
        <lookupValue\>admin@acme.com</lookupValue\>
        <name\>Lookup On Contact</name\>
        <notifyAssignee\>false</notifyAssignee\>
        <operation\>LookupValue</operation\>
        <protected\>false</protected\>
    </fieldUpdates\>
    <outboundMessages\>
        <fullName\>Another\_Outbound\_message</fullName\>
        <description\>Another Random outbound.</description\>
        <endpointUrl\>http://www.test.com</endpointUrl\>
        <fields\>Email\_\_c</fields\>
        <fields\>Id</fields\>
        <fields\>Name</fields\>
        <includeSessionId\>true</includeSessionId\>
        <integrationUser\>admin@acme.com</integrationUser\>
        <name\>Another Outbound message</name\>
        <protected\>false</protected\>
    </outboundMessages\>
    <rules\>
        <fullName\>BooleanFilter</fullName\>
        <active\>false</active\>
        <booleanFilter\>1 AND 2 OR 3</booleanFilter\>
        <criteriaItems\>
            <field\>CustomObjectForWorkflow\_\_c.CreatedById</field\>
            <operation\>notEqual</operation\>
        </criteriaItems\>
        <criteriaItems\>
            <field\>CustomObjectForWorkflow\_\_c.CreatedById</field\>
            <operation\>notEqual</operation\>
            <value\>abc</value\>
        </criteriaItems\>
        <criteriaItems\>
            <field\>CustomObjectForWorkflow\_\_c.CreatedById</field\>
            <operation\>equals</operation\>
            <value\>xyz</value\>
        </criteriaItems\>
        <triggerType\>onCreateOrTriggeringUpdate</triggerType\>
    </rules\>
    <rules\>
        <fullName\>Custom Rule1</fullName\>
        <actions\>
            <name\>Another\_alert</name\>
            <type\>Alert</type\>
        </actions\>
        <actions\>
            <name\>Enum\_Field\_Update2</name\>
            <type\>FieldUpdate</type\>
        </actions\>
        <actions\>
            <fullName\>Field\_Update</name\>
                <type\>FieldUpdate</type\>
        </actions\>
        <actions\>
            <name\>Another\_Outbound\_message</name\>
            <type\>OutboundMessage</type\>
        </actions\>
        <actions\>
            <name\>Role\_task\_was\_completed</name\>
            <type\>Task</type\>
        </actions\>
        <active\>true</active\>
        <criteriaItems\>
            <field\>CustomObjectForWorkflow\_\_c.Name</field\>
            <operation\>startsWith</operation\>
            <value\>ABC</value\>
        </criteriaItems\>
        <description\>Custom Rule1 desc</description\>
        <triggerType\>onCreateOrTriggeringUpdate</triggerType\>
    </rules\>
    <rules\>
        <fullName\>IsChangedFunctionRule</fullName\>
        <active\>true</active\>
        <description\>IsChangedDesc</description\>
        <formula\>ISCHANGED(Name)</formula\>
        <triggerType\>onAllChanges</triggerType\>
    </rules\>
    <tasks\>
        <fullName\>Another\_task\_was\_completed</fullName\>
        <assignedToType\>owner</assignedToType\>
        <description\>Random Comment</description\>
        <dueDateOffset\>20</dueDateOffset\>
        <notifyAssignee\>true</notifyAssignee\>
        <priority\>High</priority\>
        <protected\>false</protected\>
        <status\>Completed</status\>
        <subject\>Another task was completed</subject\>
    </tasks\>
    <tasks\>
        <fullName\>Role\_task\_was\_completed</fullName\>
        <assignedTo\>R11</assignedTo\>
        <assignedToType\>role</assignedToType\>
        <dueDateOffset\>-2</dueDateOffset\>
        <notifyAssignee\>true</notifyAssignee\>
        <offsetFromField\>CustomObjectForWorkflow\_\_c.CreatedDate</offsetFromField\>
        <priority\>High</priority\>
        <protected\>false</protected\>
        <status\>Completed</status\>
        <subject\>Role task was completed</subject\>
    </tasks\>
    <tasks\>
        <fullName\>User\_task\_was\_completed</fullName\>
        <assignedTo\>admin@acme.com</assignedTo\>
        <assignedToType\>user</assignedToType\>
        <dueDateOffset\>-2</dueDateOffset\>
        <notifyAssignee\>true</notifyAssignee\>
        <offsetFromField\>User.CreatedDate</offsetFromField\>
        <priority\>High</priority\>
        <protected\>false</protected\>
        <status\>Completed</status\>
        <subject\>User task was completed</subject\>
    </tasks\>
</Workflow\>    

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").