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] Access to workflow/activity instance from context #388

Closed
cretz opened this issue Jan 7, 2025 · 0 comments · Fixed by #393
Closed

[Feature Request] Access to workflow/activity instance from context #388

cretz opened this issue Jan 7, 2025 · 0 comments · Fixed by #393
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Jan 7, 2025

Describe the solution you'd like

The created instance of the workflow class should be made available as Workflow.Instance static property.

Also, in Temporalio.Extensions.Hosting where we create and control the lifetime of the activity instance, the instance should be made available in ActivityExecutionContext.Instance instance property. This is probably best as an extension method on that class and it is understood to only be as available as the execution context itself is (i.e. async local, may not traverse threads).

See temporalio/features#572.

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.

1 participant