Workflow Action: Reprocess
Overview
The Reprocess workflow action allows you to automatically retry processing of failed inbound EDI transactions from Orderful Transaction records using NetSuite workflows. This provides a programmatic alternative to the manual "Reprocess" button.
Use Cases
Use this workflow action to:
- Automatically retry failed inbound transactions after a certain period
- Re-process transactions when blocking conditions are resolved
- Eliminate manual steps in error recovery workflows
- Implement automatic retry logic based on error types or counts
Supported Transaction Types
This workflow action supports inbound Orderful Transaction records with any document type that has:
- Status ≠ Success
- Pending Transaction Count = 0 (not currently being processed)
- Direction = Inbound
Prerequisites
- The workflow action script must be deployed to your NetSuite account
- Script ID:
customscript_orderful_reprocess_wa - Deployment ID:
customdeploy_orderful_reprocess_wa - The script must be in RELEASED status
- The Map/Reduce script (
customscript_orderful_transaction_mr) must be deployed and available
Setup Instructions
1. Deploy the Script
The workflow action script should be automatically deployed when the Orderful bundle is installed. Verify deployment:
- Navigate to Customization > Scripting > Scripts
- Search for "Orderful | Reprocess WA"
- Verify the script status is Released
- Check that the deployment is Deployed
2. Create or Edit a Workflow
To add the Reprocess action to a workflow:
- Navigate to Customization > Workflow > Workflows
- Create a new workflow or edit an existing one
- Set the Record Type to Orderful Transaction
- Add a workflow state where you want the action to execute
3. Add the Workflow Action
Within your workflow state:
- Click Add Action under the appropriate trigger type (e.g., Scheduled, After Field Edit, etc.)
- Select Execute Script as the action type
- Configure the action:
- Script: Select "Orderful | Reprocess WA"
- Deployment: Select "Orderful | Reprocess WA"
- Optionally add conditions to control when the action executes
4. Set Workflow Conditions (Required)
To ensure the action only runs for appropriate transactions, add conditions such as:
- Direction = Inbound
- Status ≠ Success
- Pending Transaction Count = 0
- Error Message contains specific error text (optional)
- Last Modified Date is more than X hours/days ago (for retry delays)
- Any custom field criteria specific to your business logic
Example Workflow Configuration
Auto-Retry Failed Transactions After 1 Hour
This example automatically retries failed transactions after they've been in error state for 1 hour:
Workflow Settings:
- Record Type: Orderful Transaction
- Trigger: Scheduled (Hourly)
- Init On Create: False
Workflow State:
- Name: Auto-Retry Failed Transactions
- Trigger Type: On Entry
Workflow Action:
- Type: Execute Script
- Script: Orderful | Reprocess WA
- Conditions:
- Direction = Inbound
- Status = Error
- Pending Transaction Count = 0
- Last Modified is more than 1 hour ago
Retry on Field Flag Change
This example retries processing when a custom "Retry" checkbox is checked:
Workflow Settings:
- Record Type: Orderful Transaction
- Trigger: After Field Edit
Workflow Action Conditions:
- Direction = Inbound
- Status ≠ Success
- Pending Transaction Count = 0
- Custom "Retry Now" Field = True
What the Action Does
When executed, the workflow action:
- Loads the Orderful Transaction record
- Validates the transaction exists
- Submits a Map/Reduce task to reprocess the transaction
- Logs the submission to the script execution log
This is the same functionality as clicking the "Reprocess" button manually. The actual reprocessing happens asynchronously via the Map/Reduce script.
Error Handling
If the workflow action encounters an error:
- The error is logged to the script execution log (Error level)
- The workflow will halt or continue based on your workflow configuration
- Check Customization > Scripting > Script Execution Log for detailed error information
- If the Map/Reduce script submission fails, the transaction will remain in its current state
Troubleshooting
Action Not Executing
- Verify the script deployment is Released and Deployed
- Check workflow conditions are being met (especially Pending Transaction Count = 0)
- Review the workflow execution log
- Ensure the user role has permission to execute the script
Transaction Not Being Reprocessed
- Verify the Map/Reduce script is deployed and available
- Check the Orderful Transaction record's Pending Transaction Count
- Review the script execution log for detailed error information
- Ensure governance limits haven't been exceeded
Infinite Retry Loop
- Add conditions to limit retry attempts (e.g., using a counter field)
- Use time-based conditions to prevent immediate retries
- Exclude specific error types that won't be resolved by reprocessing
- Consider adding a maximum retry count field
Best Practices
- Add Retry Limits: Implement a counter to prevent infinite retry loops
- Use Time Delays: Don't retry immediately - wait for conditions to potentially resolve
- Check Pending Count: Always verify Pending Transaction Count = 0 before retrying
- Filter by Error Type: Only retry errors that might be resolved (e.g., temporary connection issues)
- Monitor Execution: Regularly review script execution logs during initial rollout
- Test in Sandbox: Thoroughly test your workflow in a sandbox environment before deploying to production
Advanced Configuration
Retry Counter Example
To prevent infinite retries, add a custom field to track retry attempts:
- Create a custom integer field:
custrecord_retry_count - Add workflow logic to increment this field on each retry
- Add a condition to only retry if
custrecord_retry_count < 3 - Reset the counter when status changes to Success
Error-Type Specific Retry
Create different workflow states for different error types:
- Temporary Errors: Retry automatically after short delay
- Configuration Errors: Don't retry until admin intervention
- Data Errors: Retry after field is updated
Related Documentation
- Generate and Send Workflow Action
- Send to Orderful Workflow Action
- Button Handler Documentation (if exists)
- NetSuite Workflow Guide: Help Center > Workflow
Support
For issues or questions:
- Review the script execution log for detailed error information
- Contact Head in the Cloud Development, Inc. at [email protected]
- Check the Orderful support documentation
Updated 3 months ago
