agentleFS
OrderfulOrderful/orderful-netsuite-skills/skills/manage-deployments/SKILL.md

manage-deployments

Skill7 starsChanged 4 months agoApache-2.0View on GitHub

Inspect and retune the Orderful SuiteApp's own script deployments in a customer's NetSuite — schedule status, Repeat cadence, Start Time, Log Level, Deployed — and submit a deployment for an immediate run. Use when the poller or a map/reduce isn't running, when a cadence needs changing for a backfill or a demo, when checking whether a customer's install is complete, or when the user says "/manage-deployments", "is the poller scheduled for <customer>", "set the poller to every 5 minutes", "turn off the outbound sending MR", "what script deployments does <customer> have", "why isn't the consolidation MR running", or "schedule the transaction processor".

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check ENVIRONMENT in that .env before any set or run.

    line 42
  2. Very specific:

    Read the select options before setting --repeat.

    line 65
  3. Very specific:

    Only map/reduce and scheduled deployments can be submitted.

    line 94
  4. Very specific:

    Never run set or run without an explicit customer slug: Ask; don't pick one.

    line 119
  5. Very specific:

    Report unchanged fields as a failure, not a footnote: If the save didn't persist, the customer's schedule is still whatever it was.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Manage Script Deployments

Reads and changes the scheduling state of the deployments the Orderful SuiteApp ships, through the agent RESTlets (customscript_orderful_agent_read_rl / _write_rl) over TBA. Four commands: list, describe, set, run.

This is the lever behind every conversation that used to end with "open their NetSuite and go to Customization > Scripting > Script Deployments".

What NetSuite lets you change, and what it doesn't

This is the part to internalise before promising a customer anything. The SuiteScript scriptdeployment record exposes 21 fields — a strict subset of what SDF's <recurrence> block can express. Verified against the Records Browser (2025.1) and by probing the scriptdeployment analytics table on a live account:

LeverThis skillSuiteQL can read itWhy
status — Scheduled / Not Scheduled / Testingyesyeson the record
recurrenceminutes — the "Repeat" cadenceyesnoon the record, absent from the analytics table
starttime — Start Timeyesnosame
isdeployed — the Deployed checkboxyesyeson the record
loglevelyesyeson the record
Start Date, every-N-days, weekly/monthly patternsnonoSDF/UI only — not on the SuiteScript record at all
Concurrency limit, buffer size, yield-after-minutesno (read-only)yesreadable via SuiteQL, not writable from script
Script parameter values (custscript_*)no—most Orderful params are company-level; use the SPA or /set-feature-flag

Two consequences that shape how you use this:

  1. list cannot show cadence. recurrenceminutes is not a column on the scriptdeployment table. Only describe, which loads the record server-side, can report Repeat and Start Time. So: list to find the deployment, describe to see its schedule.
  2. "Run every 15 minutes starting Tuesday" is two different asks. The interval is yours; the start date is not. If someone needs the calendar pattern changed, that is an SDF change in the SuiteApp or a manual edit in their NetSuite UI — say so rather than half-doing it.

Script IDs are not unique — always pass both

Every command takes <scriptId> <deploymentId>, and both are required. Deployment script ids are unique per script, not per account. A probe of one live account found customdeploy1 on 25 different scripts, two of them Orderful's (customscript_orderful_bulk_unpack_mr and customscript_orderful_outboundrunctrl_mr). A deployment id on its own does not identify anything.

The recipe

Step 1 — Pick the customer

List ~/orderful-onboarding/ and confirm which customer. If the dir has no .env, stop and direct the user to /netsuite-setup.

Check ENVIRONMENT in that .env before any set or run. Changing a schedule in production is a production change.

Step 2 — List what's there

node skills/manage-deployments/manage-deployments.mjs list ~/orderful-onboarding/<slug>

Shows the deployments with a schedule. --all widens to user event, workflow action, client and suitelet deployments (useful when auditing an install, useless for scheduling).

The output also names any deployment the SuiteApp ships that this account does not have. That is a real signal: the customer is on an older SuiteApp version, or an install failed partway. Cross-check against project_suiteapp_failed_installs history before assuming it's benign.

Fallback behaviour: if the account's SuiteApp predates this feature, list automatically falls back to plain SuiteQL and says so. The fallback is scoped by scriptid prefix rather than by the SuiteApp's generated config, so it also shows the agent RESTlets themselves — handy for confirming whether the endpoint is installed at all. describe, set and run have no fallback and will tell you to use the NetSuite UI.

Step 3 — Describe the one you care about

node skills/manage-deployments/manage-deployments.mjs describe ~/orderful-onboarding/<slug> \
  customscript_orderful_inbound_mr customdeploy_orderful_inbound_mr

Returns current status / recurrenceminutes / starttime / isdeployed / loglevel, the select options NetSuite will accept for each in that account, and the last five runs from scheduledscriptinstance.

