I am launching a flow from APEX and I want to pass it a list of IDs. The issue that I am coming across right now is that I will need to look up each ID in the flow because there is no "IN" clause for getting records inside a flow.
The reason why I am launching the flow is that:
- I want our Admin to be able to really have control over the nuts and bolts over the code.
We need to launch the flow asynchronously because it requires some extra processing that I was resulting in the following error:
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record
Unfortunately, as far as I am concerned there is no way currently to launch flows in an asynchronous context. So what I am doing is developing a method that fires in the "AFTER INSERT" context of the trigger and calls a future method that will call the flow. As stated above, I am just concerned that passing in a collection of IDs will result in a massive amount of SOQL Calls, which will ultimately cause me to hit governor limits.