v1

latestOpenAPI 3.0.42026-08-068161,1253.1 MB
Luau Execution
Places

Create Luau Execution Session Task

Creates a task but does not wait for the task to complete.

To check whether a task has completed, call the GetLuauExecutionSessionTask method and inspect the state field of the returned resource.

Quotas:

  • 5 calls per minute per API key owner
  • 45 calls per minute per IP address
post/cloud/v2/universes/{universe_id}/places/{place_id}/luau-execution-session-tasks

Path parameters

universe_idstring required

The universe ID.

place_idstring required

The place ID.

Request body

pathstring

The resource path of the luau execution session task.

Formats:

  • universes/{universe_id}/places/{place_id}/luau-execution-session-tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/versions/{place_version_id}/luau-execution-session-tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/luau-execution-sessions/{luau_execution_session_id}/tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/versions/{place_version_id}/luau-execution-sessions/{luau_execution_session_id}/tasks/{luau_execution_session_task_id}
createTimestring date-time

Time when this task was created.

updateTimestring date-time

Time when this task's state last changed.

userstring

The user that created the API key that was used to create this task.

state'STATE_UNSPECIFIED' | 'QUEUED' | 'PROCESSING' | 'CANCELLED' | 'COMPLETE' | 'FAILED' enum

The task's state. See the State enum for information about each possible value.

Possible values:

ValueDescription
STATE_UNSPECIFIEDUNSPECIFIED
QUEUEDThe Task is waiting to be processed.
PROCESSINGThe Task has been picked up for processing.
CANCELLEDThe Task has been stopped by the user.
COMPLETEThe Task has finished processing. The output field contains the output.
FAILEDThe Task failed. The error field contains details about the error.
scriptstring

The script to be run as part of this task.

For example:

local x = 3
local y = 4
return x + y
timeoutstring duration

Limit for how long the script can run.

The task fails if the script does not complete within the specified duration.

Defaults to 5 minutes.

binaryInputstring

Resource path of the binary input to this task. See the documentation for the LuauExecutionSessionTaskBinaryInput resource for usage details.

enableBinaryOutputboolean

If set to true, allows the task to output a large binary object in addition to standard return values.

If enable_binary_output is set to true, the task script must return a LuauExecutionTaskOutput (or equivalent table) and no other return values.

Below is example code for doing so:

local buf: buffer = buffer.create(10)
local result: LuauExecutionTaskOutput = {
  BinaryOutput = buf,
  ReturnValues = { "hello world", 123 }
}
return result

The BinaryOutput buffer must be no larger than 256 MiB in size.

The ReturnValues array, if given, will be serialized to JSON and made available in the output field of the LuauExecutionSessionTask resource, similar to regular return values when not using enable_binary_output.

The binary output can be fetched from the URI in the binaryOutputUri field after the task completes. The binaryOutputUri is valid for 15 minutes after task completion.

binaryOutputUristring

URI for the binary output of this task. See the enableBinaryOutput field for usage details.

Example request

{
  "path": "universes/123/places/123/luau-execution-session-tasks/123e4567-e89b-12d3-a456-426655440000",
  "createTime": "2023-07-05T12:34:56Z",
  "updateTime": "2023-07-05T12:34:56Z",
  "state": "STATE_UNSPECIFIED",
  "timeout": "3s",
  "error": {
    "code": "ERROR_CODE_UNSPECIFIED"
  },
  "enableBinaryOutput": true
}

Response

OK

pathstring

The resource path of the luau execution session task.

Formats:

  • universes/{universe_id}/places/{place_id}/luau-execution-session-tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/versions/{place_version_id}/luau-execution-session-tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/luau-execution-sessions/{luau_execution_session_id}/tasks/{luau_execution_session_task_id}
  • universes/{universe_id}/places/{place_id}/versions/{place_version_id}/luau-execution-sessions/{luau_execution_session_id}/tasks/{luau_execution_session_task_id}
createTimestring date-time

Time when this task was created.

updateTimestring date-time

Time when this task's state last changed.

userstring

The user that created the API key that was used to create this task.

state'STATE_UNSPECIFIED' | 'QUEUED' | 'PROCESSING' | 'CANCELLED' | 'COMPLETE' | 'FAILED' enum

The task's state. See the State enum for information about each possible value.

Possible values:

ValueDescription
STATE_UNSPECIFIEDUNSPECIFIED
QUEUEDThe Task is waiting to be processed.
PROCESSINGThe Task has been picked up for processing.
CANCELLEDThe Task has been stopped by the user.
COMPLETEThe Task has finished processing. The output field contains the output.
FAILEDThe Task failed. The error field contains details about the error.
scriptstring

The script to be run as part of this task.

For example:

local x = 3
local y = 4
return x + y
timeoutstring duration

Limit for how long the script can run.

The task fails if the script does not complete within the specified duration.

Defaults to 5 minutes.

binaryInputstring

Resource path of the binary input to this task. See the documentation for the LuauExecutionSessionTaskBinaryInput resource for usage details.

enableBinaryOutputboolean

If set to true, allows the task to output a large binary object in addition to standard return values.

If enable_binary_output is set to true, the task script must return a LuauExecutionTaskOutput (or equivalent table) and no other return values.

Below is example code for doing so:

local buf: buffer = buffer.create(10)
local result: LuauExecutionTaskOutput = {
  BinaryOutput = buf,
  ReturnValues = { "hello world", 123 }
}
return result

The BinaryOutput buffer must be no larger than 256 MiB in size.

The ReturnValues array, if given, will be serialized to JSON and made available in the output field of the LuauExecutionSessionTask resource, similar to regular return values when not using enable_binary_output.

The binary output can be fetched from the URI in the binaryOutputUri field after the task completes. The binaryOutputUri is valid for 15 minutes after task completion.

binaryOutputUristring

URI for the binary output of this task. See the enableBinaryOutput field for usage details.

Example response

{
  "path": "universes/123/places/123/luau-execution-session-tasks/123e4567-e89b-12d3-a456-426655440000",
  "createTime": "2023-07-05T12:34:56Z",
  "updateTime": "2023-07-05T12:34:56Z",
  "state": "STATE_UNSPECIFIED",
  "timeout": "3s",
  "error": {
    "code": "ERROR_CODE_UNSPECIFIED"
  },
  "enableBinaryOutput": true
}