dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Allow(optionally) omit activity argument/input in the activity task scheduled event to save the storage cost #212

Open dhiaayachi opened 4 weeks ago

dhiaayachi commented 4 weeks ago

Is your feature request related to a problem? Please describe. The activity input is not really being used for replay. It's mainly for debugging(could be useful for cluster replication as well but can be eliminated/improved if designed properly).

Describe the solution you'd like Allow workflow to not include argument/input in the actiivty task scheudled event. Just like local activity options: https://github.com/temporalio/sdk-java/blob/806eab71f2b65f762cdd1c4079d3fbad0b62ae1d/temporal-sdk/src/main/java/io/temporal/activity/LocalActivityOptions.java#L58

Describe alternatives you've considered Using local activity could do that. However, local activity could run into sideffect when it has high failure rate -- the history will get blowed up with many timer events for retry management. (see https://community.temporal.io/t/local-activity-vs-activity/290/3 )

Additional context This needs server to support because the input is needed to pass to activity task, to activity worker.

dhiaayachi commented 2 weeks ago

Thanks for reporting this feature request!

This is a great suggestion and aligns with the goal of making Temporal more efficient.

Currently, there's no way to directly omit the input in activity task events, but you can use the workaround of local activities for this purpose.

We understand this workaround isn't ideal for large-scale workflows or complex scenarios. We'll keep this feature request in mind for future updates.

Please consider using local activities as an interim solution. Here's a link to the documentation: https://docs.temporal.io/activities#what-is-a-local-activity

dhiaayachi commented 2 weeks ago

Thanks for reporting this. This is a great feature request. You can achieve the desired behavior by using the LocalActivityOptions as you mentioned. However, you can also reduce the number of timer events in the history by using a custom retry policy with a larger initial interval, and a larger maximum interval.

You can find more information about retry policies here.

dhiaayachi commented 2 weeks ago

Thanks for the feature request. It's a great idea to make Temporal more efficient by optionally omitting activity input in scheduled events.

For now, you can use Local Activities to achieve this, as described in the "What is a Local Activity?" section of the Activities documentation: https://docs.temporal.io/activities#local-activity

While Local Activities offer performance advantages, keep in mind their limitations. They are best suited for short-lived, non-rate-limited activities within the same process as the workflow.