Skip to main content

Workflow States

Understanding States#

States represent stages or steps in your business process. A record exists in one state at a time and transitions between states based on your defined logic.

State Concepts#

State as Process Stage#

Think of states as checkpoints in your business process:

Sales Order Process:

[New Order] โ†’ [Credit Check] โ†’ [Approved] โ†’ [Fulfilled] โ†’ [Closed]

Support Ticket Process:

[New] โ†’ [Assigned] โ†’ [In Progress] โ†’ [Pending Customer] โ†’ [Resolved]

Single Active State#

  • A record can only be in one state at any given time
  • The current state determines what actions can occur
  • States control the workflow path forward

State Persistence#

  • Current state is stored on the record
  • Visible in workflow execution log
  • Can be referenced in searches and reports

Creating States#

State Configuration#

Name

  • Clear, descriptive name
  • Reflects what's happening in this stage
  • Examples: "Awaiting Approval", "Being Processed", "Completed"

Description

  • Detailed explanation of state purpose
  • What triggers entry
  • What happens in this state
  • Exit conditions

Workflow Entry

  • Check this for the initial state
  • Only one entry state per workflow
  • Where execution begins

Workflow Exit

  • Check this for final states
  • Workflow ends when reached
  • No further transitions occur

Position

  • Visual placement in workflow diagram
  • Helps with workflow readability
  • No functional impact

Types of States#

Entry State#

The first state where workflow execution begins.

Characteristics:

  • Has "Workflow Entry" checked
  • One per workflow only
  • Executes when trigger condition met
  • Sets up initial process

Example:

State: Order ReceivedType: Entry StateActions:  - Set field: Internal Status = "Processing"  - Send email confirmation to customer  - Create task for fulfillment team

Processing States#

Intermediate states where work happens.

Characteristics:

  • Where most actions occur
  • Can have multiple processing states
  • May wait for external input
  • Can loop back if needed

Example:

State: Credit Check in ProgressActions on Entry:  - Create task for credit team  - Set field: Credit Check Status = "Pending"  Actions on Exit:  - Update credit check date  - Log result in notes

Decision States#

States that evaluate conditions and route to different paths.

Characteristics:

  • Minimal actions
  • Multiple exit transitions
  • Based on field values or conditions
  • Quick pass-through

Example:

State: Evaluate Order ValueTransitions:  - If Amount > 10000 โ†’ Manager Approval Required  - If Amount > 5000 โ†’ Supervisor Approval Required  - If Amount <= 5000 โ†’ Auto Approved

Waiting States#

States where workflow pauses for external action.

Characteristics:

  • Waits for user input
  • Waits for field change
  • May have timeout transitions
  • Monitors for conditions

Example:

State: Pending Customer ResponseWait For: Field Change (Customer Response field)Timeout: 3 daysTimeout Action:  - Send reminder email  - Create escalation task

Exit States#

Final states that end workflow execution.

Characteristics:

  • Has "Workflow Exit" checked
  • Can have multiple exit states
  • Performs cleanup actions
  • No outgoing transitions

Examples:

State: Order CompletedType: Exit StateActions:  - Set field: Workflow Status = "Complete"  - Send completion email  - Archive related documents
State: Order Cancelled  Type: Exit StateActions:  - Set field: Workflow Status = "Cancelled"  - Send cancellation notice  - Update inventory

State Actions#

Action Timing#

On Entry

  • Executes when entering the state
  • First actions to run
  • Setup activities

On Field Changed

  • Executes when monitored field changes
  • While in this state
  • Reactive to updates

On Exit

  • Executes when leaving the state
  • Last actions before transition
  • Cleanup activities

Action Order#

Within each timing category, actions execute in order listed:

State: Process Order
On Entry Actions (execute in order):  1. Set Status Field  2. Send Email  3. Create Task  4. Update Related Record
On Field Changed (Shipping Method):  1. Calculate Shipping Cost  2. Update Total Amount  3. Notify Customer of Change
On Exit Actions:  1. Log Completion Time  2. Update Metrics  3. Archive Documents

State Transitions#

Transition Configuration#

From State: Current state (automatic)

To State: Destination state

Trigger Type:

  • On Entry: Immediate transition
  • On Field Change: When field updates
  • On Schedule: Time-based
  • Button Press: User-initiated

Conditions: Rules for transition

