# Java Records as Workflow Function Parameters

**URL:** <https://community.temporal.io/t/java-records-as-workflow-function-parameters/18041>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [July 28, 2025, 7:21pm UTC](https://community.temporal.io/t/java-records-as-workflow-function-parameters/18041 "2025-07-28T19:21:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samf](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@samf](https://community.temporal.io/u/samf)\
**Post date:** [July 28, 2025, 7:21pm UTC](https://community.temporal.io/t/java-records-as-workflow-function-parameters/18041/1 "2025-07-28T19:21:00Z")

</div>

I want to start a Workflow function with some parameters (one `String` and one `LocalDateTime`). I would like to encapsulate these parameters in a Java Record (which also implements `Serializable`), but when I try to invoke the Workflow Function via `WorkflowClient.start( () -> myWorkflow.myWorkflowFunction(myWorkflowParameters))`, “`myWorkflowParameters`” gets initialized as a new instance with `null` fields. Am I missing something here? Why isn’t `myWorkflowFunction` being called with the parameters I pass in, or at the very least a deep copy?

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [July 29, 2025, 4:56pm UTC](https://community.temporal.io/t/java-records-as-workflow-function-parameters/18041/2 "2025-07-29T16:56:53Z")

</div>

Hi @samf

you should be able to use a record type as a parameter object.

Could you share a small reproduction of the issue?

Antonio

---

<div class="post-metadata">

**Author:** ![samf](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@samf](https://community.temporal.io/u/samf)\
**Post date:** [August 1, 2025, 7:35pm UTC](https://community.temporal.io/t/java-records-as-workflow-function-parameters/18041/3 "2025-08-01T19:35:54Z")

</div>

Thanks for the reply. It was an issue with the serialization of some of the fields (I think because we provided a custom object mapper) and I solved it by adding @JsonProperty annotations
