Scheduled Scripts on Accounts with Multiple Processors (SuiteCloud Plus)

The number of SuiteCloud processors and CSV imports available are directly dependent upon the number of SuiteCloud Plus (SC+) licenses a company has. Companies can upgrade their number of processors in the SuiteCloud Processor with the purchase of additional SuiteCloud Plus licenses. SuiteCloud Plus allows larger accounts to run multiple scripts in parallel.

For a summary of SuiteCloud Plus capabilities, see SuiteCloud Plus Settings and NetSuite Service Tiers. To purchase or learn more about SuiteCloud Plus, contact your NetSuite account manager.

When you upgrade your account to include multiple script processors, multiple scripts can run in parallel. For example, if two scripts are submitted for processing, the second script may begin before the first script is complete. If you have one script with five deployment instances, all of them could run at the same time.

To process multiple instances of the same scheduled script, developers can create multiple deployments for the same script. Script instances submitted for processing are automatically assigned free processors in an order determined by a scheduler. When there is no free processor, the next script in order waits for one to become free.

Scheduled Scripts Using Queues

Scheduled script deployments created before the introduction of the SuiteCloud Processor may be using queues. A script deployment using a queue submitted for processing is sent to the SuiteCloud Processor according to the order determined by the scheduler just like a deployment without a queue. However, when determining the order, the scheduler must respect the queue for jobs that use it. A script job using a queue must not start before all script jobs submitted earlier using the same queue have completed.

You can use a queue argument to obtain the queue number assigned to a scheduled script. The queue argument is the second argument passed to the main executing function of a scheduled script. (The first argument is the type argument, which you can use regardless of whether you have a SuiteCloud Plus license. For details on the type argument, Executing a Scheduled Script in Certain Contexts.)

The queue argument provides the id of the queue selected in the Queue field of the scheduled script's Script Deployment page, if that deployment uses a queue assignment.

Important:

The queue argument is an auto-generated argument passed by the system. You cannot set this as a parameter for a specific deployment like other function arguments.

If you have purchased one or more SuiteCloud Plus licenses, see SuiteCloud Plus Settings for valid queue argument values. This argument is not applicable when the script instance was created from a deployment that does not use queues.

Example
          function processOrdersCreatedToday( type, queue )
{
 //only execute when run based on the schedule specified on the deployment record in the UI, and the script is in queue 5 

  if ( type != 'scheduled' && type != 'skipped' && queue == 5 ) return ; 
 
.... //process rest of script
 
} 

        

Related Topics

Scheduled Scripts
Overview of Scheduled Script Topics
What Are Scheduled Scripts?
When Will My Scheduled Script Execute?
Submitting a Script for Processing
Creating Multiple Deployments for a Scheduled Script
Using nlapiScheduleScript to Submit a Script for Processing
Understanding Scheduled Script Deployment Statuses
Executing a Scheduled Script in Certain Contexts
Setting Recovery Points in Scheduled Scripts
Understanding Memory Usage in Scheduled Scripts
Monitoring a Scheduled Script's Runtime Status
Monitoring a Scheduled Script's Governance Limits
Scheduled Script Samples
Best Practice: Handling Server Restarts in Scheduled Scripts (SuiteScript 1.0)

General Notices