You are able to implement your own Record Selection method.
For example if you need some special filter or have an external system, you want to use to filter.
Create a file <customname>.inc.php in the folder modules/Workflow2/extends/recordsource/
This file must include a Class, which extends from WorkflowRecordSource.
You must implement the following structure to be recognized by Workflow Designer:
[prism field=code1 language=php]
(You found this example source within example.php in recordsource folder, too)
Your getQueries function should return the column crmid, which is the ID of the Record, which match.
AND: You must add
/* Insert Fields */
in your Query, on the place, where the module could optionally add more columns from target module. (That’s why it is important to respect the $includeAllModTables column or ignore and add all tables in every case)