question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subworkflow doesn't return output

See original GitHub issue

Hi!

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 image

Workflow with output image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sukruthiarjulacommented, Nov 24, 2020
0reactions
apanicker-nflxcommented, Dec 8, 2020

Closing since #1984 is merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get a subflow return value - ServiceNow Community
In the workflow activity where I call subflow 'B', I set the 'Map return value' to a variable that I created, called 'subflow_result'....
Read more >
How can I get sub workflow steps/tasks output? - Stack Overflow
When I ref this template, I don't know how can I get the output from cluster workflow task/step. Cluster Workflow Template apiVersion: argoproj....
Read more >
After An Error Executing A Step From A Sub Workflow The ...
... A Sub Workflow The Workflow Output Properties Are Not Set When Return. ... workflow will not have any output process property set...
Read more >
Is the sub workflow can be waiting return specific result in ...
Can I just active the workflow1 in this workflow, and don't go to the next node(Merge) until the workflow1 returns specific results.
Read more >
Solved: Inbound population on sub workflows
you will get some XML as an output, now what you need to do is to ... in itself doesn't have a schema...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found