0

I've created an invocable apex action to be used in the flow builder. When the flow runs, is there a way for me to get the flow interview id in my invocable apex method?

I don't want the user to pass it as a parameter to the invocable action

1
  • Why hide the usage of the variables from the flow? IMHO it would (if it is possible) make the invocable method more fragile, harder to use and make flow setup to use it more mysterious and problematic. All in all a bad idea, like using global variables in code, again IMHO. Pass the values as parameters.
    – Phil W
    Commented May 26, 2023 at 6:11

1 Answer 1

0

Invocable apex actions can be called from not just flows, they can, for example, be called from the Actions REST API

  • Thus, the flow interview Id would not be available as "context"

  • Invocable actions should have a defined signature and not assume where they are called from

  • In general, they should be bulkified and if intended only for screen flows, have error checks to throw exceptions if called with more than 1 request.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .