[Beta] Open Cloud Engine API for Executing Luau

How will rate limiting work on this endpoint, and will any future saves be recorded as individual versions in the place’s history?

1 Like

Good news, we’ve just enabled access to the Source property of scripts via open cloud Luau execution.

We’re working to update the API docs site to make clear that script.Source is only accessible from the Open Cloud Luau Execution API and Plugins.

For anyone who is curious what this means - Roblox’s automated Lua test framework Jest-Roblox now supports module mocking via the script.Source property. One this change makes it into the community fork jsdotlua/jest-lua you will be able to use Jest via the Open Cloud Luau Execution API.

5 Likes

We’ve since fixed this, though we’re still aware of some known issues with the docs that we’re still working on fixing. Thanks for calling this out.

2 Likes

Could we see Player as a creatable instance for testing? Or at least have PlayerAdded fired with a mock player?
It’d be useful for being able to test so much more, like Product purchases, badges, character loading like applying scaling effects to make all characters have a consistent scale GitHub - EgoMoose/rbx-rthro-scaler: A Roblox module that adjusts the height of avatars and retains their proportions., ect.

1 Like

Hi everyone,

Thank you for trying out the beta release of the OpenCloud API for Luau Execution.

As you might know, when running a script inside a Luau Execution task, some engine APIs are blocked. We implemented this to prevent accidental modification of production data.

We are now planning to remove this restriction, so that all engine APIs available to game scripts can be used from Luau Execution task scripts.

To ensure that this change does not happen without your knowledge, we will be removing the universe.place.luau-execution-session:write scope from all API keys that have been used to call the OpenCloud API for Luau Execution, unless you explicitly opt-out. Removal of said scope from a key will prevent it from creating new tasks.

We have already sent out DMs regarding this, but in case you didn’t get one, feel free to DM me if you wish to opt-out.

If you choose to opt-out, then any Luau Execution Session Tasks created by any existing API keys that you own will gain access to previously blocked engine APIs. These engine APIs can access and modify data stored in the cloud. (See the documentation for the complete list of such APIs.)

We will begin removing the scope from API keys tomorrow November 20th at 1pm PST. The engine API restrictions will be lifted shortly after.

2 Likes

The engine API restrictions have been lifted.

For historical reference, this was the list of APIs that were blocked (which are now accessible from task scripts):

  * AssetService:CreatePlaceAsync()
  * AssetService:SavePlaceAsync()
  * DataStoreService:GetDataStore()
  * DataStoreService:GetGlobalDataStore()
  * DataStoreService:GetOrderedDataStore()
  * MemoryStoreService:GetHashMap()
  * MemoryStoreService:GetQueue()
  * MemoryStoreService:GetSortedMap()
  * Players:BanAsync()
  * Players:UnbanAsync()
  * Players:GetBanHistoryAsync()
  * HttpService:GetAsync()
  * HttpService:PostAsync()
  * HttpService:RequestAsync()
  * MessagingService:PublishAsync()
  * MessagingService:SubscribeAsync()
  * DataModel:SavePlace()

@Noble_Draconian @Kampfkarren @pyxfluff @RuizuKun_Dev @ChipioIndustries @ChasingSpace

11 Likes

Thank you, this makes the feature way better now.

Will we see a way to trigger RbxScriptSignals like MouseButton1Click, PlayerAdded, etc anytime soon? I’d love to be able to emulate clicks

2 Likes

We’re thinking about how best to support client testing. What you’re describing sounds a little like connecting an emulated player to the server the task is running in. Would love to learn a bit more.

1 Like

In this case I’m mostly just interested in emulating player clicks and common actions they’d take for better testing workflows (for example i can setup a button, click it, then check the text and if it doesn’t change to an expected value we can expect an error happened). Full client emulations would be cool for testing full on games (like moving the character to a position) but my use case is more for testing something like a shop UI ingame.

Sorry for the delay! I agree, this is a really interesting use case.

