Workflow Filter Tool

Workflow Filter is a Python based utility which allows Salesforce Admins to search for workflow rules based on the following criteria:

  • Object Name: The object on which the workflow operates
  • Trigger Type: Workflow evaluation criteria
  • Action Type:  Workflow type

To use Workflow Filter, download the following files from Github and place them in the same folder:

  • sfdc.py
  • sfdc.yaml
  • All files from workflow_filter folder

Depending on your work environment, you may need to install the following Python dependencies:

Once your environment is ready, you will need to configure your SFDC connection settings. To do that, open sfdc.yaml and edit the following fields:

  • user: your Salesforce login
  • password: your password
  • token: security token
  • (optional) sandbox: set to true if working on a sandbox instance

sfdc.yaml_config

The next step is to define your filter criteria. To do that, open workflow_filter.yaml and edit any of the fields:

  • object_name: Name of a Salesforce object (e.g. Account, Lead, My_Custom_Object__c)
  • trigger_type:
    • onCreateOrTriggeringUpdate (Evaluate the rule when a record is created and anytime is edited to meet criteria)
    • onCreateOnly (Evaluate the rule when created)
    • onAllChanges (Evaluate then rule when created and every time it’s edited)
  • action_type:
    • Alert
    • FieldUpdate
    • OutboundMessage
    • Task

For example, if you want to get all workflow rules that operate on the Account object and are of action type Alert, your configuration file will look like this:

workflow.yaml file

All filters criteria are optional, i.e. if you don’t provide any, you’ll get ALL workflow rules. To run Workflow Filter, make sure both sfdc.yaml and workflow_filter.yaml are in the same folder as the Python script, and then in your command line type the following:

python workflow_filter.py

tool in progress

Upon completion, Workflow Filter saves the results in workflows.txt in the same folder it was executed from. If you intend on running the tool multiple times, make sure to copy the output file as will be overwritten each execution.

workflow result

Link to Github tools: https://github.com/ysfdc/salesforce_scripts