Skip to content
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

[Feature Request] Some kind of registry for workflows and activities to get classes/function with their names #659

Open
funkindy opened this issue Oct 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@funkindy
Copy link

funkindy commented Oct 7, 2024

I'd like to instantiate a worker instance with CLI wrapper. In this scenario i can only provide workflow names and activity names as strings.

It would be nice to have an SDK option to get python objects with this names or even to instantiate Worker with lists of strings directly. Maybe register types somewhere in *.defn.

Whats your opinion?

@funkindy funkindy added the enhancement New feature or request label Oct 7, 2024
@cretz
Copy link
Member

cretz commented Oct 7, 2024

We try not to assume global use of workflows/activities in the SDK. Many users create many workflows/activities and only start some of them in some workers and others in other workers (some may even have the same name). I would recommend maintaining a dict of workflows/activities if you need a form of global lookup. This can be done with a custom decorator if needed.

@funkindy
Copy link
Author

funkindy commented Oct 7, 2024

I see, thank you. Maybe you have a recipe for production deployment of workers?

We are looking for deploying pods with workers with some text based configuration (e.g. environment variables)

Thank you

@cretz
Copy link
Member

cretz commented Oct 7, 2024

We do not have a specific recipe. You can have a simple Python script that reads environment variables and builds the sets of workflows/activities based on what those values are (e.g. a dict lookup), but most people hardcode the sets of workflows/activities to a task queue because every worker on a task queue needs to have the same set of workflows/activities, so it often doesn't make much sense to have that be configurable at runtime.

(also feel free to join us on the forums or Slack if that's an easier way for you to discuss)

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

No branches or pull requests

2 participants