Read the select options before setting --repeat. They are read at runtime rather than hardcoded, because the menu varies by account — and if NetSuite refuses to enumerate them from a server-side load, the output says so explicitly instead of offering a guessed list.

The run history answers the question status = SCHEDULED does not: is this thing actually running? A deployment can be Scheduled and have no instance in weeks.

Step 4 — Change it

# Schedule the poller every 15 minutes
node skills/manage-deployments/manage-deployments.mjs set ~/orderful-onboarding/<slug> \
  customscript_orderful_inbound_mr customdeploy_orderful_inbound_mr \
  --status=SCHEDULED --repeat=15

# Stop a map/reduce
node skills/manage-deployments/manage-deployments.mjs set ~/orderful-onboarding/<slug> \
  customscript_orderful_outbound_sending customdeploy_orderful_status_send_deploy \
  --status=NOTSCHEDULED

Options: --status, --repeat=<minutes>, --start-time="7:00 am", --log-level, --deployed=true|false.

The RESTlet re-reads the record after saving and reports a before/after for every field. If a field comes back unchanged, the command exits non-zero and says so. That case is real: a publisher-locked deployment can accept the setValue, accept the save, and keep the prior value. Without the re-read you would report success on a change that never happened.

Step 5 — Run one on demand

node skills/manage-deployments/manage-deployments.mjs run ~/orderful-onboarding/<slug> \
  customscript_orderful_transaction_mr customdeploy_orderful_transaction_mr

Only map/reduce and scheduled deployments can be submitted; anything else is refused with the reason. Returns a taskId — hand it to monitor-mr rather than polling here.

For the inbound poller specifically, run-poller still works on older SuiteApp versions, because it uses the long-standing triggerInboundPolling action instead.

Required role permissions

Same as run-poller: on Setup > Users/Roles > Manage Roles > [role] > Permissions > Setup, the token's role needs Log in using Access Tokens = Full, REST Web Services = Full, SuiteScript = Full, and SuiteScript Scheduling (row only, no level) for run.

On SuiteApp versions before 1.25.0 the agent RESTlets reject Administrator outright — their audience is customrole_orderful_agent_writer only, and you get INSUFFICIENT_PERMISSION from the platform before the script runs. Bind the token to that role.

Troubleshooting

SymptomCauseFix
list prints "(via SuiteQL …)"The account's SuiteApp has no listScriptDeployments actionExpected on older versions. describe/set/run are unavailable; use the NetSuite UI or upgrade
describe/set/run fail with "no ... action"Same version gapNetSuite UI: Customization > Scripting > Script Deployments
INSUFFICIENT_PERMISSION before any of our JSONPlatform-level rejection — the call never reached our codeRole audience (see above), not attribution
"is not an Orderful SuiteApp deployment"The pair isn't in the SuiteApp's generated script configThis surface only manages deployments the SuiteApp ships. Run list for the inventory
"Unsupported field(s): concurrencylimit"Asking for an SDF/UI-only fieldSee the table at the top — those need an SDF deploy or a UI edit
"has no schedule"Targeting a user event / workflow action / client deploymentOnly map/reduce and scheduled deployments have a Schedule tab
WARNING: NetSuite kept the prior valuePublisher-locked fieldChange it in the NetSuite UI, or ship it via SDF in the SuiteApp
"is not installed in this account"Deployment exists in the SuiteApp but not in this accountOlder SuiteApp version, or a partial install — check list's missing section

Behaviour rules

  1. Never run set or run without an explicit customer slug. Ask; don't pick one.
  2. describe before set. You need the current value to say what you changed, and the select options to pick a legal --repeat.
  3. Confirm before any set against ENVIRONMENT=production. Turning off a scheduled deployment stops EDI processing for that customer; state exactly which deployment and which field, and wait for a yes.
  4. --deployed=false is not a pause button. It un-deploys the script entirely, which for a user event deployment silently stops SuiteApp processing on that record type. Use --status=NOTSCHEDULED to stop a schedule.
  5. Report unchanged fields as a failure, not a footnote. If the save didn't persist, the customer's schedule is still whatever it was.
  6. Don't poll for completion after run. Return the taskId and follow through with monitor-mr.
  7. Don't paste TBA secrets into chat. Everything stays in the customer's .env.

Reference material

  • Agent RESTlets: FileCabinet/SuiteApps/com.orderful.orderfulnetsuite/ConfigAndUISupport/orderful_agentRead_RL.ts and orderful_agentWrite_RL.ts in netsuite-connector. Actions used here: listScriptDeployments, describeScriptDeployment, setScriptDeployment, runScriptDeployment
  • Handler module: TransactionHandling/common/deployment.handlers.ts — the allowlist, the field table, and the post-save verification live there
  • NetSuite Records Browser, Script Deployment: the authoritative field list (21 fields) — https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2025_1/script/record/scriptdeployment.html
  • reference/mapreduce-monitoring.md — reading what a run actually did
  • reference/script-execution-map.md — which script owns which part of the flow

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.