Sub topic 4
Inventorying what you have
This chapter assumes you can navigate Setup, read basic formula syntax, and recognize the parts of a Workflow Rule and a Process Builder process from earlier chapters. You need a sandbox or Developer Edition org where you can run queries. Everything here is read-only, so no automation changes.
Why inventory first
A migration fails when you convert what you remember instead of what exists. Orgs usually hold rules built by people who have left, processes that overlap on the same object, and automation that is switched on but never fires. An inventory gives you a complete, ordered list of what to migrate, merge, or retire.
By the end you will have one table with a row per automation, grouped by object. Later chapters use it to design consolidated flows and to pick candidates for the Migrate to Flow tool.
What to collect
For every Workflow Rule and every Process Builder process, record the following.
| Field | Why it matters later |
|---|---|
| Object | Flows are grouped per object, so this is your main grouping key |
| Name and API name | Lets you trace behavior back to the original |
| Active or inactive | Inactive items usually need no migration |
| Trigger condition | Create only, create and edit, or every edit decides the flow's trigger and run frequency |
| Criteria | Becomes the entry condition |
| Immediate actions | Become flow elements |
| Time-dependent or scheduled actions | Become scheduled paths |
| Action types used | Flags actions with no direct equivalent, such as outbound messages |
| Last modified and owner | Helps you find someone who knows the business reason |
Listing Process Builder processes
Process Builder processes are stored as flow definitions whose process type is Workflow. Run this in the Developer Console Query Editor with Use Tooling API checked, or in any Tooling API client.
SELECT ApiName, Label, ProcessType, IsActive
FROM FlowDefinitionView
WHERE ProcessType = 'Workflow' AND IsActive = trueThis returns only active processes. Drop the IsActive condition once if you also want to see inactive ones, since you need to confirm they really are dead before you ignore them.
The result does not include the object. Open each process in Process Builder, or use the Flows list in Setup, to read which object it starts from.
Listing Workflow Rules
Workflow Rules are queried separately through the Tooling API.
SELECT Id, Name, TableEnumOrId
FROM WorkflowRuleTableEnumOrId holds the object. For standard objects it is the API name, such as Opportunity. For custom objects it is the object's record ID, so you must look it up in Setup or in EntityDefinition before you can group by object.
SELECT QualifiedApiName, DurableId
FROM EntityDefinition
WHERE IsCustomizable = true AND QualifiedApiName LIKE '%__c'Match the DurableId values against TableEnumOrId to convert the IDs to readable names.
Queries tell you what exists and where. They do not tell you the criteria or actions. For those, open each item in Setup, or retrieve its metadata with the Metadata API and read the XML.
Reading the details
Setup is slower but sufficient for a small org. Use Process Automation > Workflow Rules for rules, and the Flows list for processes. Open each active item and copy these into your table:
- The evaluation criteria: when the rule runs, and whether it uses a filter or a formula.
- Each immediate action and its type.
- Each time-dependent action, with its offset such as "7 days after Close Date".
For a larger org, retrieve the metadata with a package manifest that lists WorkflowRule, Workflow, and Flow types. Search the files rather than clicking through hundreds of screens. A process's Flow file lists its processType and its action calls.
Finding automation the queries miss
Workflow Rules and Process Builder are not the only automation on an object. If you ignore the rest, a migrated flow can duplicate or conflict with something you did not list. Also check these on each object:
- Existing record-triggered flows, which may already do part of the job.
- Apex triggers, which run in the same save and can touch the same fields.
- Validation rules, which can block a flow's field update.
- Managed package automation, which you cannot edit but must account for.
- Workflow field updates that re-fire other rules, which causes chains.
Add a column for "other automation on this object" to your table. Chapter work on order of execution and consolidation depends on it.
Marking each item
Give every row one of four decisions.
| Decision | When to choose it |
|---|---|
| Retire | Inactive, or active but obsolete, with no one relying on it |
| Migrate as is | Simple and self-contained, a good candidate for the Migrate to Flow tool |
| Merge | Several items on one object with overlapping criteria |
| Rebuild | Uses actions with no direct equivalent, or is too tangled to convert mechanically |
Prioritizing the work
Sort your table by object, then by risk. Start with objects that have few items and simple actions. That builds confidence with the tooling before you reach heavily automated objects like Opportunity or Case, where many items must merge and order of execution matters most.
Common mistakes
- Treating the
FlowDefinitionViewresult as the full inventory. It omits Workflow Rules entirely. - Forgetting that
TableEnumOrIdcontains an ID for custom objects, so a group-by shows unreadable values. - Counting inactive items as work. They matter only if something might reactivate them.
- Ignoring time-dependent actions, because they sit in a separate section of the rule and are easy to miss when copying criteria.
- Skipping Apex triggers and existing flows when listing what runs on an object.
Exercise
You run the Workflow Rule query and see a row whose TableEnumOrId is a string of letters and numbers beginning with "01I" instead of an object name. What does this mean, and how do you get the object name?
Show answer
The rule belongs to a custom object, because Workflow Rules on custom objects store the object's ID in TableEnumOrId instead of its API name. Look the ID up by querying EntityDefinition and matching DurableId, or find the object in Setup, then record the readable name in your inventory table.
Exercise
Your table shows one object with three active Workflow Rules and two active processes, and one rule has a time-dependent action. Which decision label fits most likely, and what extra detail must you capture for the time-dependent action?
Show answer
Merge, since several items overlap on one object. For the time-dependent action, capture its offset and the date field it is relative to, such as "7 days after Close Date". You need both to build the matching scheduled path later.