09

Improving Workflow Performance

Best Practices for Optimized Processing

🎯 Learning Objectives

Upon completion of this module, you will be able to:

Performance Overview

While many performance tips result in minuscule gains, saving just a few milliseconds per workflow execution can significantly improve overall performance when thousands or millions of records are processed across many user sessions.

📋 Performance Areas Covered

  • Workflow Design
  • Workflow Initiation
  • Workflow Conditions
  • Scheduling Workflows and Actions
  • After Record Submit Processing
  • Workflow Logging
  • Workflow Action Scripts

Workflow Design Best Practices

Poorly designed workflows are the most common cause of performance issues.

💡 Tip 1: Modularize Workflows

Don't try to do too much in any one workflow. Break workflows into smaller processing chunks. Consider the nature of processing and modularize as necessary.

💡 Tip 2: Separate Client and Server

Separate workflow processing between client-triggered and server-triggered initiation. This allows for easier troubleshooting by isolating actions by trigger type.

💡 Tip 3: Leverage Sub-Workflows

Use parent workflows to initiate child sub-workflows for additional processing. This provides better control over execution order and facilitates troubleshooting.

Workflow Initiation Best Practices

💡 Tip 1: Configure Proper Initiation Conditions

Ensure workflows only execute when all conditions are met AND the workflow has something to process. It's better to prevent initiation than to initiate and immediately exit.

💡 Tip 2: Select Appropriate Event Type and Context

Use specific contexts (like CSV Import) to prevent workflow processing on non-targeted records. Only initiate workflows during bulk imports when absolutely necessary.

💡 Tip 3: Avoid "All" Trigger Type

Using "All" as the trigger type can cause workflows to execute inappropriately. Always select the most appropriate specific trigger: Before Record Load, Before Record Submit, or After Record Submit.

⚠️ Warning

Not specifying event type or context fields may initiate workflows unnecessarily, reducing performance during record load or save events.

Condition Best Practices

💡 Tip 1: Limit Old Record References

Referencing "Old Record" in VALUE FIELD conditions causes the database record to be reloaded during condition evaluation, impacting performance.

💡 Tip 2: Limit Saved Search Conditions

Saved search criteria can impact performance on individual actions/transitions. Configure saved searches at workflow initiation level when possible—evaluated once instead of multiple times.

💡 Tip 3: Limit Joined Record Conditions

Visual Builder conditions are converted to SQL queries. More related record fields = more complex queries = reduced performance.

Alternatives to Joined Conditions

Scheduling Best Practices

💡 Tip 1: Target Only Records Requiring Processing

Create saved search conditions that only return records the workflow will actually process. Prevent initiating workflows on records that don't need updating.

💡 Tip 2: Avoid Unnecessary Reprocessing

After processing, ensure record data changes so it no longer meets the saved search criteria. Use status fields when possible to exclude processed records.

💡 Tip 3: Avoid Time-Based Search Criteria

Don't filter for records created "in the last 30 minutes." If processing isn't complete before the next scheduler cycle, records may be skipped.

💡 Tip 4: Limit Scheduled Actions on Large Record Sets

Workflows with scheduled actions wake up every 30 minutes, reload ALL records, and check if actions need execution—even if no action is needed.

After Record Submit Processing

Understanding Backend Behavior

When processing multiple workflows at After Record Submit, records are reloaded on the server. A second save event occurs only if a workflow made changes using Set Field Value.

💡 Tip 1: Use Before Record Submit When Possible

Execute Set Field Value actions at Before Record Submit rather than After Record Submit. This sets values while the record is in memory, avoiding a second database commit.

💡 Tip 2: Guard Set Field Value Actions

For fields that are set once and never change, add a condition that checks if the value has changed. This prevents unnecessary save events.

⚠️ Note

For data-heavy records like Sales Orders and Purchase Orders, the second load and save event can have significant performance impact.

Logging Best Practices

💡 Disable Logging in Production

When setting Release Status to "Released," uncheck "Enable Logging" to reduce logging overhead. Error logs are still generated but only display server processing errors.

Workflow Action Script Best Practices

💡 Tip 1: Use Built-in Actions First

Always use standard SuiteFlow actions when possible. Only use Workflow Action Scripts when required processing isn't supported by built-in actions.

💡 Tip 2: Avoid Resource-Intensive Operations

Workflows wait for scripts to complete (synchronous). Long processing loops or resource-intensive operations will be perceived as slow workflow performance.

💡 Tip 3: Use Scheduled Scripts for Batch Operations

For complex batch processing, initiate a scheduled script from the workflow. This runs asynchronously on the server, returning focus to the client immediately.

💡 Tip 4: Use APM for Performance Analysis

Use the Application Performance Management SuiteApp to identify bottlenecks in server-side script processing.

Performance Summary Table

Area Best Practice Avoid
Design Modular, separated client/server Monolithic, complex workflows
Initiation Specific triggers and contexts "All" trigger, no context filter
Conditions Simple conditions, SQL formulas Old Record refs, complex joins
Saved Searches At initiation level, exclude processed On individual actions, time-based
Set Field Value Before Record Submit with guards After Record Submit without guards
Logging Disabled in production Always enabled
Scripts Built-in actions, async for batch Long loops, resource-intensive

🌟 Key Takeaways