Apply StoneOS Industry Package
Proposes an industry package for a business unit, previews it and waits for a person with permission to approve.
Proposes a StoneOS industry package for a business unit, creates its preview and returns a suspend signal; the later decision of a person is mapped to applied, rejected, timeout or partial through the orchestrator resume operation.
How it works
- Resolves the config and merges it over the incoming payload (config wins). If the result has a
resumeobject, it skips the proposal and maps the decision (last step). - Checks
unitandpackage_id, and that the StoneOS industry service is configured. - Calls the service as a service identity acting on behalf of
approver_role(defaultadministrator). - Creates a change with
package_id,business_unit_code(fromunit),role(defaultprincipal),size,jurisdictionandreasons(reason, or a default text naming the package), then requests its preview, which must returninstallation_idandinstallation_preview_hash. - Returns
{ __signal: "SUSPEND", __metadata: { type: "stoneos_industry_change", id, installation_id, preview_hash, expires_in_ms, resume_on } }. The envelope has no port, so the engine routes it toout, which this node does not declare: the branch ends and the run completes. - Resume: the system that holds the decision calls the orchestrator resume operation with
workflow_instance_id,node_id, optionalgraphandinput, andresume{ change_id, state, port?, approver, applied_apps?, failed_app?, error_code? }. The worker runs again in resume mode and picks the port fromresume.portorresume.state; withgraphandnode_id, a new run starts from the nodes connected to that port, withdataas payload.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-apply-industry",
"label": "Apply industry package",
"operator_slug": "stoneos.industry.apply",
"operator_version": "1.0.0",
"config": {
"unit": "{{ $json.business_unit_code }}",
"package_id": "<package_id>",
"role": "principal",
"reason": "New business unit onboarding",
"approver_role": "administrator",
"timeout_ms": 259200000
}
}{
"ok": true,
"data": {
"change_id": "chg-xxxxxxxxxxxx",
"state": "applied",
"applied_apps": [
"stoneos-notes",
"stoneos-todo"
],
"approver": "[email protected]"
},
"port": "applied",
"meta": {
"approver": "[email protected]"
}
}Configuration
-
unitstring Required -
Business unit code (expression allowed)
-
package_idstring Required -
proposal_idstring Optional -
rolestring Optional -
sizestring Optional -
jurisdictionstring Optional -
Jurisdiction code; defaults to the organization one
-
reasonstring Optional -
operationstring Optional -
approver_rolestring Optional -
timeout_msinteger Optional
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
resume - Not declared. When the config or the incoming payload carries
resume, the node maps it to a port instead of proposing a change. -
proposal_id - Declared but ignored, like
operation. -
timeout_ms - Default 72 hours. Only returned as
__metadata.expires_in_ms; the orchestrator does not enforce it.timeoutcomes only from a resume with statetimeout.
Output ports
applied default Resume with state applied and an approver. The only port with ok: true.
{
"change_id": "chg-xxxxxxxxxxxx",
"state": "applied",
"applied_apps": [
"stoneos-notes",
"stoneos-todo"
],
"approver": "[email protected]"
}rejected Resume with state rejected and an approver.
{
"change_id": "chg-xxxxxxxxxxxx",
"state": "rejected",
"applied_apps": [],
"approver": "[email protected]"
}timeout Resume with state timeout; no approver is required.
{
"change_id": "chg-xxxxxxxxxxxx",
"state": "timeout",
"applied_apps": []
}partial Resume with state partial and an approver: some apps were applied and failed_app names the one that failed.
{
"change_id": "chg-xxxxxxxxxxxx",
"state": "partial",
"applied_apps": [
"stoneos-notes"
],
"failed_app": "stoneos-todo",
"approver": "[email protected]"
}error A proposal step failed, or the resume is invalid or reports an error. data carries only error_code; the message is in the envelope error field, which does not reach the next node.
{
"error_code": "missing_unit"
}In expressions
What a later node can read from this node's output with $("Apply StoneOS Industry Package").item.json.<path> (write your node's label instead of Apply StoneOS Industry Package). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through applied, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Apply StoneOS Industry Package").item.json.change_id | ||
$("Apply StoneOS Industry Package").item.json.state | ||
$("Apply StoneOS Industry Package").item.json.applied_apps | ||
$("Apply StoneOS Industry Package").item.json.failed_app | — | |
$("Apply StoneOS Industry Package").item.json.approver | ||
$("Apply StoneOS Industry Package").item.json.error_code | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
Errors
| Message | Port | Cause and fix |
|---|---|---|
Missing 'unit' | error | No business unit code. error_code: missing_unit. |
Missing 'package_id' | error | No package. error_code: missing_package_id. |
services.stoneosIndustry.uri is not resolved | error | The orchestrator has no StoneOS industry service configured. error_code: service_not_configured. |
The change was not created | error | The service answered without a change id. error_code: change_not_created. |
The change preview was not created | error | The preview has no installation_id or installation_preview_hash. error_code: preview_failed. |
<HTTP error message> | error | The service rejected a call; its own error_code is used when it sends one. error_code: request_failed. |
Unknown resume state '<port>' | error | The resume port is not applied, rejected, timeout, partial or error. error_code: unknown_resume_state. |
The '<port>' port needs the person who approved | error | applied, rejected and partial require resume.approver. error_code: approval_missing. |
<resume error> | error | The resume reports port or state error; data keeps the resume fields plus error_code (default apply_failed). |
Input contract
-
unitstring Optional -
package_idstring Optional -
proposal_idstring Optional -
rolestring Optional -
sizestring Optional -
operationstring Optional -
approver_rolestring Optional -
timeout_msinteger Optional
Output contract
-
change_idstring Optional -
statestring Optional -
applied_appsarray<string> Optional -
failed_appstring Optional -
approverstring Optional -
error_codestring Optional
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "stoneos.industry.apply",
"name": "Apply StoneOS Industry Package",
"category": "hitl",
"version": "1.0.0",
"description": "Proposes an industry package for a business unit, previews it and waits for a person with permission to approve. The app applies the change; the worker only proposes, waits and resumes.",
"capabilities": [
"industry",
"configuration",
"human"
],
"config_schema": {
"type": "object",
"required": [
"unit",
"package_id"
],
"properties": {
"unit": {
"type": "string",
"title": "Business unit",
"description": "Business unit code (expression allowed)"
},
"package_id": {
"type": "string",
"title": "Package"
},
"proposal_id": {
"type": "string",
"title": "Proposal"
},
"role": {
"type": "string",
"enum": [
"principal",
"complement"
],
"default": "principal"
},
"size": {
"type": "string",
"title": "Size"
},
"jurisdiction": {
"type": "string",
"title": "Jurisdiction",
"description": "Jurisdiction code; defaults to the organization one"
},
"reason": {
"type": "string",
"title": "Reason"
},
"operation": {
"type": "string",
"title": "Operation"
},
"approver_role": {
"type": "string",
"default": "administrator",
"title": "Approver role"
},
"timeout_ms": {
"type": "integer",
"default": 259200000
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"properties": {
"unit": {
"type": "string"
},
"package_id": {
"type": "string"
},
"proposal_id": {
"type": "string"
},
"role": {
"type": "string"
},
"size": {
"type": "string"
},
"operation": {
"type": "string"
},
"approver_role": {
"type": "string"
},
"timeout_ms": {
"type": "integer"
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"change_id": {
"type": "string"
},
"state": {
"type": "string"
},
"applied_apps": {
"type": "array",
"items": {
"type": "string"
}
},
"failed_app": {
"type": "string"
},
"approver": {
"type": "string"
},
"error_code": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "applied",
"label": "Applied",
"is_default": true,
"description": "Approved and applied"
},
{
"port_id": "rejected",
"label": "Rejected",
"description": "A person rejected the change"
},
{
"port_id": "timeout",
"label": "Timeout",
"description": "Nobody decided in time"
},
{
"port_id": "partial",
"label": "Partial",
"description": "Applied halfway; the flow decides"
},
{
"port_id": "error",
"label": "Error",
"description": "Carries error_code"
}
],
"execution_mode": "async",
"tags": [
"industry",
"configuration",
"human"
],
"is_stateful": true,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"unit",
"package_id"
],
"properties": {
"unit": {
"type": "string",
"title": "Business unit",
"description": "Business unit code (expression allowed)"
},
"package_id": {
"type": "string",
"title": "Package"
},
"proposal_id": {
"type": "string",
"title": "Proposal"
},
"role": {
"type": "string",
"enum": [
"principal",
"complement"
],
"default": "principal"
},
"size": {
"type": "string",
"title": "Size"
},
"jurisdiction": {
"type": "string",
"title": "Jurisdiction",
"description": "Jurisdiction code; defaults to the organization one"
},
"reason": {
"type": "string",
"title": "Reason"
},
"operation": {
"type": "string",
"title": "Operation"
},
"approver_role": {
"type": "string",
"default": "administrator",
"title": "Approver role"
},
"timeout_ms": {
"type": "integer",
"default": 259200000
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"properties": {
"unit": {
"type": "string"
},
"package_id": {
"type": "string"
},
"proposal_id": {
"type": "string"
},
"role": {
"type": "string"
},
"size": {
"type": "string"
},
"operation": {
"type": "string"
},
"approver_role": {
"type": "string"
},
"timeout_ms": {
"type": "integer"
}
}
}{
"type": "object",
"properties": {
"change_id": {
"type": "string"
},
"state": {
"type": "string"
},
"applied_apps": {
"type": "array",
"items": {
"type": "string"
}
},
"failed_app": {
"type": "string"
},
"approver": {
"type": "string"
},
"error_code": {
"type": "string"
}
}
}[
{
"port_id": "applied",
"label": "Applied",
"is_default": true,
"description": "Approved and applied"
},
{
"port_id": "rejected",
"label": "Rejected",
"description": "A person rejected the change"
},
{
"port_id": "timeout",
"label": "Timeout",
"description": "Nobody decided in time"
},
{
"port_id": "partial",
"label": "Partial",
"description": "Applied halfway; the flow decides"
},
{
"port_id": "error",
"label": "Error",
"description": "Carries error_code"
}
]Execution
- Execution
async- Stateful
- Yes
- Retries (
retryOnFail) - No
- Credentials
- Resolved on the server from
connection_id; the secret never reaches the workflow. - Capabilities
industryconfigurationhuman- Tags
industryconfigurationhuman
Notes and limits
- The change request sends
workflow_instance_idandnode_idempty (the worker reads them from fields the runtime does not set), so the service is not told which run proposed the change; the caller of the resume operation must supplyworkflow_instance_id,node_idandgraph. - The continuation is a new run: outputs of the nodes before this one are not available (
$("Node")is empty) and$inputis the resumeinput. rejected,timeoutandpartialhaveok: falsebut still follow their own port. The worker only proposes and waits; applying the package is done by the StoneOS app after approval.
Reviewed against the orchestrator code · 31e874b · 2026-11-26