Button Label: For button-triggered transitions

Transition Evaluation Order#

Transitions are evaluated in the order listed:

State: Check Credit
Transition 1: โ†’ Approved  Condition: Credit Score > 700  Priority: 1 (checked first)  Transition 2: โ†’ Manual Review  Condition: Credit Score >= 650 AND Credit Score <= 700  Priority: 2 (checked second)  Transition 3: โ†’ Rejected  Condition: Credit Score < 650  Priority: 3 (checked last)

Important: First matching transition wins!

Conditional Transitions#

Simple Condition:

Transition: โ†’ Approved StateCondition: {custbody_approval_status} = 'Approved'

Complex Condition:

Transition: โ†’ Manager ReviewCondition:   {amount} > 5000 AND   {custbody_risk_level} IN ('Medium', 'High') AND  {custbody_customer_type} != 'Preferred'

Time-Based Condition:

Transition: โ†’ EscalateTrigger: On Schedule (Daily)Condition: {custbody_days_in_state} > 3

Multiple Paths#

States can have multiple outgoing transitions:

State: Evaluate Application
Path 1: โ†’ Auto Approved  Condition: Score > 800 AND History = 'Excellent'  Path 2: โ†’ Manager Approval  Condition: Score > 700 AND Amount > 10000  Path 3: โ†’ Manual Review  Condition: Score >= 650 AND Score <= 700  Path 4: โ†’ Rejected  Condition: Score < 650  Default: โ†’ General Review  Condition: (none - catches all others)

State Design Patterns#

Linear Flow#

Simple sequential process:

[Start] โ†’ [Step 1] โ†’ [Step 2] โ†’ [Step 3] โ†’ [End]

Use When:

  • Simple, straightforward process
  • No branching needed
  • Each step always follows previous

Example: Order Fulfillment

[Order Received] โ†’ [Items Picked] โ†’ [Quality Check] โ†’ [Packed] โ†’ [Shipped] โ†’ [Delivered]

Branching Flow#

Process splits based on conditions:

                    โ†’ [Path A] โ†’ [End A][Start] โ†’ [Decision] โ†’ [Path B] โ†’ [End B]                    โ†’ [Path C] โ†’ [End C]

Use When:

  • Different paths for different scenarios
  • Conditional processing
  • Multiple outcomes

Example: Order Approval

                    โ†’ [Auto Approved] โ†’ [Process][New Order] โ†’ [Check Value] โ†’ [Manager Approval] โ†’ [Process]                    โ†’ [Director Approval] โ†’ [Process]

Loop Pattern#

Process returns to previous state:

[Start] โ†’ [Process] โ†’ [Review] โŸฒ             โ†“          [Complete]

Use When:

  • Iterative review process
  • Corrections needed
  • Retry logic

Example: Document Approval

[Submit] โ†’ [Review] โ†’ [Revise] โŸฒ             โ†“         [Approved]

Parallel Paths#

Multiple activities occur simultaneously:

[Start] โ†’ [Split] โ†’ [Task A] โŸ                  โ†’ [Task B] โ†’ [Join] โ†’ [End]                  โ†’ [Task C] โŸ‹

Implementation Note: NetSuite workflows don't natively support true parallel processing. Simulate with:

  • Multiple actions in one state
  • Separate workflows on related records
  • Scheduled workflow checking completion

Wait and Resume#

Workflow pauses and resumes based on event:

[Start] โ†’ [Process] โ†’ [Wait for Input] โŒ› โ†’ [Continue] โ†’ [End]

Use When:

  • Awaiting external input
  • User decision needed
  • Time delay required

Example: Customer Response

[Send Quote] โ†’ [Wait for Customer] โ†’  (On field change: Customer Response)[Process Response] โ†’ [Create Order or Close]

Advanced State Techniques#

State Variables#

Store information about state for later use:

Using Custom Fields:

On Entry to "Awaiting Approval":  Set Field: custbody_entered_approval_date = {today}  Set Field: custbody_entered_approval_by = {currentuser}
On Exit from "Awaiting Approval":  Set Field: custbody_days_in_approval = {today} - {custbody_entered_approval_date}

State Timeout Handling#

Auto-escalate if state takes too long:

