> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-SkillTree Script Trigger Reference

Reference for event triggers that call extended scripts



## Trigger

### release

Release node

**Related methods:**
release - Release a node


#### Synchronous Execution Script

The script is executed synchronously before the release node process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| oldStatus | [Status](../sdk/#status) | Status before update |
| newStatus | [Status](../sdk/#status) | Status after update |
| userId | string | User ID |
| nodeModelNames | [] | List of node model names |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow release node |

##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local userId = args.userId
local nodeModelNames = args.nodeModelNames

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### Asynchronous Execution Script

The script is executed asynchronously after the release node process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| oldStatus | [Status](../sdk/#status) | Status before update |
| newStatus | [Status](../sdk/#status) | Status after update |
| userId | string | User ID |
| nodeModelNames | [] | List of node model names |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local userId = args.userId
local nodeModelNames = args.nodeModelNames

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}
```


---
  
### restrain

Restrain node

**Related methods:**
markRestrain - Revert a node to unreleased state
markRestrainByUserId - Revert a node to unreleased state by User ID
restrain - Restrain a node


#### Synchronous Execution Script

The script is executed synchronously before the restrain node process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| userId | string | User ID |
| oldStatus | [Status](../sdk/#status) | Status before update |
| newStatus | [Status](../sdk/#status) | Status after update |
| nodeModelNames | [] | List of node model names |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow restrain node |

##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local userId = args.userId
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local nodeModelNames = args.nodeModelNames

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### Asynchronous Execution Script

The script is executed asynchronously after the restrain node process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| userId | string | User ID |
| oldStatus | [Status](../sdk/#status) | Status before update |
| newStatus | [Status](../sdk/#status) | Status after update |
| nodeModelNames | [] | List of node model names |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local userId = args.userId
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local nodeModelNames = args.nodeModelNames

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}
```


---
  



