# Validation of incoming workflow arguments

**URL:** https://community.temporal.io/t/validation-of-incoming-workflow-arguments/2935
**Category:** Community Support
**Tags:** java-sdk
**Created:** [September 15, 2021, 2:53pm UTC](https://community.temporal.io/t/validation-of-incoming-workflow-arguments/2935 "2021-09-15T14:53:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sdonovan](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sdonovan](https://community.temporal.io/u/sdonovan)
#### Post date: [September 15, 2021, 2:53pm UTC](https://community.temporal.io/t/validation-of-incoming-workflow-arguments/2935/1 "2021-09-15T14:53:23Z")

</div>

Greetings. I am thinking about how to expose Temporal workflow definitions as internal-APIs.

An aspect of that is validation. As payloads into the Java SDK are processed, they’ll flow through the `DataConverter` implementations. In Java-world, obviously, validation is typically performed with `javax.validation` annotations (JSR-303/330, etc.). Where’s the best place to mandate/force validation for all incoming payloads/arguments? I considered an interceptor, though I’m not sure they’re designed to handle errors (e.g. throwing instances of `TemporalFailure` – I get weird behaviour if I try). Another idea might be to wrap the existing `DataConverter` instances to trigger validation after de-serialization. Or, we have to code it directly into the workflow implementations.

Any suggestions would be welcome. Thanks!

---

<div class="post-metadata">

### Author: ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)
#### Post date: [September 15, 2021, 3:47pm UTC](https://community.temporal.io/t/validation-of-incoming-workflow-arguments/2935/2 "2021-09-15T15:47:57Z")

</div>

In my opinion if validation is part of your requirements (input values determine control flow logic) then it should be part of your workflow impl. Otherwise in your internal APIs that I assume use the Temporal SDK client apis you could do custom validation before starting a workflow execution.
