Skip to main content

States & Transitions

States represent stages in your process. Transitions define how records move between states.


Understanding States

What is a State?

STATE CONCEPT
═══════════════════════════════════════════════════════════════════════════════

A state represents WHERE a record is in the workflow process.

┌─────────────────────────────────────────────────────────────────────────────┐
│ STATE: PENDING APPROVAL │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ENTRY ACTIONS STATE PROPERTIES EXIT ACTIONS │
│ ───────────── ──────────────── ──────────── │
│ Execute when While in this state: Execute when │
│ entering state: • Record is locked leaving state: │
│ • Set status • Buttons shown • Log transition │
│ • Send email • Waiting for action • Clear temp data │
│ • Lock record │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

State Types

STATE CLASSIFICATIONS
═══════════════════════════════════════════════════════════════════════════════

┌─────────────────────────────────────────────────────────────────────────────┐
│ INITIAL STATE │
│ ───────────── │
│ • First state in the workflow │
│ • Record enters here when workflow starts │
│ • Only one initial state per workflow │
│ • Typically: "Draft", "New", "Pending" │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│ INTERMEDIATE STATES │
│ ────────────────── │
│ • States between initial and final │
│ • Can have multiple intermediate states │
│ • Example: "Manager Review", "Director Review", "CFO Review" │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│ FINAL STATES │
│ ──────────── │
│ • End points of the workflow │
│ • Can have multiple final states │
│ • No transitions OUT of final state (unless allowing restart) │
│ • Example: "Approved", "Rejected", "Completed" │
└─────────────────────────────────────────────────────────────────────────────┘

Creating States

State Configuration

STATE SETUP
═══════════════════════════════════════════════════════════════════════════════

State Properties:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Name: Pending Manager Approval │
│ ID: workflowstate_pending_mgr (auto-generated) │
│ Description: Waiting for manager to approve or reject │
│ │
│ State Options: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ ☑ Do not exit workflow if state is active │ │
│ │ (Keeps workflow alive until this state completes) │ │
│ │ │ │
│ │ ☐ Send email to performer on entry │ │
│ │ (Auto-notify person responsible for this state) │ │
│ │ │ │
│ │ ☐ Required for completion │ │
│ │ (Must pass through this state to complete workflow) │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

State Order

STATE ORDERING
═══════════════════════════════════════════════════════════════════════════════

State order determines:
1. Which state is the INITIAL state (first in list)
2. Visual order in workflow diagram

┌─────────────────────────────────────────────────────────────────────────────┐
│ Order │ State Name │ Type │ Notes │
├───────┼─────────────────────────┼──────────────┼───────────────────────────┤
│ 1 │ Draft │ Initial │ Records start here │
│ 2 │ Pending Manager Review │ Intermediate │ │
│ 3 │ Pending Director Review │ Intermediate │ Only for > $5,000 │
│ 4 │ Approved │ Final │ Workflow ends here │
│ 5 │ Rejected │ Final │ Can transition to Draft │
└───────┴─────────────────────────┴──────────────┴───────────────────────────┘

Understanding Transitions

What is a Transition?

TRANSITION CONCEPT
═══════════════════════════════════════════════════════════════════════════════

A transition defines HOW a record moves from one state to another.

┌─────────────┐ ┌─────────────┐
│ STATE A │ ─────TRANSITION────────→│ STATE B │
│ (From) │ │ (To) │
└─────────────┘ └─────────────┘


┌─────────┴─────────┐
│ │
│ TRIGGER │ What starts the transition
│ CONDITION │ When is it allowed
│ ACTIONS │ What happens during move
│ │
└───────────────────┘

Transition Properties

TRANSITION CONFIGURATION
═══════════════════════════════════════════════════════════════════════════════

┌─────────────────────────────────────────────────────────────────────────────┐
│ Transition: Approve │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Basic Settings: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Name: Approve │ │
│ │ From State: Pending Manager Approval │ │
│ │ To State: Approved │ │
│ │ Button Label: Approve (shown on record) │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Trigger Type: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ ● Button Click User clicks workflow button │ │
│ │ ○ Entry Automatic on entering state │ │
│ │ ○ Exit Automatic on exiting state │ │
│ │ ○ Before Submit Before record saves │ │
│ │ ○ After Submit After record saves │ │
│ │ ○ Scheduled At specified time │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Condition (optional): │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Formula: {total} <= 5000 │ │
│ │ (Transition only available if total is $5,000 or less) │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Trigger Types

