Subworkflow doesn't return output
See original GitHub issueHi!
I made a subworkflow to organize some variables and there isn’t an output but the workflow show the output correctly.
On my second screenshoot there is my last attempt in make it works, where I have set a hardcode variable.
Other subflows work fine but this one doesn’t. This sub/workflow only has lambda tasks.
{ "name": "FORK_VARIABLES", "taskReferenceName": "FORK_VARIABLES", "type": "FORK_JOIN", "forkTasks": [ [ { "name": "sumSF", "taskReferenceName": "sumSF", "type": "LAMBDA", "inputParameters": { "sf": "${workflow.input.sf}", "scriptExpression": "var r=0; for(var i=0; i<$.sf.length; i++) r += $.sf[i].amount; return r;" } } ], [ { "name": "sumIO", "taskReferenceName": "sumIO", "type": "LAMBDA", "inputParameters": { "io": "${workflow.input.io}", "scriptExpression": "var r=0; for(var i=0; i<$.io.length; i++) r += $.io[i].amount; return r;" } } ], [ { "name": "sumTX", "taskReferenceName": "sumTX", "type": "LAMBDA", "inputParameters": { "tx": "${workflow.input.tx}", "rfe": "${workflow.input.rfe}", "scriptExpression": "var r=0; for(var i=0; i<$.tx.length; i++) if ($.rfe == true && $.tx[i].taxType == 'TC') continue; else if ($.tx[i].status == 'On') r += $.tx[i].amount; return r;" } } ], [ { "name": "digitDocument", "taskReferenceName": "digitDocument", "type": "LAMBDA", "inputParameters": { "cpf": "${workflow.input.cpf}", "scriptExpression": "return $.cpf.charAt(5) + '' + $.cpf.charAt(6);" } } ], [ { "name": "financingProdutoApplied", "taskReferenceName": "financingProdutoApplied", "type": "LAMBDA", "inputParameters": { "input": "${workflow.input.financingProductId}", "dp": "${workflow.input.dp}", "scriptExpression": "var i = new String($.input); var v; for(var x=0;x<$.dp.length;x++) if ($.dp[x].name == 'Financing Product') v = $.dp[x].value; return (i != null && i.trim() != '' ? $.input : v)" } } ], [ { "name": "remuneracaoApplied", "taskReferenceName": "remuneracaoApplied", "type": "LAMBDA", "inputParameters": { "input": "${workflow.input.remuneration}", "dp": "${workflow.input.dp}", "scriptExpression": "var i = new String($.input); var v; for(var x=0;x<$.dp.length;x++) if ($.dp[x].name == 'Remuneration') v = $.dp[x].value; return (i != null && i.trim() != '' ? $.input : v)" } } ], [ { "name": "term", "taskReferenceName": "term", "type": "LAMBDA", "inputParameters": { "input": "${workflow.input.term}", "dp": "${workflow.input.dp}", "scriptExpression": "var i = new String($.input); var v; for(var x=0;x<$.dp.length;x++) if ($.dp[x].name == 'Term') v = $.dp[x].value; return (i != null && i.trim() != '' ? $.input : v)" } } ], [ { "name": "inputPercentApplied", "taskReferenceName": "inputPercentApplied", "type": "LAMBDA", "inputParameters": { "ia": "${workflow.input.ia}", "vv": "${workflow.input.vv}", "sumSF": "${sumSF.output.result}", "sumIO": "${sumIO.output.result}", "scriptExpression": "return $.ia / ($.vv + $.sumSF + $.sumIO);" } }, { "name": "inputAmountApplied", "taskReferenceName": "inputAmountApplied", "type": "LAMBDA", "inputParameters": { "ia": "${workflow.input.ia}", "ip": "${inputPercentApplied.output.result}", "vv": "${workflow.input.vv}", "sumSF": "${sumSF.output.result}", "sumIO": "${sumIO.output.result}", "scriptExpression": "return $.ip * ($.vv + $.sumSF + $.sumIO);" } }, { "name": "financedValueApplied", "taskReferenceName": "financedValueApplied", "type": "LAMBDA", "inputParameters": { "vv": "${workflow.input.vv}", "iap": "${inputAmountApplied.output.result}", "sumSF": "${sumSF.output.result}", "sumIO": "${sumIO.output.result}", "sumTX": "${sumTX.output.result}", "scriptExpression": "return ($.vv + $.sumSF + $.sumIO + $.sumTX) - $.iap;" } } ] ] }, { "name": "JOIN_VARIABLES", "taskReferenceName": "JOIN_VARIABLES", "type": "JOIN", "joinOn": [ "digitDocument", "financingProdutoApplied", "remuneracaoApplied", "term", "financedValueApplied", "sumSF", "sumIO", "sumTX" ] }
Subworkflow without output
Workflow with output
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Hi ,
I have fixed the issue and raised the PR https://github.com/Netflix/conductor/pull/1984 .
@btafarelo @kishorebanala @pweatherby-ccctc
Closing since #1984 is merged