script

create script

Creates a new script when the path does not already exist. Creates a new version of an existing script when called with the same path and the current parent_hash.

post/w/{workspace}/scripts/create

Path parameters

workspacestring required

Request body

pathstring required
parent_hashstring
auto_parentboolean

When true, the backend resolves the parent to the current deployed head for this path within the transaction (ignoring parent_hash), instead of failing with a "lineage must be linear" error when the supplied parent_hash is stale.

summarystring required
descriptionstring
contentstring required
schemaobject
is_templateboolean
lockstring
language'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible' | 'csharp' | 'nu' | 'java' | 'ruby' | 'rlang' | 'duckdb' | 'bunnative' required
kind'script' | 'failure' | 'trigger' | 'command' | 'approval' | 'preprocessor'
tagstring
envsstring[]
concurrent_limitinteger
concurrency_time_window_sinteger
cache_ttlnumber
cache_ignore_s3_pathboolean
dedicated_workerboolean
ws_error_handler_mutedboolean
priorityinteger
restart_unless_cancelledboolean
timeoutinteger
delete_after_secsinteger

If set, delete the job's args, result and logs after this many seconds following job completion

deployment_messagestring
concurrency_keystring
debounce_keystring
debounce_delay_sinteger
debounce_args_to_accumulatestring[]
max_total_debouncing_timeinteger
max_total_debounces_amountinteger
visible_to_runner_onlyboolean
auto_kindstring
codebasestring
has_preprocessorboolean
on_behalf_of_emailstring
preserve_on_behalf_ofboolean

When true and the caller is a member of the 'wm_deployers' group, preserves the original on_behalf_of_email value instead of overwriting it.

modulesobject nullable

Additional script modules keyed by relative file path

labelsstring[]
skip_draft_deletionboolean

When true (set by the CLI / git sync), deploying this script does not delete an existing user draft at the same path.

Response

script created

Changes