Lightning Process Builder has been around a while now and I think that we’re all starting to get use to it and see it’s potential; it’s massive.

There are of course a few teething problems, as you would expect, and they have mostly been documented but I just wanted to add to the list. Not as a complaint, more as a warning.

I’ll admit it isn’t going effect a lot of people but I still think it’s an important thing to be aware of. The crux of the issue is that the Process Builder doesn’t take note of the @deprecated annotation. This means if you have a class that contains an @invocableMethod and you mark it as @deprecated it will still appear in the dropdown of available classes when you select Apex for your action.

Here’s a simple example. Take this class, it existed in version 1.0 of my package and then in version 2.0 I marked it as @deprecated like so:

If we now package that up in a managed package and install it into another org we see the following:

My installed package:
Screenshot 2015-04-24 10.34.33

No class listed here as it’s deprecated:
Screenshot 2015-04-24 10.38.32

Yet in Process Builder you can still see the class:
Screenshot 2015-04-24 10.39.29

As you can see this method is available to me and I can quite happily save the process and it will also run. This is version 2.0 of the package if you want to try it yourselves.

This is obviously going to be problematic – the invocable actions obviously need to be global, otherwise they’d be locked up in the package and unavailable to users. However if they are going to be global and we need to make changes as our offerings grow and change then we are going to have to make use of the well established @deprecated annotation. I have no doubt that Salesforce will work to fix this, I already have a case open with them… it’s just a question of how long will we have to wait?

I really think that invocable actions in Process Builder are the way forward, exposing complex apex based actions and logic declaratively is a massive massive win. Just be aware that in the short term you’re going to have to get your method signatures right the first time and be prepared not to update them.