Skip to main content

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#

  1. Navigate to Customization > Workflow > Workflows > New

  2. 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
  3. Owner Settings:

    • Owner Role: Administrator
    • Owner: Select yourself or appropriate admin
  4. Initiate On:

    • Select: After Record Submit
    • Context: Create
  5. Click Save

Step 2: Add Initial State#

Every workflow needs at least one state.

  1. On the workflow manager screen, click New State

  2. Configure State:

    • Name: Check Order Value
    • Description: Evaluate if notification needed
    • Workflow Entry: Check this box (makes this the starting state)
  3. Click Save

Step 3: Add a Condition#

  1. On the state, click the Conditions tab

  2. Click New

  3. Configure Condition:

    • Type: Field Value Comparison
    • Formula: {amount} > 10000
    • Name: Amount Greater Than 10000
  4. Click Save

Step 4: Add an Action#

  1. On the state, click the Actions subtab

  2. Click New Action

  3. Configure Email Action:

    • Type: Send Email
    • Trigger On: Entry
    • Execution Context: If workflow condition is true
  4. 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}
  5. Click Save

Step 5: Make Workflow Active#

  1. Return to the main workflow screen
  2. Check the Inactive box to toggle to Active
  3. Click Save

Step 6: Test the Workflow#

  1. Create a test sales order
  2. Set amount to $15,000
  3. Save the sales order
  4. Check that email is sent
  5. Create another order under $10,000
  6. 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#

  1. Before Submit Workflow Triggers

    • Validation
    • Field updates
    • Can prevent save
  2. Record Validates

    • Required fields
    • Field validation
    • Business rules
  3. Record Saves to Database

  4. After Submit Workflow Triggers

    • Email notifications
    • Record creation
    • Field updates on saved record

Action Execution Order#

Within a state:

  1. Entry actions execute first
  2. On Field Changed actions (if field changes)
  3. Transition evaluation
  4. Exit actions (when transitioning)
  5. 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 true

OR 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:

  1. Check workflow is Active
  2. Verify trigger conditions met
  3. Check record type matches
  4. Review initiate on settings
  5. Check for errors in execution log

Actions Not Executing:

  1. Verify conditions are met
  2. Check action trigger settings
  3. Review execution context
  4. Check permissions
  5. Look for script errors

Emails Not Sending:

  1. Verify recipient email address
  2. Check sender permissions
  3. Verify workflow has email permission
  4. Check for email template errors
  5. 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:

  1. Pending Approval (Entry state)
  2. Approved
  3. 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 State

Example 2: Customer Onboarding#

Scenario: Automate new customer setup tasks

States:

  1. New Customer Created
  2. Documents Requested
  3. 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 Progress

Example 3: Invoice Payment Reminder#

Scenario: Send reminders for overdue invoices

States:

  1. Invoice Created
  2. Payment Reminder Sent
  3. Second Reminder Sent
  4. 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 State

Next 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