8000 Support dynamic activity and workflow implementations · Issue #543 · temporalio/sdk-go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support dynamic activity and workflow implementations #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aschrijver opened this issue Sep 21, 2021 · 8 comments · Fixed by #1946
Closed

Support dynamic activity and workflow implementations #543

aschrijver opened this issue Sep 21, 2021 · 8 comments · Fixed by #1946
Labels
enhancement New feature or request

Comments

@aschrijver
Copy link

Is your feature request related to a problem? Please describe.
In some cases, activity and workflow implementations should be loaded dynamically.

Describe the solution you'd like
Expose an extension point for dynamic activity loading. This issue is created to ensure feature parity among SDK's where temporalio/sdk-java#245 already implements this for Java.

Additional context
In Dynamic activities registration at runtime and worker splitting on the community forum @mfateev requested another user to create this issue, but that never happened AFAIK. Hence this issue.

@zhyg
Copy link
zhyg commented Apr 27, 2022

Hi, is there some progress?

@cretz
Copy link
Member
cretz commented Apr 27, 2022

We have not prioritized this because there haven't been many requests. Are you needing dynamic activity/workflow support? In almost all cases, a properly named/registered activity/workflow should be used and field in the parameter can be provided to take different paths. Can you describe your use case (here or in Slack or in forum)?

@nb950
Copy link
nb950 commented May 23, 2022

@cretz can you share an example of what you describe ?

@cretz
Copy link
Member
cretz commented May 23, 2022

Something like:

func FallthroughWorkflow(ctx workflow.Context) error {
  workflow.GetLogger(ctx).Info("Called workflow: " + workflow.GetInfo(ctx).WorkflowType.Name)
}

func FallthroughActivity(ctx context.Context) error {
  activity.GetLogger(ctx).Info("Called activity: " + activity.GetInfo(ctx).ActivityType.Name)
}

func Register(worker worker.Worker) error {
  worker.RegisterWorkflowWithOptions(FallthroughWorkflow, workflow.RegisterOptions{Dynamic: true})
  worker.RegisterActivityWithOptions(FallthroughActivity, activity.RegisterOptions{Dynamic: true})
}

So basically that workflow or activity is called when one for the specific name is not found.

@k-jay-c
Copy link
k-jay-c commented Jul 26, 2022

Hi,

We are also looking at support for dynamic activity registration for Go. Would be great if you can provide some ETA?

Thanks,
Jay.

@cretz
Copy link
Member
cretz commented Jan 5, 2023

I think we need to do the workflow.RegisterOptions{Dynamic: true}/activity.RegisterOptions{Dynamic: true} and we need to require that the function signature accept a string name and a slice of converter.EncodedValue values.

@Abdullah-AlAttar
Copy link

Any updates on this ?

@cretz
Copy link
Member
cretz commented Oct 15, 2024

No updates. If you can, we strongly recommend using explicit activities/workflows and using activity/workflow input to decide what to do inside the body instead of dynamic even when dynamic is available. But it is understood in some use cases like DSLs and such that dynamic is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
0