-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add ability to raise exception in flow action #489
Comments
@isidle thanks for adding this idea! I think it'd be fairly easy to add this functionality into the Flow invocable methods - I'll do some additional analysis this week to see if there are any issues, but I'm hopeful that this will be a fairly easy enhancement to make. |
That would be a nice addition, as today I always configure an 'Exception Thrower' invocable class in my fault branch for that purpose. It the fault could be thrown by the Nebula invocable that would be less clutter. |
@jongpie I was investigating how to implement this, and I have a rough idea of how to make it available for the log methods in flow, but I think there's a challenge setting the Savepoint to do a rollback from Apex. Rollback the entire set of transactions in Flow is also difficult with the standard rollback records flow component because this one will only roll back the latest pending transactions, not the ones already executed. If you know how to do the rollback in the DB, I can help implement this! |
Calling an exception The only time you'd need a savepoint is if they were running both synchronous and asynchronous logic and wanting to unwind to the very start of everything but at that point the onus is on the dev to handle that as there is no way for nebula to know which transaction they wanted to roll back to. |
@JMercie sorry for the late response! If you're still interested in contributing, I'd be happy to review any code changes you make. If not, no worries, I can work on this sometime in the coming weeks. And I agree with @isidle - just throwing an exception (after saving any pending log entries, using |
@isidle and @JeroenSfdc, I've just finished publishing the new release that includes this functionality - it's now available in |
When a record triggered flow runs an fault path, the execution continues instead of raising an exception & rolling back database changes.
This is particularly problematic for record triggered flows, as everything could end up in an incomplete state.
Add an optional boolean to the attributes and when true, call an exception passing the value of faultmessage.
Otherwise would need to create a separate invokable action in order to raise the exception and unwind the transaction.
The text was updated successfully, but these errors were encountered: