Workflow Basics
Creating Your First Workflow#
This section walks you through creating a simple workflow step-by-step.
Example Scenario: Sales Order Notification#
Business Requirement: When a new sales order is created with an amount over $10,000, send an email notification to the sales manager.
Step 1: Create the Workflow#
Navigate to Customization > Workflow > Workflows > New
Configure Basic Information:
- Name: High Value Sales Order Notification
- ID: customworkflow_high_value_so_notify
- Record Type: Sales Order
- Description: Notifies sales manager of high-value orders
Owner Settings:
- Owner Role: Administrator
- Owner: Select yourself or appropriate admin
Initiate On:
- Select: After Record Submit
- Context: Create
Click Save
Step 2: Add Initial State#
Every workflow needs at least one state.
On the workflow manager screen, click New State
Configure State:
- Name: Check Order Value
- Description: Evaluate if notification needed
- Workflow Entry: Check this box (makes this the starting state)
Click Save
Step 3: Add a Condition#
On the state, click the Conditions tab
Click New
Configure Condition:
- Type: Field Value Comparison
- Formula: {amount} > 10000
- Name: Amount Greater Than 10000
Click Save
Step 4: Add an Action#
On the state, click the Actions subtab
Click New Action
Configure Email Action:
- Type: Send Email
- Trigger On: Entry
- Execution Context: If workflow condition is true
Email Details:
- Recipient: Select sales manager or role
- Sender: From record (sales rep) or specific email
- Subject: High Value Sales Order Created - {tranid}
- Body:
A high-value sales order has been created: Order Number: {tranid}Customer: {entity}Amount: {amount}Sales Rep: {salesrep} Please review at: {url}Click Save
Step 5: Make Workflow Active#
- Return to the main workflow screen
- Check the Inactive box to toggle to Active
- Click Save
Step 6: Test the Workflow#
- Create a test sales order
- Set amount to $15,000
- Save the sales order
- Check that email is sent
- Create another order under $10,000
- Verify no email is sent
Understanding Workflow Elements#
Workflow Properties#
Name: User-friendly identifier (appears in lists)
ID: System identifier (used in scripts, must be unique)
Record Type: Which record type this workflow processes
Release Status:
- Testing: Can be edited freely
- Released: More restricted editing
Initiate On:
- Before Record Load
- Before Record Submit
- After Record Submit (most common)
- On Schedule
Trigger Type:
- Create
- Edit
- Delete
- Create or Edit
- All Events
State Properties#
Name: Clear description of what happens in this state
Position: Visual positioning in workflow manager
Workflow Entry: First state in workflow (only one per workflow)
Workflow Exit: Ends workflow execution when reached
Entry Actions: Execute when entering this state
On Field Changed Actions: Execute when specific fields change
Exit Actions: Execute when leaving this state
Transition Properties#
To State: Which state to move to
Trigger Type:
- On Entry: Immediately upon entering current state
- On Field Change: When specific field values change
- On Schedule: At specified time/interval
- User Button: When user clicks custom button
Conditions: Rules that must be true for transition to occur
Workflow Execution Order#
Understanding the execution sequence is crucial:
Record Save Process#
Before Submit Workflow Triggers
- Validation
- Field updates
- Can prevent save
Record Validates
- Required fields
- Field validation
- Business rules
Record Saves to Database
After Submit Workflow Triggers
- Email notifications
- Record creation
- Field updates on saved record
Action Execution Order#
Within a state:
- Entry actions execute first
- On Field Changed actions (if field changes)
- Transition evaluation
- Exit actions (when transitioning)
- Actions in next state
Using Field References#
Workflows can access record fields using curly braces:
Syntax#
{fieldname}Common Examples#
Standard Fields:
{tranid}- Transaction number{entity}- Customer/vendor name{amount}- Total amount{trandate}- Transaction date{memo}- Memo field
Custom Fields:
{custbody_fieldname}- Custom body field{custentity_fieldname}- Custom entity field
Related Record Fields:
{entity.email}- Customer email{salesrep.supervisor}- Sales rep's supervisor{location.name}- Location name
System Fields:
{url}- Link to record{today}- Current date{now}- Current date and time
Field Reference in Conditions#
Simple comparison:{amount} > 5000
String comparison:{status} = 'Pending Approval'
Date comparison:{shipdate} < {today}
Related field:{entity.custentity_credit_status} = 'Hold'Workflow Conditions#
Condition Types#
Formula (Boolean)
- Custom formula returning true/false
- Most flexible option
- Example:
{amount} > 1000 AND {status} = 'Pending'
Compare Field Values
- Compare two fields
- Example: {shipdate} > {orderdate}
Field Value
- Single field comparison
- Example: {status} equals "Approved"
Role
- Current user's role
- Example: Current User is Sales Manager
User
- Specific user check
- Example: Current User is John Smith
Formula (Numeric/Text)
- Return numeric or text value
- Used in decision branching
Combining Conditions#
AND Logic: All conditions must be true
Condition 1: {amount} > 1000Condition 2: {status} = 'Pending'Result: Both must be trueOR Logic: At least one condition must be true
Use multiple transitions orComplex formula: ({condition1} OR {condition2})Common Actions#
Send Email#
- Notify users or customers
- Include record data in message
- Attach PDFs or files
- Use templates
Set Field Value#
- Update record fields
- Calculate values
- Set status or flags
- Update dates
Create Record#
- Generate related records
- Create tasks
- Create custom records
- Link to source record
Transform Record#
- Sales Order โ Invoice
- Purchase Order โ Bill
- Estimate โ Sales Order
Return User Error#
- Stop process with message
- Validate data
- Enforce business rules
Go to State#
- Force transition to specific state
- Jump around workflow
- Handle exceptions
Execute Script#
- Run custom SuiteScript
- Complex logic
- External integrations
Create Task Record#
- Assign work to users
- Set deadlines
- Track completion
Debugging Workflows#
Workflow Execution Log#
Access at: System > Diagnostics > Workflow Execution Log
What to Look For:
- Which workflows executed
- Which states were reached
- Which actions fired
- Any errors encountered
- Execution duration
Troubleshooting Steps#
Workflow Not Triggering:
- Check workflow is Active
- Verify trigger conditions met
- Check record type matches
- Review initiate on settings
- Check for errors in execution log
Actions Not Executing:
- Verify conditions are met
- Check action trigger settings
- Review execution context
- Check permissions
- Look for script errors
Emails Not Sending:
- Verify recipient email address
- Check sender permissions
- Verify workflow has email permission
- Check for email template errors
- Review execution log
Testing Best Practices#
Test in Sandbox:
- Never test in production first
- Use realistic data
- Test all condition paths
Test Checklist:
- Workflow triggers correctly
- Conditions evaluate properly
- All actions execute
- Emails have correct content
- Fields update as expected
- No unintended side effects
- Performance is acceptable
- Works with different roles
Test Different Scenarios:
- Happy path (everything works)
- Edge cases (boundary values)
- Error conditions (invalid data)
- Different user roles
- High volume (performance)
Workflow Permissions#
Required Permissions#
To Create Workflows:
- Customization > Workflows > Full
For Workflows to Execute:
- Workflow must have permissions for actions
- Consider execution as workflow owner
- Some actions require specific permissions
Email Permissions:
- Workflow needs send email permission
- Sender must have valid email
Create Record Permissions:
- Workflow needs create permission for target record type
Role Considerations#
Current User Context:
- Some workflows execute as current user
- User must have necessary permissions
- May affect record visibility
Workflow Owner Context:
- Can execute as workflow owner
- Provides consistent permissions
- Useful for system-level actions
Performance Considerations#
Governance Limits#
NetSuite imposes limits on workflow execution:
- Usage units per execution
- Total actions per workflow
- Script governance for custom scripts
Best Practices:
- Minimize number of actions
- Use conditions to limit execution
- Avoid unnecessary field updates
- Be cautious with scheduled workflows
Optimization Tips#
Reduce Actions:
- Combine multiple field updates into one
- Use formulas instead of multiple conditions
- Remove unnecessary actions
Efficient Conditions:
- Put most restrictive conditions first
- Use simple comparisons when possible
- Avoid complex formulas if simple logic works
Scheduled Workflows:
- Run during off-peak hours
- Process in batches
- Monitor execution time
- Set appropriate frequency
Real-World Examples#
Example 1: Order Approval#
Scenario: Require manager approval for orders over $5,000
States:
- Pending Approval (Entry state)
- Approved
- Rejected
Logic:
On Create of Sales Order: If Amount > 5000: Set Status = Pending Approval Create Task for Manager Send Email to Manager If Amount <= 5000: Set Status = Approved Go to Approved StateExample 2: Customer Onboarding#
Scenario: Automate new customer setup tasks
States:
- New Customer Created
- Documents Requested
- Completed
Logic:
After Customer Create: Send Welcome Email to Customer Create Task: "Request W-9" for Accounting Create Task: "Schedule Kickoff" for Sales Rep Set Custom Field: Onboarding Status = In ProgressExample 3: Invoice Payment Reminder#
Scenario: Send reminders for overdue invoices
States:
- Invoice Created
- Payment Reminder Sent
- Second Reminder Sent
- Collection Process
Logic:
Scheduled Daily: For Each Invoice where Status = Open: If Days Overdue = 7: Send Email Reminder to Customer Go to Payment Reminder Sent State If Days Overdue = 14: Send Second Email Reminder Create Task for Collections Team Go to Second Reminder Sent State If Days Overdue = 30: Create Task for Manager Review Go to Collection Process StateNext Steps#
Now that you understand workflow basics, continue to:
- Workflow States: Deep dive into state management
- Workflow Actions: Explore all available actions
- Workflow Conditions: Master conditional logic
- Workflow Examples: See complex real-world workflows