How to build a workflow in NetSuite with SuiteFlow
how to build a workflow in NetSuite
Also searched as
- netsuite suiteflow tutorial
- how to create an approval workflow in netsuite
- netsuite workflow action script vs button action
- netsuite workflow not triggering
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.
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.
Create a basic approval workflow
- 1Go to Customization > Workflow > Workflows > New (or New Workflow from a record's Customization menu).
- 2Set 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.
- 3Under Initiation, choose On Create, On View, On Update or Scheduled, and set the initial workflow condition if it should not fire for every record.
- 4In the workflow diagram, right-click to add states (e.g. Pending Approval, Approved, Rejected) and drag transitions between them.
- 5On each transition, add a Condition (formula or field comparison, e.g. {approvalstatus} = 'Pending') so the record only moves when the business rule is met.
- 6Attach 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.
- 7Set 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).
- 8Change 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.
Client vs server triggers, and why an action does not fire
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
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.
-- Formula condition example on a transition
CASE WHEN {total} > 5000 THEN 'T' ELSE 'F' ENDCustom action scripts for logic beyond the action palette
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
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.
Common 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.
How an ERP-grounded AI assistant handles this
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.
Frequently asked questions
Why does my workflow work for me but not for other users?
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?
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?
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?
Yes, if the action has Execute As Admin enabled, the field write runs with elevated permissions regardless of the triggering user's role restrictions.
Related
How to use formula fields in a NetSuite saved search
In the saved search Results tab, add a column, set Field to "Formula (Text)", "Formula (Numeric)", "Formula (Date)" or "Formula (Currency)", then type an Oracle SQL expression into the Formula box using curly braces around field IDs, e.g. {trandate} or {item.custitem_weight}. Formula fields can also go on the Criteria tab so you can filter on the calculated value itself.
How-toHow to write and run SuiteQL queries in NetSuite
SuiteQL is NetSuite's read-only SQL dialect over the underlying record tables, run either interactively from Analytics > SuiteQL Query Tool (or the older /app/suiteanalytics query page), through REST at /services/rest/query/v1/suiteql, or programmatically via the N/query module in SuiteScript 2.x. It supports standard SELECT, JOIN, WHERE, GROUP BY and window functions against table names that mostly match record type IDs (transaction, transactionline, item, customer).
How-toHow to create an assembly build or work order in NetSuite
For simple manufacturing with no routing or WIP tracking, use Transactions > Manufacturing > Build Assemblies (or Enter Assembly Build), select the assembly item, quantity, and location, and NetSuite consumes the BOM components and receives the finished item in one transaction. For multi-step production needing routing, WIP accounting or partial completions, create a Work Order (Transactions > Manufacturing > Work Orders) and process it through Work Order Completion, which requires the Advanced Manufacturing feature (SuiteSuccess Manufacturing or WMS add-on) or the Manufacturing bundle.
How-toHow to run intercompany transactions in NetSuite (OneWorld)
Enable the Intercompany Framework and Automated Intercompany Management features (Setup > Company > Enable Features > Company), then create an Intercompany Sales Order or Purchase Order between two subsidiaries in the same NetSuite account; NetSuite auto-generates the matching intercompany transaction on the counterparty subsidiary and posts the elimination journal entries during period close if Advanced Intercompany Journal Entries is also enabled.
Error fixFix NetSuite SSS_USAGE_LIMIT_EXCEEDED Error
SSS_USAGE_LIMIT_EXCEEDED fires when a SuiteScript execution consumes all the governance units (usage points) allotted to its script type before it finishes. Fix it by checking runtime.getCurrentScript().getRemainingUsage() before expensive calls, yielding or rescheduling in Scheduled scripts, and moving heavy record-count work into Map/Reduce, which yields automatically across stages.
Error fixFix NetSuite INVALID_FLD_VALUE Error
INVALID_FLD_VALUE means NetSuite rejected a value you tried to set on a field because it does not match the field's expected type, list option, or reference record. Fix it by confirming the internal ID or text value actually exists on that field's source list and matches the field's value type (text versus list versus record reference) before setting it.
AI for ERPAI agents for NetSuite manufacturing operations
AI agents for NetSuite manufacturing: WIP tracking, routing exceptions, and work order status grounded in SuiteQL, with human approval on anything that writes back.
Stuck on Oracle NetSuite?
Talk to engineers who work inside Oracle NetSuite every week, and who build private AI that answers these questions from your own ERP data.