Error Handling for Scheduled Workflows
When you create an asynchronous workflow task, if an error occurs during the processing of the workflow, NetSuite sends the error details to the owner of the workflow in an email. An error can be a user error or an internal SuiteFlow error. You can use the information in the email message to troubleshoot the workflow.
NetSuite sends an email message for errors that occur with the following types of scheduled workflow tasks:
-
Scheduled workflows
-
Scheduled actions
-
Delayed processing of subscribed records. For example, a workflow instance subscribes to a record using the Subscribe To Record action and the workflow instance triggers when a change occurs on the record. If a large number of subscribed records change, NetSuite may add the workflow instances to the workflow queue and trigger the workflow instances on the next run of the NetSuite scheduler. See Creating and Subscribing to a Record.
-
Execute Now feature which manually executes scheduled workflows
NetSuite also sends an email message when an error occurs when a record for a scheduled workflow is loaded or when the record is saved.
The following errors are possible for scheduled workflows:
-
Errors during workflow execution. For instance, a workflow creates a new record using the Create Record action, however the action doesn’t specify values for all required fields. The Create Record action consequently fails.
-
Infrastructure shutdown. During maintenance, scheduled tasks might be stopped. The tasks would finish processing the current record, but would be unable to process any more records until the next scheduled workflow execution. The records that were unable to be processed during the infrastructure downtime are reported as skipped.
In the case of any of the listed errors, NetSuite sends an email to the workflow owner to notify of the errors occurrence.
NetSuite sends the email with the workflow name in the subject line and the internal record ID and error message in the body of the email. For example, for an error with a workflow named ‘Expense Approval’ on a record with an ID of 123, the email appears with the following subject and body:
Subject: Workflow Failure: Expense Approval
Body: ID: 123 — End date must be after start date
The number of emails sent by NetSuite depends on the number of errors that occur. NetSuite sends an email for each of the first five errors in a workflow. If more than five errors occur, NetSuite waits until the workflow processing completes and then sends all errors, including the first five, in a single email message.