Home > Forum > Actions > Throw error in action on path

Throw error in action on path
0

Hi community!

We are getting some data from external system via REST API.

Specifically workflow elements are created and there is a default path for saving workflow element. This can be easily done with the well known POST endpoint:

/api/data/v4.0/db/{dbId}/elements

Now we are facing the challenge to check if there are already elements in our system, to avoid duplicates. This can also easily be done with an integrated SQL query like Select Count() from WFElements WHERE ...

So we need to cancel save operation if this condition is met. Since it is a fresh workflow element it should not be persisted in database.

Unfortunately I do not find any option to throw an error in an automation or at least I don't see it ;-)

Any hints/suggestions on that?

Thanks a lot & best regards, Nik