diff --git a/backend/windmill-worker/src/pg_executor.rs b/backend/windmill-worker/src/pg_executor.rs index 55f5abea31..48fee2b267 100644 --- a/backend/windmill-worker/src/pg_executor.rs +++ b/backend/windmill-worker/src/pg_executor.rs @@ -583,6 +583,11 @@ fn convert_val( .unwrap_or(vec![]); Ok(Box::new(bytes)) } + Value::Object(_) if arg_t == "text" || arg_t == "varchar" => { + Ok(Box::new(serde_json::to_string(value).map_err(|err| { + Error::ExecutionErr(format!("Failed to convert JSON to text: {}", err)) + })?)) + } Value::Object(_) => Ok(Box::new(value.clone())), Value::String(s) => Ok(Box::new(s.clone())), _ => Err(Error::ExecutionErr(format!(