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

Provide sample to show per workflow interceptor instead of global #489

Open
7 tasks
ktenzer opened this issue Jun 5, 2024 · 4 comments
Open
7 tasks

Provide sample to show per workflow interceptor instead of global #489

ktenzer opened this issue Jun 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ktenzer
Copy link

ktenzer commented Jun 5, 2024

Is your feature request related to a problem? Please describe.

Need to have different interceptor behavior per workflow

Describe the solution you'd like

Would like a clean option for having interceptor be per workflow. Currently its registered w/worker factory but the worker services multiple workflows so need option to apply interceptor to a workflow or subset of workflows.

Additional context

Per-SDK Tickets

  • Go -
  • [ X ] Java -
  • Core -
  • TypeScript -
  • Python -
  • .NET -
  • PHP -
  • Temporal CLI -
@ktenzer ktenzer added the enhancement New feature or request label Jun 5, 2024
@cretz
Copy link
Member

cretz commented Jun 5, 2024

The interceptor is meant to be an advanced flexible thing. If you want logic that only applies to certain namespaces, or certain task queues, or certain workflow types, or certain prefixed workflow IDs, or if only a certain header is present, or whatever, then you can add that condition in your interceptor. I do not think it's necessary to have this condition built in more than any other.

If a sample is needed to show how to only do something in an interceptor based on a certain condition, we can show that.

@cretz
Copy link
Member

cretz commented Jun 20, 2024

@ktenzer - can we close this since the interceptor is already flexible enough to have different logic per workflow type, task queue, namespace, workflow ID prefix, etc? Or do you feel it's important enough that we make a special case for workflow type different from the other discriminators?

@Quinn-With-Two-Ns Quinn-With-Two-Ns changed the title Provide option to have interceptor be per workflow instead of global including a sample Provide sample to show per workflow interceptor instead of global Jun 20, 2024
@Quinn-With-Two-Ns
Copy link
Contributor

I updated the title to just be create a sample

@ktenzer
Copy link
Author

ktenzer commented Jun 20, 2024 via email

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

3 participants