Loading

Retroactively Trigger Salesforce Workflow Rules on Existing Records Using Data Loader

Publiceringsdatum: Jun 29, 2026
Beskrivning

Salesforce Workflow Rules are a legacy automation tool that fire automatically when records are created or edited. However, workflow rules do not automatically fire for existing records that were created before the rule was set up.
Note: Salesforce Workflow Rules are a legacy feature. For new automations, Salesforce recommends using Flow. This article applies to scenarios where existing Workflow Rules need to be retroactively applied to records already in the system.
To retroactively run a workflow rule on existing records, the method you use depends on the evaluation criteria configured on the workflow rule:

  1. Evaluate the rule when a record is created.
  2. Evaluate the rule when a record is created, and every time it is edited.
  3. Evaluate the rule when a record is created, and every time it is edited to subsequently meet the criteria.

The option to Allow Workflow Rules to Apply Retroactively is a pending Idea and is not yet available as a standard feature.

Lösning

Condition 1: Evaluate the Rule When a Record Is Created

This evaluation criteria does not allow the workflow rule to run on any existing records. It only fires when new records are created. No retroactive action is possible with this condition.

Condition 2: Evaluate the Rule When a Record Is Created, and Every Time It Is Edited

This condition allows you to retroactively trigger the workflow by performing a mass update on existing records using the Data Loader.

  1. Ensure the workflow rule is active.
  2. Export a report as a CSV file containing only the record IDs of the records on which you want to run the workflow rule.
  3. Open the CSV in Excel and verify that it contains only the IDs and a column title header — no additional rows or footer content.
  4. Use the Data Loader (or any other API tool) to perform an Update operation, mapping only the record ID field.

Impact: The Last Modified Date of each record changes to the date and time of the mass update. No other changes are made, other than those triggered by the workflow rule itself.

Condition 3: Evaluate the Rule When a Record Is Created, and Every Time It Is Edited to Subsequently Meet the Criteria

This condition requires temporarily modifying the workflow criteria to force it to evaluate on the update.

  1. Ensure the workflow rule is active.
  2. Create a checkbox field on the object, with a default value of checked (True).
  3. Temporarily add the checkbox to the workflow criteria: checkbox EQUALS True.
  4. Export a report as a CSV containing only the record IDs of the target records.
  5. Open the CSV in Excel and add a new column. Set the column title (first row) to the API name of the checkbox field, and set all values to 1 (meaning True) next to each ID.
  6. Verify the file contains only the IDs and the checkbox column, with no other rows.
  7. Use the Data Loader to perform an Update operation, mapping the ID field and the checkbox field.
  8. After the update completes, remove the checkbox reference from the workflow criteria.
  9. Delete the checkbox field.

Impact: The Last Modified Date changes to the date and time of the mass update. See the notes below for how time triggers behave.

Notes on Workflow Time Triggers on Existing Records

When a workflow rule is evaluated, all actions and time triggers are scheduled for their appointed time — even if that time is in the past. If the appointed time is already past when the workflow fires, the time trigger will fire in the next processing batch, typically within a few minutes.
Example: A workflow on a Contract object is configured to send an email 60 days, 30 days, and 5 days before the Contract Expiration Date. If the workflow is run retroactively on a contract with an expiration date 15 days from now, the emails scheduled for 60 days and 30 days before the expiration date (which should have fired 45 and 15 days ago) will be sent within minutes of the workflow being triggered. Only the 5-day email will fire on schedule. To control individual time triggers independently, configure them on separate workflow rules.

Knowledge-artikelnummer

000386750

 
Laddar
Salesforce Help | Article