I can see a future where we have Lua APIs for player + input emulation (though this is not on the roadmap right now!).

Whether that should be available in this product (which is technically a game server not a client) or whether we should be supporting running Luau as a client is another question.

I think a lot more thought / research is needed here but this is something we’re actively thinking about.

3 Likes

Is that change to jest-lua in pull-request: Merge latest upstream changes by vocksel · Pull Request #16 · jsdotlua/jest-lua · GitHub ?
Currently getting error when Executing: @jsdotlua.jest-runtime.src:1282: debug.loadmodule is not enabled.

I’m very interested in this as well! currently I have my own custom UI input logic and could be modified to handle fake interactions for testing purposes as well

cc @DevelopmentDeadline

My understanding is there is a fix for the debug.loadmoudle dependency in the upstream jest, but this has not been merged in the jsdotlua fork yet: Merge latest upstream changes by vocksel · Pull Request #16 · jsdotlua/jest-lua · GitHub

2 Likes

Would it be possible to enable FFlagEnableLoadModule on the runner so that debug.loadmodule works?

Sorry for the delay!

This is not currently planned, though my understanding is the latest version of Jest-Lua has merged in upstream Jest so now no longer has a dependency on loadmodule for module mocking.

I’ve made a GitHub action for running Luau from a file (and outputting the results to another)!

2 Likes

Hello everyone! Based on feedback, we’ve increased the task time limit from 30 seconds to 5 minutes.

7 Likes

My game has custom attacks and abilities that are based on the position of the character. Simulating physics is crucial for my game to detect when an attack lands. This new feature can help my team easily test abilities using through GitHub Actions, as it can raise a flag if something’s wrong. Even though players won’t be present during the execution, I can mock a player by using an NPC; but currently, I can’t properly mock physics.

1 Like

Thanks for sharing your use case for enabling physics!

If you get the time, I’d love to see some pseudo code of what one of these tests might look like. My DMs are open!

1 Like

Hello everyone! I’m happy to announce two new enhancements we’ve made: structured logs and custom timeouts.

We’re working on getting the documentation updated, but in the meantime you can follow the examples in the rest of this post to use the new features.

Structured Logs

Currently, when retrieving task logs, only the log messages are available. We’ve added a new option to retrieve structured logs that also include metadata, namely the timestamp as well as MessageType of the log entry.

To retrieve logs in the new format, add the URL parameter ?view=STRUCTURED. Here’s an example full URL: https://apis.roblox.com/cloud/v2/universes/6389275850/places/18863827952/versions/34/luau-execution-sessions/a3499fa8-645a-4856-b929-106dd1420b31/tasks/a3499fa8-645a-4856-b929-106dd1420b31/logs?view=STRUCTURED

The structured logs will be in a new field in the response, called structuredMessages. An example response is below:

{
  "luauExecutionSessionTaskLogs": [
    {
      "path": "universes/6389275850/places/18863827952/versions/34/luau-execution-sessions/a3499fa8-645a-4856-b929-106dd1420b31/tasks/a3499fa8-645a-4856-b929-106dd1420b31/logs/1",
      "messages": [],
      "structuredMessages": [
        {
          "message": "TestService: this action is invalid",
          "createTime": "2025-02-13T20:32:41.069Z",
          "messageType": "WARNING"
        }
      ]
    }
  ],
  "nextPageToken": ""
}

Note that using the STRUCTURED view is optional. To continue using the existing behavior, simply leave out the view parameter or set it to FLAT.

Custom Timeouts

You can now customize the task script timeout using a new parameter called timeout in the CreateLuauExecutionSessionTask API.

Here’s an example request body:

{"script": "wait(10)", "timeout": "1s"}

The above will cause the script to timeout after 1 second (instead of the default 5 minutes).

The timeout can be set to any value between 1 second and 300 seconds (5 minutes).

See the documentation for Duration for the formatting of the timeout value.

4 Likes