Workflow / activity middleware

Is there an equivalent of a middleware for workflow, and/or activity execution in the Go SDK?

The use-case here is to have some quick instrumentation around the execution of a workflow and/or activity, e.g. logging, custom metrics, error / exception tracking, etc.

1 Like

We don’t have a notion of lifecycle hooks in the system. As of today I think the most straightforward solution would be to code some small shims that wrap this behavior. Adding @maxim to make sure i’m not missing anything.

Go SDK supports workflow interceptors. Activity interceptors are not yet supported, but planned.

I have a use case where I need to send business events every time I enter/exit an activity, which is similar to the use case described above. Would you recommend implementing these as separate activities until activity interceptors become available?