# How to build a workflow in NetSuite with SuiteFlow

> Source: https://netray.co/erp-help/netsuite-how-to-build-workflows
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

Go to Customization > Workflow > Workflows > New, pick the record type and select Server, Client, or both as the trigger context, then build states and transitions on the workflow diagram, attaching actions (Set Field Value, Send Email, Create Record, Custom Action Script) to each state or transition. Release the workflow (top right dropdown, Testing to Released) once validated, since a workflow left in Testing only fires for the workflow owner.

## Kind

how-to

## System

netsuite

## Erp

Oracle NetSuite

## Module

SuiteFlow / Workflows

## Query

how to build a workflow in NetSuite

## Alternate Queries

- netsuite suiteflow tutorial
- how to create an approval workflow in netsuite
- netsuite workflow action script vs button action
- netsuite workflow not triggering

## Applies To

NetSuite all current versions (2023.x-2026.x). SuiteFlow is included in most mid-tier and above editions; some actions require SuiteScript for custom logic beyond the point-and-click action set.

## Steps

### Create a basic approval workflow

**Items:**

Go to Customization > Workflow > Workflows > New (or New Workflow from a record's Customization menu).

Set Name, Record Type (e.g. Purchase Order), and choose Event Type/trigger context: Before Load, Before Submit, After Submit for server execution, or field-change/save for client execution.

Under Initiation, choose On Create, On View, On Update or Scheduled, and set the initial workflow condition if it should not fire for every record.

In the workflow diagram, right-click to add states (e.g. Pending Approval, Approved, Rejected) and drag transitions between them.

On each transition, add a Condition (formula or field comparison, e.g. {approvalstatus} = 'Pending') so the record only moves when the business rule is met.

Attach actions to a state or transition: Set Field Value (most common), Send Email, Create Record, Go To Record, Add Button to Form (for user-initiated transitions), or Custom Action Script for anything the point-and-click actions cannot do.

Set Execute As Admin on actions that need to write to fields the running user's role cannot normally edit (common with approval workflows run by non-admin approvers).

Change the workflow's release status from Testing to Released once verified - Testing-status workflows only execute for the workflow's Initiated By/owner user, which is the most common reason a finished workflow appears to do nothing for other users.

## Sections

### Client vs server triggers, and why an action does not fire

**Body:**

Client-triggered actions (field change, page init, save) run in the browser and can only use client-safe actions like Set Field Value and Show/Hide fields - they cannot query other records reliably or send email. Server-triggered actions (before submit, after submit, scheduled) run on the server and can do everything client actions can plus create records, send email, and run custom action scripts with full server-side APIs.

A frequent build mistake is putting a Send Email or Create Record action on a client-context trigger, where it silently does nothing because those actions require server execution context. Check the Trigger Type dropdown at the top of the workflow (or per-action override) matches what the action actually needs.

### Conditions: formula vs simple field comparison

**Body:**

Transition and action conditions can be a simple field/value comparison or a Formula condition using the same Oracle SQL syntax as saved search formula fields, including CASE WHEN and joined fields. Formula conditions are necessary for anything beyond a single equality check, such as comparing two fields on the record or checking a calculated total.

Workflow field references use the same {fieldid} syntax as saved search, but only fields already present on the form/record sourced into the workflow context are reliably available - custom fields not on the current form can still usually be referenced by script ID directly.

**Code:**

- -- Formula condition example on a transition
CASE WHEN {total} > 5000 THEN 'T' ELSE 'F' END

### Custom action scripts for logic beyond the action palette

**Body:**

When the built-in actions (Set Field Value, Create Record, Send Email, Sublist actions) cannot express the needed logic, attach a Custom Action script (SuiteScript 2.x workflow action script type) to the state or transition. It receives the workflow context and record, and can call any server-side N/record, N/search or N/email API before returning control to the workflow.

Custom action scripts deployed to a workflow still consume SuiteScript governance the same as any other script, and errors inside them can silently stall a workflow (record stuck in a state) rather than throwing a visible user error, so log liberally with N/log during development.

### Approval routing patterns

**Body:**

The common approval pattern uses a Pending Approval state with two outbound transitions (Approve, Reject) each guarded by a button action added to the record's Actions menu via Add Button to Form, visible only to users in an Approver role/group. Route to different approvers by branching transitions on a formula condition (e.g. amount threshold) into parallel Pending Approval states, or by dynamically setting an approver field with Set Field Value before entering the state and referencing it in a Send Email action's recipient field.

## Pitfalls

- Leaving the workflow in Testing status after validating it - only the owner sees it run; everyone else sees nothing happen.
- Putting a server-only action (Send Email, Create Record) on a client trigger where it never executes.
- Approval actions failing silently for non-admin approvers because Execute As Admin was not set on the field-write action.
- Formula conditions referencing a field not sourced into the current form context, evaluating as null/false unexpectedly.
- Custom action script errors stalling records in a state with no visible error to the end user.
- Workflow scheduled to run on a large record set without filtering the initiation condition, causing long-running or throttled execution.

## Ai Angle

ERPray can walk through an existing workflow's states, transitions and conditions in plain language when someone asks "why is this purchase order not moving to approved", tracing which condition is failing without the user opening the SuiteFlow diagram. For new workflow builds, SyteRay-style scripted assistance can draft the custom action script for logic the point-and-click actions cannot express, which a developer then reviews and deploys.

## Faq

### Why does my workflow work for me but not for other users?

**Answer:** The workflow release status is likely still Testing rather than Released. Testing-status workflows only execute for the user who owns/initiated them; change the status via the workflow's release dropdown once testing is complete.

### Can a NetSuite workflow send email to someone outside the record's normal contacts?

**Answer:** Yes, via a Send Email action with a specific address, a field reference, or a role/group as recipient, but Send Email only works on a server-triggered action, not a client trigger.

### What is the difference between a workflow action script and a user event script?

**Answer:** A workflow action script only runs when attached to a specific workflow state or transition and receives workflow context; a user event script runs on every applicable record operation regardless of workflow state, with record and execution context instead.

### Can workflows update fields the current user's role cannot normally edit?

**Answer:** Yes, if the action has Execute As Admin enabled, the field write runs with elevated permissions regardless of the triggering user's role restrictions.

## Search terms

netsuite suiteflow tutorial, netsuite workflow builder, netsuite approval workflow, netsuite workflow not triggering, netsuite workflow custom action script, netsuite workflow execute as admin, netsuite workflow formula condition, netsuite workflow client vs server trigger, netsuite workflow testing vs released, netsuite workflow send email action

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
