# How can I externalise the retry options and activity options in workflow?

**URL:** <https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [November 17, 2023, 2:40am UTC](https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129 "2023-11-17T02:40:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sakshi\_Patil](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sakshi_patil/32/4293_2.png) [@Sakshi\_Patil](https://community.temporal.io/u/Sakshi_Patil)\
**Post date:** [November 17, 2023, 2:40am UTC](https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129/1 "2023-11-17T02:40:28Z")

</div>

My project is in java-springboot. I want to externalise activity options while creating stub for activity in workflow. There are multiple activities and retry options for all will be different.

I tried using @RequiredArgsConstructor and injecting the config file which gets initialised from yml file but this makes the workflow un-deterministic and hence threw an error.

How can i achieve this?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [November 17, 2023, 2:57am UTC](https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129/2 "2023-11-17T02:57:13Z")

</div>

You can specify activity options when registering workflow with the worker.

```auto
    worker.registerWorkflowImplementationTypes(
        WorkflowImplementationOptions.newBuilder().setActivityOptions(options).build(),
        MyWorkflow.class);

```

---

<div class="post-metadata">

**Author:** ![Sakshi\_Patil](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sakshi_patil/32/4293_2.png) [@Sakshi\_Patil](https://community.temporal.io/u/Sakshi_Patil)\
**Post date:** [December 5, 2023, 3:05am UTC](https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129/3 "2023-12-05T03:05:23Z")

</div>

I want to read options dynamically from config. how can i achieve that?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [December 5, 2023, 4:38pm UTC](https://community.temporal.io/t/how-can-i-externalise-the-retry-options-and-activity-options-in-workflow/10129/4 "2023-12-05T16:38:54Z")

</div>

What do you mean by “dynamically”?