Button Trigger

BUTTON-TRIGGERED TRANSITION
═══════════════════════════════════════════════════════════════════════════════

User clicks button to trigger transition:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Record: Vendor Bill #12345 │
│ Status: Pending Approval │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ [Save] [Cancel] [Approve] [Reject] [Escalate] │
│ │ │ │ │
│ Workflow buttons appear based on current state │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Button Configuration:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Button Settings: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Label: Approve │ │
│ │ Role Access: Manager, Director, Administrator │ │
│ │ Condition: (show button only when condition met) │ │
│ │ Confirmation: "Are you sure you want to approve?" │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

Automatic Triggers

AUTOMATIC TRANSITIONS
═══════════════════════════════════════════════════════════════════════════════

ENTRY TRIGGER:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Fires immediately when entering a state │
│ │
│ Use case: Auto-route based on amount │
│ Example: If entering "Review" state and amount > $50k, │
│ immediately transition to "Executive Review" │
└─────────────────────────────────────────────────────────────────────────────┘

EXIT TRIGGER:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Fires when leaving a state (before arriving at new state) │
│ │
│ Use case: Cleanup or logging before moving on │
│ Example: Log who approved and when before moving to Approved state │
└─────────────────────────────────────────────────────────────────────────────┘

BEFORE SUBMIT:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Fires before record is saved │
│ │
│ Use case: Validate before allowing save │
│ Example: Check all required fields are filled before submission │
└─────────────────────────────────────────────────────────────────────────────┘

AFTER SUBMIT:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Fires after record is saved │
│ │
│ Use case: Actions that need saved data │
│ Example: After save, check if conditions met for auto-approval │
└─────────────────────────────────────────────────────────────────────────────┘

Scheduled Trigger

SCHEDULED TRANSITIONS
═══════════════════════════════════════════════════════════════════════════════

Time-based automatic transitions:

┌─────────────────────────────────────────────────────────────────────────────┐
│ Schedule Configuration: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Delay: 2 │ │
│ │ Delay Unit: Days │ │
│ │ Condition: {approvalstatus} = 'Pending' │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Use Cases: │
│ • Auto-escalate if no approval after 2 days │
│ • Auto-reject if no response after 7 days │
│ • Send reminder after 24 hours │
│ • Auto-close completed tasks after 30 days │
└─────────────────────────────────────────────────────────────────────────────┘

Example: Auto-Escalation
┌─────────────────────────────────────────────────────────────────────────────┐
│ │
│ Day 0 Day 2 (No Response) Day 4 (No Response) │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌────────┐ ┌────────────┐ ┌───────────┐ │
│ │Pending │ ─────→ │ Manager │ ──────────→ │ Director │ │
│ │ │ auto │ Reminder │ auto │ Review │ │
│ └────────┘ └────────────┘ └───────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Conditional Routing

Single Condition

CONDITIONAL TRANSITION
═══════════════════════════════════════════════════════════════════════════════

Route to different states based on field values:

┌─────────────┐
│ DRAFT │
└──────┬──────┘

[Submit Button]

┌────────────────┴────────────────┐
│ │
Amount <= $5000 Amount > $5000
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ MANAGER │ │ DIRECTOR │
│ REVIEW │ │ REVIEW │
└─────────────────┘ └─────────────────┘

Transition Configuration:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Transition 1: Submit (Low Value) │
│ From: Draft │
│ To: Manager Review │
│ Condition: {total} <= 5000 │
│ │
│ Transition 2: Submit (High Value) │
│ From: Draft │
│ To: Director Review │
│ Condition: {total} > 5000 │
└─────────────────────────────────────────────────────────────────────────────┘

Multi-Level Routing

COMPLEX ROUTING EXAMPLE
═══════════════════════════════════════════════════════════════════════════════

Purchase Order Approval Based on Amount and Department:

┌─────────────┐
│ DRAFT │
└──────┬──────┘

[Submit Button]

┌───────────────┬────────────┼────────────┬───────────────┐
│ │ │ │ │
<= $1,000 $1K - $5K $5K - $25K $25K - $100K > $100K
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│ AUTO │ │ MANAGER │ │ DIRECTOR │ │ VP │ │ BOARD │
│ APPROVE │ │ REVIEW │ │ REVIEW │ │ REVIEW │ │ REVIEW │
└───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘
│ │ │ │ │
└───────────────┴────────────┴────────────┴───────────────┘

