diff --git a/hooks/hookexecution/execution.go b/hooks/hookexecution/execution.go index caaba59c3b..e03feaf842 100644 --- a/hooks/hookexecution/execution.go +++ b/hooks/hookexecution/execution.go @@ -71,6 +71,7 @@ func executeGroup[H any, P any]( for _, hook := range group.Hooks { mCtx := executionCtx.getModuleContext(hook.Module) + mCtx.HookImplCode = hook.Code newPayload := handleModuleActivities(hook.Code, executionCtx.activityControl, payload, executionCtx.account) wg.Add(1) go func(hw hooks.HookWrapper[H], moduleCtx hookstage.ModuleInvocationContext) { diff --git a/hooks/hookstage/invocation.go b/hooks/hookstage/invocation.go index 6408e8667d..5d94473c5a 100644 --- a/hooks/hookstage/invocation.go +++ b/hooks/hookstage/invocation.go @@ -27,6 +27,8 @@ type ModuleInvocationContext struct { Endpoint string // ModuleContext holds values that the module passes to itself from the previous stages. ModuleContext ModuleContext + // HookImplCode is the hook_impl_code for a module instance to differentiate between multiple hooks + HookImplCode string } // ModuleContext holds arbitrary data passed between module hooks at different stages.