Prevent record saving when a condition is met

i have tried to put an ‘error’ step as it clearly states that it can prevent records saving but it never worked, any input regarding solving this issue or infos about the error step will be much appreciated !

It is most likely due to your workflow being “Deferred”. Execution flow details :: Corteza Docs
Since this only works on not “Deferred” workflows

Make sure you don’t use any prompts or delays in the workflow if you wish to use the error step to stop saving when using before(Create/Update) triggers.


Prompts are most likely the issue,
a workaround would be to replace the error step with a function that fetches the last created Record and then a function that deletes it

1 Like

@askar I’m not sure that would resolve anything since the before event is dispatched before the DB is altered – the delete would delete what was created before.

If you really want to go that way, you’d need a trigger for an after-create, and delete it from there (you’d probably need some status field in the module though).

Alternatives aside, I’d strongly recommend you try and refactor the workflow to not use any steps that would cause the workflow to become deferred.