Open klesniewski opened 2 years ago
As a temporary solution, you can pass that context in the payload metadata from a PayloadConverter and read it (and delete it) in your PayloadCodec.
I hope we can get to this issue soon.
There's somewhat of a chicken-or-egg problem here. WorkflowInfo
and ActivityContext
both contains some fields that needs decoding/encoding. It would not makes sense therefore to make these objects directly accessible to the PayloadCodec.
Providing trimmed down context object, specific to PayloadCodec would however be reasonable. It may also be useful to include request headers there. And a logger.
As a temporary solution, you can pass that context in the payload metadata from a PayloadConverter and read it (and delete it) in your PayloadCodec.
I hope we can get to this issue soon.
How exactly is this possible with the Typescript SDK?
There's somewhat of a chicken-or-egg problem here.
WorkflowInfo
andActivityContext
both contains some fields that needs decoding/encoding. It would not makes sense therefore to make these objects directly accessible to the PayloadCodec.Providing trimmed down context object, specific to PayloadCodec would however be reasonable. It may also be useful to include request headers there. And a logger.
Is there a plan when this will be available? I need to pass tenant specific context from a workflow to a PayloadCodec.
👋 Hi just checking in here...is this something that is being considered? I'd love to have this in the Go SDK and be able to use workflow.Context
in my PayloadCodec
Is your feature request related to a problem? Please describe.
We have a codec that makes calls to an external service. As such, for various reasons encoding/decoding could fail. This will be retried and hopefully eventually works. However, we would like to see that failure in workflow/activity execution logs. This means we would like to attach for example
workflowId
to our logs, so that when we search for logs of particular workflow, we get to see these log messages.Unfortunately, I didn't find a way to get this information in codecs. I could only make it work when decoding (but not encoding) for an activity, as then (and only then)
Context.current()
works.We have this working in Go SDK through context-aware data converters, but I didn't find a way to make it work in TypeScript SDK.
Describe the solution you'd like
A way to access the activity/workflow execution metadata, so it can be added to logs. Information like:
Additional context
TS SDK version: 1.0.1