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

# GS2-JobQueue Transaction Actions

Specification of verify/consume/acquire transaction actions





## Consume Action



### Gs2JobQueue:DeleteJobByUserId

Delete a job by User ID

Deletes a specific job from the specified user's job queue.
The job is removed regardless of its execution state.

**Quantity specification supported: NO**

**Reversible action: NO**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| jobName | string |  | ✓| UUID |  ~ 36 chars | Job Name<br>Maintains a unique name for each job.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each job. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2JobQueue:DeleteJobByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "jobName": "[string]Job Name",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2JobQueue:DeleteJobByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  jobName: "[string]Job Name"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("jobQueue").consume.delete_job_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    jobName="[string]Job Name",
    timeOffsetToken="[string]Time offset token",
})
```


---

## Acquire Action



### Gs2JobQueue:PushByUserId

Register jobs by User ID

Registers one or more jobs to the user's job queue (up to 10 at a time).
Each job specifies a GS2-Script to execute, its arguments, and a maximum retry count.
If enableAutoRun is enabled on the Namespace, jobs are executed immediately and asynchronously after registration, and the autoRun flag in the response is set to true.
If enableAutoRun is disabled, jobs are queued and must be executed manually via the Run API, with the autoRun flag set to false.

**Quantity specification supported: NO**

**Reversible action: NO**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| jobs | List&lt;JobEntry&gt; |  | |  | 0 ~ 10 items | List of jobs to add |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2JobQueue:PushByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "jobs": [
            {
                "scriptId": "[string]Script GRN",
                "args": "[string]Argument",
                "maxTryCount": "[int]Maximum Number of Attempts"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2JobQueue:PushByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  jobs: 
    - scriptId: "[string]Script GRN"
      args: "[string]Argument"
      maxTryCount: "[int]Maximum Number of Attempts"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("jobQueue").acquire.push_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    jobs={
        {
            scriptId="[string]Script GRN",
            args="[string]Argument",
            maxTryCount="[int]Maximum Number of Attempts"
        }
    },
    timeOffsetToken="[string]Time offset token",
})
```


---



