You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to be able to use async operations inside of Update Validators.
Use Case
I need to check complex access controls via a database query (e.g. state of an object in the database; ACL/ABAC/etc), and return an error to the caller if not allowed.
Describe the solution you'd like
Asynchronous Update Validators.
Additional context
While the Temporal documentation is fairly clear that Validators must be synchronous, there still seems to be a reasonable expectation that any and everything can be async, as demonstrated by this line in the temporalio/samples-typescript repo. I originally copied this pattern before discovering that Temporal treats async validators as though they are Activities, i.e. logging them to the Workflow Event History and not returning errors to the caller. (So if this feature request is rejected, that code should at least be updated so as not to be misleading.)
Alternatives
I can convert my access control validators (or anything else that requires async logic) to Activities and call them from their respective Update handlers. However, this will litter the Workflow Event History with largely irrelevant information, and will also require additional logic to poll the Workflow for the result of the access control Activity to see if the Update was even allowed.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I would like to be able to use async operations inside of Update Validators.
Use Case
I need to check complex access controls via a database query (e.g. state of an object in the database; ACL/ABAC/etc), and return an error to the caller if not allowed.
Describe the solution you'd like
Asynchronous Update Validators.
Additional context
While the Temporal documentation is fairly clear that Validators must be synchronous, there still seems to be a reasonable expectation that any and everything can be async, as demonstrated by this line in the temporalio/samples-typescript repo. I originally copied this pattern before discovering that Temporal treats async validators as though they are Activities, i.e. logging them to the Workflow Event History and not returning errors to the caller. (So if this feature request is rejected, that code should at least be updated so as not to be misleading.)
Alternatives
I can convert my access control validators (or anything else that requires async logic) to Activities and call them from their respective Update handlers. However, this will litter the Workflow Event History with largely irrelevant information, and will also require additional logic to poll the Workflow for the result of the access control Activity to see if the Update was even allowed.
The text was updated successfully, but these errors were encountered: