What are the Best Practices for Using $return_value and $.export() in Workflow Development to Avoid Out-of-memory Errors?

This topic was automatically generated from Slack. You can find the original thread here.

Anyone have any best practices for developing components on when to use $return_value and when to use $.export()? I’m getting workflow Out-of-memory errors. I have a somewhat complex 9 step workflow with no branching. I could make it split into subworkflows or raise the memory limits, but I’m seeing what I can do to reduce the unnecessary logging and exports for each step first.

Also looking to find a way to gauge how much memory each step is using, if possible. Or log at least how much memory is being used at various points in the workflow, if possible. Anyone have any advice?

Reposting this for visibility – please help! need advice.

Anyone have any best practices for developing components on when to use $return_value and when to use $.export()? I’m getting workflow Out-of-memory errors. I have a somewhat complex 9 step workflow with no branching. I could make it split into subworkflows or raise the memory limits, but I’m seeing what I can do to reduce the unnecessary logging and exports for each step first.

Also looking to find a way to gauge how much memory each step is using, if possible. Or log at least how much memory is being used at various points in the workflow, if possible. Anyone have any advice?

Hey , I think $return_value and $.export() are basically the same thing. I wouldn’t recommend deepdive into them too much.

About the memory improvement, I think Thomas Frank has a great post here that explain his experience to optimize memory usage. Could you take a look?

yes-- thank you so much

great resource. thanks leo!!!