Handling Script Failures and Output in ControlUp Workflows: Error Ignoring, Conditional Logic, and Feature Updates
In a ControlUp workflow, users may want to handle script failures gracefully, akin to a "try-catch" mechanism seen in traditional programming. A user inquired about running an alternative action when a script run on a device fails. Currently, if the script fails, the workflow ends with an error, and no subsequent action is triggered automatically. The recommended approach is to use the "Ignore Error" option on the "Run Script" node, which prevents the workflow from stopping on error. Afterward, an "If Else" node can be added to check the status of the "Run Script" node and conditionally execute alternative actions based on success or failure. This method enables branching logic without halting the workflow.
A related challenge encountered was handling multiline output messages from scripts. The native ControlUp environment does not currently support converting multiline output into a single line with or without explicit newline characters such as "\n". The ControlUp team acknowledged this need and plans to introduce this string transformation functionality soon, with expectations for release within a week. While this feature is pending, custom scripting or intermediate handling outside ControlUp might be required to process multiline outputs.
Users also raised the idea of more advanced scripting capabilities within workflows, such as embedding secure, sandboxed JavaScript actions or subflows callable like functions. The team confirmed interest in this concept but noted that it is not currently on the immediate roadmap and will require future prioritization.
Finally, a limitation was noted: timeout errors from script execution (defaulting to 60 minutes) cannot be ignored by the "Ignore Error" setting; when a script times out, the workflow fails by design. The ControlUp team is investigating possible improvements to how timeouts are handled in workflows.
For now, users can implement error handling in workflows using the "Ignore Error" flag combined with conditional checks but should be aware of limitations around timeout errors and multiline output processing. Updates and added features are in development to enhance workflow flexibility and scripting capabilities. For more details on creating and managing workflows, users can visit the official ControlUp documentation at https://docs.controlup.com or the ControlUp Academy at https://cuacademy.controlup.com. Read the entire article here...
