{#if !$userStore?.operator}
(metadataOpen = false)}>
MetadataRuntime
Generated UI
The arguments are synced with the main signature but you may refine the parts that
cannot be inferred from the type directly.
{#if lockedLanguage}
As a forked script, the language '{script.language}' cannot be modified.
{/if}
{#each langs as [label, lang]}
{@const isPicked = script.language == lang && template == 'script'}
{label} is only available with an enterprise license
{/each}
Tag this script's purpose within flows such that it is available as the
corresponding action.
{
template = 'script'
script.kind = detail
initContent(script.language, detail, template)
}}
>
{#each scriptKindOptions as { value, title, desc, documentationLink, Icon }}
{/each}
The script will be executed on a worker configured to accept its worker group
tag. For instance, you could setup an "highmem", or "gpu" worker group.
{#if $workerTags}
{#if $workerTags?.length > 0}
{:else}
No custom worker group tag defined on this instance in "Workers {'->'} Assignable
Tags"
{
if (script.cache_ttl && script.cache_ttl != undefined) {
script.cache_ttl = undefined
} else {
script.cache_ttl = 300
}
}}
options={{
right: 'Cache the results for each possible inputs'
}}
/>
How long to the keep cache valid
{#if script.cache_ttl}
{:else}
{/if}
{
if (script.dedicated_worker) {
script.dedicated_worker = undefined
} else {
script.dedicated_worker = true
}
}}
options={{
right: 'Script is run on dedicated workers'
}}
/>
{#if script.dedicated_worker}
One worker in a worker group needs to be configured with dedicated worker
set to:
{$workspaceStore}:{script.path}
{/if}
In this mode, the script is meant to be run on dedicated workers that run the
script at native speed. Can reach >1500rps per dedicated worker. Only
available on enterprise edition and for Python3, Deno and Bun. For other
languages, the efficiency is already on par with deidcated workers since they
do not spawn a full runtime
{#if !isCloudHosted()}
0}
on:change={() => {
if (script.priority) {
script.priority = undefined
} else {
script.priority = 100
}
}}
options={{
right: 'Label as high priority'
}}
>
{
if (script.priority && script.priority > 100) {
script.priority = 100
} else if (script.priority && script.priority < 0) {
script.priority = 0
}
}}
/>
Jobs from script labeled as high priority take precedence over the other
jobs when in the jobs queue.
{#if !$enterpriseLicense}This is a feature only available on enterprise
edition.{/if}
{/if}
{#if !isCloudHosted()}
Additional static custom env variables to pass to the script.
{#if script.envs && script.envs.length > 0}
Static envs variables are not passed in preview but solely on deployed
scripts.
{/if}
Format is: `{'='}`
{#if Array.isArray(script.envs ?? [])}
{#each script.envs ?? [] as v, i}