{@render children?.()} t.draftConfig)} on:canceled={() => { draftTriggersModalOpen = false }} on:confirmed={handleDraftTriggersConfirmed} /> {#if !$userStore?.operator} (metadataOpen = false)} aiId="script-builder-settings" aiDescription="Script builder settings" >
{#if customUi?.settingsPanel?.disableMetadata !== true} {/if} {#if customUi?.settingsPanel?.disableRuntime !== true} {/if} {#if customUi?.settingsPanel?.disableGeneratedUi !== true} {#snippet extra()} The arguments are synced with the main signature but you may refine the parts that cannot be inferred from the type directly. {/snippet} {/if} {#if customUi?.settingsPanel?.disableTriggers !== true} {#snippet extra()} Configure how this script will be triggered. {/snippet} {/if} {#snippet content()}
{#snippet action()} {#if customUi?.settingsPanel?.metadata?.disableMute !== true}
{/if} {/snippet}
{#if !customUi?.settingsPanel?.metadata?.languages || customUi?.settingsPanel?.metadata?.languages?.length > 1}
{#snippet action()} {/snippet} {#if lockedLanguage}
As a forked script, the language '{script.language}' cannot be modified.
{/if}
{#each langs as [label, lang] (lang)} {@const isPicked = (lang == script.language && template == 'script') || (template == 'bunnative' && lang == 'bunnative') || (template == 'docker' && lang == 'docker')} {#snippet text()} {label} is only available with an enterprise license {/snippet} {/each}
{/if} {#if customUi?.settingsPanel?.metadata?.disableScriptKind !== true}
{#snippet header()} Tag this script's purpose within flows such that it is available as the corresponding action. {/snippet} { template = 'script' script.kind = detail initContent(script.language, detail, template) }} > {#snippet children({ item })} {#each scriptKindOptions as { value, title, desc, documentationLink, Icon }} {/each} {/snippet}
{/if} {#if customUi?.settingsPanel?.disableRuntime}
{/if} {#if script.schema && !disableAi && !customUi?.settingsPanel?.metadata?.disableAiFilling}
{/if}
{#snippet header()} The script will be executed on a worker configured to listen to this worker group tag (queue). For instance, you could setup an "highmem", or "gpu" tag. {/snippet}
{#snippet header()} Allowed concurrency within a given timeframe {/snippet} { if (script.concurrent_limit && script.concurrent_limit != undefined) { script.concurrent_limit = undefined script.concurrency_time_window_s = undefined script.concurrency_key = undefined } else { script.concurrent_limit = 1 } }} options={{ right: 'Concurrency limits' }} /> {#if Boolean(script.concurrent_limit)}
{#if Boolean(script.concurrent_limit)} {/if}
{/if}
{#snippet header()} Cache the results for each possible inputs {/snippet}
!!script.cache_ttl, (v) => (script.cache_ttl = v ? 300 : undefined) } options={{ right: 'Cache the results for each possible inputs' }} /> {#if script.cache_ttl}
How long to keep the cache valid
script.cache_ignore_s3_path, (v) => (script.cache_ignore_s3_path = v || undefined) } options={{ right: 'Ignore S3 Object paths for caching purposes', rightTooltip: 'If two S3 objects passed as input have the same content, they will hit the same cache entry, regardless of their path.' }} /> {/if}
{#snippet header()} Add a custom timeout for this script {/snippet}
{ if (script.timeout && script.timeout != undefined) { script.timeout = undefined } else { script.timeout = 300 } }} options={{ right: 'Add a custom timeout for this script' }} /> {#if Boolean(script.timeout)} Timeout duration {#if script.timeout} {:else} {/if} {/if}
{#snippet header()} Debounce Jobs {/snippet}
{#snippet header()} Restart the script upon ending unless cancelled {/snippet}
{ if (script.restart_unless_cancelled) { script.restart_unless_cancelled = undefined } else { script.restart_unless_cancelled = true } }} options={{ right: 'Restart upon ending unless cancelled' }} />
{ 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} {#snippet header()} 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 {/snippet}
{#snippet header()} WARNING: This settings ONLY applies to synchronous webhooks or when the script is used within a flow. If used individually, this script must be triggered using a synchronous endpoint to have the desired effect.

The logs, arguments and results of the job will be completely deleted from Windmill once it is complete and the result has been returned.

The deletion is irreversible. {#if !$enterpriseLicense}

This option is only available on Windmill Enterprise Edition. {/if}
{/snippet}
{ if (script.delete_after_use) { script.delete_after_use = undefined } else { script.delete_after_use = true } }} options={{ right: 'Delete logs, arguments and results after use' }} />
{#if !isCloudHosted()}
0} on:change={() => { if (script.priority) { script.priority = undefined } else { script.priority = 100 } }} options={{ right: 'Label as high priority' }} > {#snippet right()} { if (script.priority && script.priority > 100) { script.priority = 100 } else if (script.priority && script.priority < 0) { script.priority = 0 } }} /> {/snippet} {#snippet header()} 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} {/snippet}
{/if}
{#snippet header()} When this option is enabled, manual executions of this script are invisible to users other than the user running it, including the owner(s). This setting can be overridden when this script is run manually from the advanced menu. {/snippet}
{ if (script.visible_to_runner_only) { script.visible_to_runner_only = undefined } else { script.visible_to_runner_only = true } }} options={{ right: 'Make runs invisible to others' }} />
{#snippet header()} When this option is enabled, the script will be run with the permissions of the last editor. {/snippet}
{ if (script.on_behalf_of_email) { script.on_behalf_of_email = undefined } else { script.on_behalf_of_email = $userStore?.email } }} options={{ right: 'Run on behalf of last editor' }} />
{#if !isCloudHosted()}
{#snippet header()} Additional static custom env variables to pass to the script. {/snippet} {#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}
{#if script.envs} {/if}
{/each} {/if}
{/if}
{ captureTable?.loadCaptures(true) }} currentPath={script.path} {initialPath} {fakeInitialPath} noEditor={true} newItem={initialPath == ''} isFlow={false} {hasPreprocessor} canHavePreprocessor={canHavePreprocessor(script.language)} args={hasPreprocessor && selectedInputTab !== 'preprocessor' ? {} : args} isDeployed={savedScript && !savedScript?.draft_only} schema={script.schema} runnableVersion={script.parent_hash} onDeployTrigger={handleDeployTrigger} />
{/snippet}
{#if triggersState.triggers?.some((t) => t.type === 'schedule')} {@const primarySchedule = triggersState.triggers.findIndex((t) => t.isPrimary)} {@const schedule = triggersState.triggers.findIndex((t) => t.type === 'schedule')} {/if} {#if customUi?.topBar?.path != false}
{#if customUi?.topBar?.editablePath != false} {/if} { currentTarget.select() }} />
{/if}
{#if $enterpriseLicense && initialPath != ''} {/if}
{#if customUi?.topBar?.tagEdit != false} {#if $workerTags} {#if $workerTags?.length ?? 0 > 0}
{/if} {/if} {/if} {#if customUi?.topBar?.settings != false} {/if} handleEditScript(false, detail)} />
{ saveDraft() }} on:saveDraft={() => { saveDraft() }} on:openTriggers={openTriggers} on:applyArgs={applyArgs} on:addPreprocessor={addPreprocessor} bind:editor bind:this={scriptEditor} bind:schema={script.schema} path={script.path} stablePathForCaptures={initialPath || fakeInitialPath} bind:code={script.content} lang={script.language} kind={script.kind} {template} tag={script.tag} lastSavedCode={savedScript?.draft?.content} lastDeployedCode={savedScript?.draft_only ? undefined : savedScript?.content} bind:args bind:hasPreprocessor bind:captureTable bind:assets={script.assets} enablePreprocessorSnippet />
{:else} Script Builder not available to operators {/if}