Sub topic 4
Inventorying what you have
This chapter assumes you can open the Developer Console, write basic SOQL, and have read the previous chapters on how Workflow Rules and Process Builder processes are built. Use a sandbox or Developer Edition org that mirrors production.
Why inventory first
A migration plan needs a list of what exists. Without one, you will miss automations, convert the same logic twice, or leave an old rule firing next to its new flow. The inventory also shows which objects have the most automation, so you know where consolidation matters most.
Where each tool stores its definitions
Process Builder processes are stored as flow definitions with the process type Workflow. Workflow Rules are stored as separate WorkflowRule records. Because they live in different places, you need two queries.
Query the Process Builder processes
Run this in the Developer Console Query Editor with Use Tooling API checked.
SELECT ApiName, Label, ProcessType, IsActive
FROM FlowDefinitionView
WHERE ProcessType = 'Workflow' AND IsActive = trueEach row is an active process. Inactive processes are not firing, so you can usually leave them out of scope. Remove the IsActive filter if you want to find old ones to delete.
Query the Workflow Rules
Run this one through the Tooling API as well.
SELECT Id, Name, TableEnumOrId
FROM WorkflowRuleTableEnumOrId names the object the rule belongs to. For standard objects it is the API name, such as Opportunity. For custom objects it is an object ID, so you may need to look up the name.
Build the spreadsheet
Export both result sets into one sheet. Add these columns by opening each item in Setup:
| Column | What to record |
|---|---|
| Object | The object the automation runs on |
| Type | Workflow Rule or Process Builder |
| Trigger | Create only, or create and edit |
| Criteria | The formula or conditions, copied as written |
| Actions | Field updates, emails, tasks, Apex, and so on |
| Timing | Immediate or time-dependent, with the offset |
| Owner and notes | Who understands the business reason |
Then sort by object. Two or more rows on the same object are candidates for one consolidated flow, which a later chapter covers.
Common errors
- Forgetting the Tooling API checkbox. The queries fail with an object-not-found error without it.
- Counting only active processes. A process can have several versions. Only one is active, so check that you are reading the active version.
- Missing hidden automation. Apex triggers and existing flows also run on the same objects. Note them in the sheet, since they affect order of execution later.
- Copying criteria loosely. Paste formulas exactly. Small details such as
ISPICKVALorISCHANGEDchange how you translate them.
Exercise
You find three Workflow Rules and one active Process Builder process on Opportunity. What should the inventory help you decide before you build any flows?
Show answer
Whether to consolidate them into one record-triggered flow for Opportunity. The sheet shows their criteria, actions, and timing together, so you can spot overlaps and conflicts, and any of the four that can be retired.