diff --git a/core/tasks/handler/worker.go b/core/tasks/handler/worker.go index a9c21afb3..372bcb121 100644 --- a/core/tasks/handler/worker.go +++ b/core/tasks/handler/worker.go @@ -611,6 +611,19 @@ func handleMsgEvent(ctx context.Context, rt *runtime.Runtime, event *MsgEvent) e } msgIn.SetOrder(order) } + mdValue, ok = metadata["nfm_reply"] + if ok { + var nfmReply *flows.NFMReply + asJSON, err := json.Marshal(mdValue) + if err != nil { + log.WithError(err).Error("unable to marshal metadata from msg event") + } + err = json.Unmarshal(asJSON, &nfmReply) + if err != nil { + log.WithError(err).Error("unable to unmarshal orderJSON from metadata[\"nfm_reply\"]") + } + msgIn.SetNFMReply(nfmReply) + } } // build our hook to mark a flow message as handled diff --git a/go.mod b/go.mod index e2383d252..6ef6a0bef 100644 --- a/go.mod +++ b/go.mod @@ -70,4 +70,4 @@ go 1.17 replace github.com/nyaruka/gocommon => github.com/Ilhasoft/gocommon v1.16.2-weni -replace github.com/nyaruka/goflow => github.com/weni-ai/goflow v0.6.0-goflow-0.144.3 +replace github.com/nyaruka/goflow => github.com/weni-ai/goflow v0.6.1-goflow-0.144.3 diff --git a/go.sum b/go.sum index b6b4aba2d..4f2344d50 100644 --- a/go.sum +++ b/go.sum @@ -204,8 +204,8 @@ github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLD github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= -github.com/weni-ai/goflow v0.6.0-goflow-0.144.3 h1:SalpB3qAqFvZkp0lsHkSJLnr6FbuKf0sivOGkfSHbk8= -github.com/weni-ai/goflow v0.6.0-goflow-0.144.3/go.mod h1:o0xaVWP9qNcauBSlcNLa79Fm2oCPV+BDpheFRa/D40c= +github.com/weni-ai/goflow v0.6.1-goflow-0.144.3 h1:atjqcL3B/J6KPFITHd+Hf1Gvi3ZXs8myOWCvJphriIE= +github.com/weni-ai/goflow v0.6.1-goflow-0.144.3/go.mod h1:o0xaVWP9qNcauBSlcNLa79Fm2oCPV+BDpheFRa/D40c= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=