State: Pending Manager Approval
Transition 1: โ†’ Approved  Trigger: On Field Change (Approval Status)  Condition: {custbody_approval_status} = 'Approved'
Transition 2: โ†’ Escalated to Director  Trigger: On Schedule (Daily)  Condition: {custbody_days_in_state} > 2  Actions:    - Send escalation email    - Create task for director

State Re-entry#

Allow returning to previous state:

State: In Production
Transition to Quality Check:  Normal path forward
Transition back to In Production:  Trigger: On Field Change (QC Status)  Condition: {custbody_qc_status} = 'Failed'  Actions:    - Increment rework counter    - Assign back to production    - Notify production manager

Conditional State Actions#

Execute different actions based on conditions within state:

State: Process Order
On Entry Action 1: Send Email  Execution Condition: {custentity_email_preference} = 'Yes'  On Entry Action 2: Send SMS  Execution Condition: {custentity_sms_preference} = 'Yes'  On Entry Action 3: Create High Priority Task  Execution Condition: {amount} > 50000  On Entry Action 4: Create Standard Task  Execution Condition: {amount} <= 50000

State Monitoring and Reporting#

Tracking Current State#

Custom Field: Create a custom field to display current state:

Field: Current Workflow StateType: TextFormula/Default: Set by workflowDisplay on Form: Yes, Read-only

Action in Each State:

On Entry: Set Field custbody_workflow_state = "State Name"

State Duration Tracking#

Track time spent in each state:

On Entry to State:  Set Field: custbody_state_entry_time = {now}
On Exit from State:  Set Field: custbody_time_in_[state] =     {now} - {custbody_state_entry_time}

State Metrics#

Build reports on workflow performance:

Saved Search: Orders by State

Criteria: Transaction Type = Sales OrderResults:  - Current Workflow State  - Count  - Average Time in State  - Oldest Record in State

Best Practices#

State Design#

Keep States Focused

  • One purpose per state
  • Clear entry/exit criteria
  • Manageable number of actions

Clear Naming

  • Use verb phrases: "Awaiting Approval", "Being Processed"
  • Or status indicators: "Approved", "Rejected", "Completed"
  • Be consistent across workflows

Logical Flow

  • Natural business process flow
  • Minimize backwards transitions
  • Clear decision points

Transition Management#

Explicit Transitions

  • Define all possible paths
  • Handle edge cases
  • Always have a default path

Condition Order

  • Most specific conditions first
  • Most common paths first for performance
  • Default/catch-all last

Avoid Infinite Loops

  • Always provide exit path
  • Use counters for retries
  • Include timeout transitions

Performance#

Minimize State Count

  • Combine simple states where possible
  • Don't create states for every small step
  • Balance clarity with efficiency

Efficient Actions

  • Minimize actions per state
  • Combine related updates
  • Use conditions to limit execution

Testing States#

Test Each State:

  • Entry actions execute
  • All transitions work
  • Exit actions execute
  • Field changes trigger correctly
  • Timeouts work as expected

Test State Paths:

  • Happy path (normal flow)
  • Alternative paths
  • Error conditions
  • Edge cases
  • Loop scenarios

Troubleshooting States#

Common Issues#

Stuck in State:

  • Check transition conditions
  • Verify required field changes
  • Review execution log
  • Check for missing transitions

Actions Not Executing:

  • Verify action trigger timing
  • Check execution conditions
  • Review action order
  • Check permissions

Wrong State Transition:

  • Review condition logic
  • Check transition order
  • Verify field values
  • Look for timing issues

Performance Problems:

  • Too many actions in state
  • Complex conditions
  • Inefficient formula fields
  • Too many state transitions

State Documentation Template#

### State: [State Name]
**Purpose**: [What this state represents]
**Entry Conditions**: [When record enters this state]
**Exit Conditions**: [When record leaves this state]
**Actions on Entry**:1. [Action description]2. [Action description]
**Actions on Field Change**:- Field: [field name]  - Action: [what happens]
**Actions on Exit**:1. [Action description]
**Outgoing Transitions**:1. To [State Name]: [Condition]2. To [State Name]: [Condition]
**Expected Duration**: [How long typically in this state]
**Owner/Responsible Party**: [Who handles this state]

Next Steps#

Continue learning about:

  • Workflow Actions: Deep dive into available actions
  • Workflow Conditions: Mastering conditional logic
  • Workflow Examples: Complete real-world workflows