I ran a test using .toJSON(), loading the content into a setValue before sending it to the 'Document' field of the module, but even though it shows the conversion of the JSON object to JSON text in the console, it doesn't load the text into the field.
Console
server-connect:app Executing action step setvalue +3ms
server-connect:app options: { value: '{{venda.toJSON()}}' } +0ms
server-connect:output venda_json: '{"ide":{"cUF":"35","natOp":"VENDA DE MERCADORIA","mod":"65","serie":"99","dhEmi":"","tpNF":"1","idDest":"1","cMunFG":"3502101","tpImp":"4","tpEmis":"1","tpAmb":"2","finNFe":"1","indFinal":"1","indPres":"1","procEmi":"0","verProc":"TAJ_API_NFE 1.0"},"emit":{"CNPJ":"17953171000138","xNome":"EMPRESA TESTE LTDA","xFant":"EMPRESA TESTE","enderEmit":{"xLgr":"Rua Paraiba","nro":"492","xCpl":"Sala C","xBairro":"Benfica","cMun":"3502101","xMun":"ANDRADINA","UF":"SP","CEP":"16900406","cPais":"1058","xPais":"BRASIL","fone":"1837221552"},"IE":"170059050117","IM":"","CRT":"4"},"det_list":[{"$":{"nItem":"1"},"prod":{"cProd":"003","cEAN":"SEM GTIN","xProd":"PRODUTO TESTE 3","NCM":"22030000","CFOP":"5102","uCom":"UN","qCom":"3.0000","vUnCom":"30.00","vProd":"90.00","cEANTrib":"SEM GTIN","uTrib":"UN","qTrib":"3.0000","vUnTrib":"30.00","indTot":"1"},"imposto":{"vTotTrib":0,"ICMS":{"ICMSSN102":{"orig":"0","CSOSN":"102"}},"PIS":{"PISOutr":{"CST":"99","vBC":0,"pPIS":0,"vPIS":0}},"COFINS":{"COFINSOutr":{"CST":"99","vBC":0,"pCOFINS":0,"vCOFINS":0}}}},{"$":{"nItem":"2"},"prod":{"cProd":"003","cEAN":"SEM GTIN","xProd":"PRODUTO TESTE 3","NCM":"22030000","CFOP":"5102","uCom":"UN","qCom":"3.0000","vUnCom":"30.00","vProd":"90.00","cEANTrib":"SEM GTIN","uTrib":"UN","qTrib":"3.0000","vUnTrib":"30.00","indTot":"1"},"imposto":{"vTotTrib":0,"ICMS":{"ICMSSN102":{"orig":"0","CSOSN":"102"}},"PIS":{"PISOutr":{"CST":"99","vBC":0,"pPIS":0,"vPIS":0}},"COFINS":{"COFINSOutr":{"CST":"99","vBC":0,"pCOFINS":0,"vCOFINS":0}}}},{"$":{"nItem":"3"},"prod":{"cProd":"003","cEAN":"SEM GTIN","xProd":"PRODUTO TESTE 3","NCM":"22030000","CFOP":"5102","uCom":"UN","qCom":"3.0000","vUnCom":"30.00","vProd":"90.00","cEANTrib":"SEM GTIN","uTrib":"UN","qTrib":"3.0000","vUnTrib":"30.00","indTot":"1"},"imposto":{"vTotTrib":0,"ICMS":{"ICMSSN102":{"orig":"0","CSOSN":"102"}},"PIS":{"PISOutr":{"CST":"99","vBC":0,"pPIS":0,"vPIS":0}},"COFINS":{"COFINSOutr":{"CST":"99","vBC":0,"pCOFINS":0,"vCOFINS":0}}}}],"total":{"ICMSTot":{"vBC":"0.00","vICMS":"0.00","vICMSDeson":"0.00","vFCP":"0.00","vBCST":"0.00","vST":"0.00","vFCPST":"0.00","vFCPSTRet":"0.00","vProd":"100.00","vFrete":"0.00","vSeg":"0.00","vDesc":"0.00","vII":"0.00","vIPI":"0.00","vIPIDevol":"0.00","vPIS":"0.00","vCOFINS":"0.00","vOutro":"0.00","vNF":"100.00"}},"transp":{"modFrete":"9"},"pag":{"detPag":[{"indPag":"0","tPag":"01","vPag":"100.00"}],"vTroco":"0"},"infAdic":{"infCpl":"DOCUMENTO EMITIDO EM AMBIENTE DE HOMOLOGACAO","infAdFisco":""}}' +3ms
server-connect:app Executing action step wait +3ms
server-connect:app options: { delay: 2000 } +0ms
server-connect:output wait: undefined +2s
server-connect:app Executing action step nfeEmitir +3s
server-connect:app options: {
server-connect:app certPath: '/app/upload_privado/1.pfx',
server-connect:app certPassword: 123456,
server-connect:app idCSC: '000001',
server-connect:app CSC: 'd6887227-f5fb-40df-938a-3ee5992caf68',
server-connect:app geral: '{\n "versao": "4.00",\n "ambiente": "2",\n "modelo": "65"\n}',
server-connect:app documento: '{{venda_json}}'
server-connect:app } +1ms
server-connect:output Error at venda: Error: JSON inválido em "documento". Erro: Expected property name or '}' in JSON at position 1
server-connect:output at safeJsonParse (/opt/node_app/extensions/server_connect/modules/nfeEmitir.js:68:13)
server-connect:output at App.nfeEmitir (/opt/node_app/extensions/server_connect/modules/nfeEmitir.js:359:24)
server-connect:output at App._exec (/opt/node_app/lib/core/app.js:760:49)
server-connect:output at App._exec (/opt/node_app/lib/core/app.js:726:20)
server-connect:output at async App.exec (/opt/node_app/lib/core/app.js:692:5)
server-connect:output at async App.define (/opt/node_app/lib/core/app.js:674:5) +526ms
Error: JSON inválido em "documento". Erro: Expected property name or '}' in JSON at position 1
at safeJsonParse (/opt/node_app/extensions/server_connect/modules/nfeEmitir.js:68:13)