Flows Best Practices Error Handling - Workflow Automation CoE
Import
·
Oct 24, 2022
·
article
Workflow Automation CoE > Flows > Best Practices > Error Handling and Debugging
Flows Best Practices Error Handling
For a detailed introduction into Error Handling, check out this article series and workflow academy video.
- Provide try/catch or flow catch logic to Flows to ensure graceful recovery of error.
- Your Flow can now include conditional logic based on action errors. You can either add an If logic on Action > Action Status > Code | Error Message, leverage the Flow Error Handler, or the Try Flow Logic, to create graceful handling of errors when they occur, including attempting to retry, pausing for input, etc.
- Reference Flow Error Handler
- Reference Action error evaluation
- Your Flow can now include conditional logic based on action errors. You can either add an If logic on Action > Action Status > Code | Error Message, leverage the Flow Error Handler, or the Try Flow Logic, to create graceful handling of errors when they occur, including attempting to retry, pausing for input, etc.
- Identify flow errors as they happen.
- Capture and push flow error information (e.g., notify process owner).
- Create a report or dashboard showing the state of your process.
- The Error Status object contains information about the action that produced an error. You can use this information to identify the cause of the error as well as record data that may need correction.
- Capture and push flow error information (e.g., notify process owner).
- Automate the resolution of flow errors.
- Run actions and subflows to remediate the error when possible.
- Optionally create a task for the process owner to take action for remediation or recovery.
- Run actions and subflows to remediate the error when possible.
- Author flows to never fail.
- Suppress action and subflow error messages.
- You can enable the Error Handler for a subflow to prevent its errors from cascading to a parent flow. Leaving the subflow Error Handler section empty ensures that it always generates the Completed (error caught) state.
- Suppress action and subflow error messages.
- Avoid adding error handling items to the main section of the flow.
- A flow normally stops running when an action or subflow returns an error in the main section.
- A stopped flow cannot run any actions or subflows past the point where it returned an error.
- Adding error handling actions and subflows to the Error Handler section ensures the error response occurs when there is an error.
- A flow normally stops running when an action or subflow returns an error in the main section.
- Create reusable action or subflow for handling errors.
- Rather than forcing an error-handling-process to fit within a 10-item limit (enforced limit of actions within the flow catch section), call a subflows that can contain many more items, and provide a response that your error logic leverages.
- Rather than recreate the same sequence of actions in multiple flows, create reusable subflows to correct errors to your record data. When a flow error leaves your record data in an undesired state, use subflows to correct these records. You can use the error handler to identify such record data as a subflow output.
- Rather than forcing an error-handling-process to fit within a 10-item limit (enforced limit of actions within the flow catch section), call a subflows that can contain many more items, and provide a response that your error logic leverages.
When things go wrong
- Review the logs in the related list on the sys_flow_context record.
- Logs from elsewhere in the platform are controlled by com.glide.hub.flow_engine.listener_trace.threshold (default: ERROR).
- Set it to WARN or INFO temporarily while troubleshooting and then reverting it back.
- Enable flow reporting on a per flow basis temporarily.
Center of Excellence Navigation
View original source
https://www.servicenow.com/community/workflow-automation-articles/flow-designer-best-practices-error-handling-workflow-automation/ta-p/2359989
Lisa Holenstein