From 738dcc443b2e3858e3f5defdfabd44849873e6fb Mon Sep 17 00:00:00 2001 From: maxdml Date: Thu, 13 Nov 2025 15:14:23 -0800 Subject: [PATCH] do not serializer again the json string --- dbos/conductor_protocol.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dbos/conductor_protocol.go b/dbos/conductor_protocol.go index 12b9eaa..ecde747 100644 --- a/dbos/conductor_protocol.go +++ b/dbos/conductor_protocol.go @@ -137,18 +137,16 @@ func formatListWorkflowsResponseBody(wf WorkflowStatus) listWorkflowsConductorRe } } - // Convert input/output to JSON strings if present + // input/output are already JSON strings if wf.Input != nil { - inputJSON, err := json.Marshal(wf.Input) - if err == nil { - inputStr := string(inputJSON) + inputStr, ok := wf.Input.(string) + if ok { output.Input = &inputStr } } if wf.Output != nil { - outputJSON, err := json.Marshal(wf.Output) - if err == nil { - outputStr := string(outputJSON) + outputStr, ok := wf.Output.(string) + if ok { output.Output = &outputStr } } @@ -249,11 +247,10 @@ func formatWorkflowStepsResponseBody(step StepInfo) workflowStepsConductorRespon FunctionName: step.StepName, } - // Convert output to JSON string if present + // output is already a JSON string if step.Output != nil { - outputJSON, err := json.Marshal(step.Output) - if err == nil { - outputStr := string(outputJSON) + outputStr, ok := step.Output.(string) + if ok { output.Output = &outputStr } }