┌──────┴──────┐
│ APPROVED │
└─────────────┘

Transition Actions

Executing Actions During Transition

TRANSITION ACTION TIMING
═══════════════════════════════════════════════════════════════════════════════

When transition occurs:
┌─────────────────────────────────────────────────────────────────────────────┐
│ │
│ FROM STATE TO STATE │
│ ───────── ──────── │
│ ┌─────────────┐ ┌───────────────────┐ ┌─────────────┐ │
│ │ │ │ TRANSITION │ │ │ │
│ │ STATE A │ ──→ │ │ ──→ │ STATE B │ │
│ │ │ │ Actions execute │ │ │ │
│ └─────────────┘ │ during transition │ └─────────────┘ │
│ │ └───────────────────┘ │ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Exit Actions Transition Actions Entry Actions │
│ │
│ ORDER OF EXECUTION: │
│ 1. State A Exit Actions │
│ 2. Transition Actions │
│ 3. State B Entry Actions │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Common Transition Actions:
┌─────────────────────────────────────────────────────────────────────────────┐
│ • Log transition to audit record │
│ • Capture who triggered and when │
│ • Validate data before allowing move │
│ • Calculate values needed in next state │
└─────────────────────────────────────────────────────────────────────────────┘

State-Transition XML

Complete Example

<!-- State Definition -->
<workflowstate scriptid="workflowstate_pending_mgr">
<name>Pending Manager Approval</name>
<description>Waiting for manager review</description>
<donotexitalivetillcomplete>T</donotexitalivetillcomplete>

<!-- Entry Actions -->
<workflowactions triggertype="ENTRY">
<setfieldvalueaction>
<field>STDBODYAPPROVALSTATUS</field>
<value>Pending Approval</value>
</setfieldvalueaction>
<lockrecordaction>
<locked>T</locked>
</lockrecordaction>
</workflowactions>

<!-- Transitions -->
<workflowtransitions>
<!-- Approve Transition -->
<workflowtransition scriptid="trans_approve">
<name>Approve</name>
<tostate>workflowstate_approved</tostate>
<buttonaction>
<label>Approve</label>
</buttonaction>
</workflowtransition>

<!-- Reject Transition -->
<workflowtransition scriptid="trans_reject">
<name>Reject</name>
<tostate>workflowstate_rejected</tostate>
<buttonaction>
<label>Reject</label>
</buttonaction>
</workflowtransition>

<!-- Auto-Escalate Transition -->
<workflowtransition scriptid="trans_escalate">
<name>Auto Escalate</name>
<tostate>workflowstate_pending_dir</tostate>
<scheduledaction>
<delay>2</delay>
<delayunit>DAYS</delayunit>
</scheduledaction>
</workflowtransition>
</workflowtransitions>
</workflowstate>

Common Patterns

Approval with Rejection Loop

APPROVAL WITH RESUBMISSION
═══════════════════════════════════════════════════════════════════════════════

┌────────────────────────────────────────────────────────┐
│ │
│ ┌─────────┐ ┌─────────┐ ┌──────────┐ │
└──→ │ DRAFT │ ─────→ │ PENDING │ ─────→ │ APPROVED │ │
└─────────┘ └────┬────┘ └──────────┘ │
│ │
[Reject] │
│ │
▼ │
┌───────────┐ │
│ REJECTED │ │
└─────┬─────┘ │
│ │
[Resubmit] │
│ │
└───────────────────────────┘

Parallel Approval

PARALLEL APPROVAL PATHS
═══════════════════════════════════════════════════════════════════════════════

┌─────────────┐
│ DRAFT │
└──────┬──────┘

┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ FINANCE │ │ LEGAL │ │ IT │
│ REVIEW │ │ REVIEW │ │ REVIEW │
└─────┬─────┘ └─────┬─────┘ └─────┬─────┘
│ │ │
└────────────────┼────────────────┘

┌─────────────────┐
│ ALL APPROVED? │
│ (condition) │
└────────┬────────┘

┌──────────┴──────────┐
▼ ▼
┌───────────┐ ┌───────────┐
│ APPROVED │ │ WAITING │
└───────────┘ │ (more) │
└───────────┘

Note: NetSuite workflows are sequential, not parallel.
Use custom fields to track multiple approvers.

Next Steps

GoalGo To
Add workflow actionsActions →
Define conditionsConditions →
Return to WorkflowsWorkflows Overview →