windmill-cli 1.826.0 → 1.828.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/main.js +197 -90
- package/package.json +1 -1
package/esm/main.js
CHANGED
|
@@ -16766,7 +16766,7 @@ var init_OpenAPI = __esm(() => {
|
|
|
16766
16766
|
PASSWORD: undefined,
|
|
16767
16767
|
TOKEN: getEnv3("WM_TOKEN"),
|
|
16768
16768
|
USERNAME: undefined,
|
|
16769
|
-
VERSION: "1.
|
|
16769
|
+
VERSION: "1.828.0",
|
|
16770
16770
|
WITH_CREDENTIALS: true,
|
|
16771
16771
|
interceptors: {
|
|
16772
16772
|
request: new Interceptors,
|
|
@@ -18146,6 +18146,7 @@ var getAuditLog = (data) => {
|
|
|
18146
18146
|
tag: data.tag,
|
|
18147
18147
|
cache_ttl: data.cacheTtl,
|
|
18148
18148
|
job_id: data.jobId,
|
|
18149
|
+
retry: data.retry,
|
|
18149
18150
|
invisible_to_owner: data.invisibleToOwner
|
|
18150
18151
|
},
|
|
18151
18152
|
body: data.requestBody,
|
|
@@ -20050,7 +20051,7 @@ var init_auth = __esm(async () => {
|
|
|
20050
20051
|
});
|
|
20051
20052
|
|
|
20052
20053
|
// src/core/constants.ts
|
|
20053
|
-
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.
|
|
20054
|
+
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.828.0";
|
|
20054
20055
|
|
|
20055
20056
|
// src/utils/resource_folders.ts
|
|
20056
20057
|
import { existsSync } from "node:fs";
|
|
@@ -57060,7 +57061,7 @@ var init_openflow = __esm(() => {
|
|
|
57060
57061
|
openflow_default = {
|
|
57061
57062
|
openapi: "3.0.3",
|
|
57062
57063
|
info: {
|
|
57063
|
-
version: "1.
|
|
57064
|
+
version: "1.828.0",
|
|
57064
57065
|
title: "OpenFlow Spec",
|
|
57065
57066
|
contact: {
|
|
57066
57067
|
name: "Ruben Fiszel",
|
|
@@ -57245,7 +57246,7 @@ var init_openflow = __esm(() => {
|
|
|
57245
57246
|
},
|
|
57246
57247
|
exponential: {
|
|
57247
57248
|
type: "object",
|
|
57248
|
-
description: "Retry with exponential backoff
|
|
57249
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
57249
57250
|
properties: {
|
|
57250
57251
|
attempts: {
|
|
57251
57252
|
type: "integer",
|
|
@@ -57258,7 +57259,7 @@ var init_openflow = __esm(() => {
|
|
|
57258
57259
|
seconds: {
|
|
57259
57260
|
type: "integer",
|
|
57260
57261
|
minimum: 1,
|
|
57261
|
-
description: "
|
|
57262
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
57262
57263
|
},
|
|
57263
57264
|
random_factor: {
|
|
57264
57265
|
type: "integer",
|
|
@@ -58683,9 +58684,9 @@ back or unlinked.
|
|
|
58683
58684
|
},
|
|
58684
58685
|
AiDecision: {
|
|
58685
58686
|
type: "object",
|
|
58686
|
-
description: `AI decision step: one call to a decision model (TypeSafe's Jev,
|
|
58687
|
-
Jev-compatible Clef) that answers typed questions about a
|
|
58688
|
-
probabilities, instead of generating text.
|
|
58687
|
+
description: `AI decision step: one call to a decision model (TypeSafe's Jev, Cloudflare's
|
|
58688
|
+
Jev-compatible Clef, or OpenAI's Decisions API) that answers typed questions about a
|
|
58689
|
+
state with calibrated probabilities, instead of generating text.
|
|
58689
58690
|
Prefer it over an AI agent to classify, route, score or check something: it is fast,
|
|
58690
58691
|
cheap and its answers are structured. Its result is { output: { <question name>: answer },
|
|
58691
58692
|
model, usage }, so a later step reads e.g. results.<id>.output.intent.choice. To route on
|
|
@@ -59177,7 +59178,7 @@ var init_schedule = __esm(() => {
|
|
|
59177
59178
|
},
|
|
59178
59179
|
exponential: {
|
|
59179
59180
|
type: "object",
|
|
59180
|
-
description: "Retry with exponential backoff
|
|
59181
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
59181
59182
|
properties: {
|
|
59182
59183
|
attempts: {
|
|
59183
59184
|
type: "integer",
|
|
@@ -59190,7 +59191,7 @@ var init_schedule = __esm(() => {
|
|
|
59190
59191
|
seconds: {
|
|
59191
59192
|
type: "integer",
|
|
59192
59193
|
minimum: 1,
|
|
59193
|
-
description: "
|
|
59194
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
59194
59195
|
},
|
|
59195
59196
|
random_factor: {
|
|
59196
59197
|
type: "integer",
|
|
@@ -59406,7 +59407,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59406
59407
|
},
|
|
59407
59408
|
exponential: {
|
|
59408
59409
|
type: "object",
|
|
59409
|
-
description: "Retry with exponential backoff
|
|
59410
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
59410
59411
|
properties: {
|
|
59411
59412
|
attempts: {
|
|
59412
59413
|
type: "integer",
|
|
@@ -59419,7 +59420,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59419
59420
|
seconds: {
|
|
59420
59421
|
type: "integer",
|
|
59421
59422
|
minimum: 1,
|
|
59422
|
-
description: "
|
|
59423
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
59423
59424
|
},
|
|
59424
59425
|
random_factor: {
|
|
59425
59426
|
type: "integer",
|
|
@@ -59620,7 +59621,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59620
59621
|
},
|
|
59621
59622
|
exponential: {
|
|
59622
59623
|
type: "object",
|
|
59623
|
-
description: "Retry with exponential backoff
|
|
59624
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
59624
59625
|
properties: {
|
|
59625
59626
|
attempts: {
|
|
59626
59627
|
type: "integer",
|
|
@@ -59633,7 +59634,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59633
59634
|
seconds: {
|
|
59634
59635
|
type: "integer",
|
|
59635
59636
|
minimum: 1,
|
|
59636
|
-
description: "
|
|
59637
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
59637
59638
|
},
|
|
59638
59639
|
random_factor: {
|
|
59639
59640
|
type: "integer",
|
|
@@ -59849,7 +59850,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59849
59850
|
},
|
|
59850
59851
|
exponential: {
|
|
59851
59852
|
type: "object",
|
|
59852
|
-
description: "Retry with exponential backoff
|
|
59853
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
59853
59854
|
properties: {
|
|
59854
59855
|
attempts: {
|
|
59855
59856
|
type: "integer",
|
|
@@ -59862,7 +59863,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
59862
59863
|
seconds: {
|
|
59863
59864
|
type: "integer",
|
|
59864
59865
|
minimum: 1,
|
|
59865
|
-
description: "
|
|
59866
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
59866
59867
|
},
|
|
59867
59868
|
random_factor: {
|
|
59868
59869
|
type: "integer",
|
|
@@ -60033,7 +60034,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60033
60034
|
},
|
|
60034
60035
|
exponential: {
|
|
60035
60036
|
type: "object",
|
|
60036
|
-
description: "Retry with exponential backoff
|
|
60037
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60037
60038
|
properties: {
|
|
60038
60039
|
attempts: {
|
|
60039
60040
|
type: "integer",
|
|
@@ -60046,7 +60047,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60046
60047
|
seconds: {
|
|
60047
60048
|
type: "integer",
|
|
60048
60049
|
minimum: 1,
|
|
60049
|
-
description: "
|
|
60050
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60050
60051
|
},
|
|
60051
60052
|
random_factor: {
|
|
60052
60053
|
type: "integer",
|
|
@@ -60171,7 +60172,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60171
60172
|
},
|
|
60172
60173
|
exponential: {
|
|
60173
60174
|
type: "object",
|
|
60174
|
-
description: "Retry with exponential backoff
|
|
60175
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60175
60176
|
properties: {
|
|
60176
60177
|
attempts: {
|
|
60177
60178
|
type: "integer",
|
|
@@ -60184,7 +60185,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60184
60185
|
seconds: {
|
|
60185
60186
|
type: "integer",
|
|
60186
60187
|
minimum: 1,
|
|
60187
|
-
description: "
|
|
60188
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60188
60189
|
},
|
|
60189
60190
|
random_factor: {
|
|
60190
60191
|
type: "integer",
|
|
@@ -60297,7 +60298,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60297
60298
|
},
|
|
60298
60299
|
exponential: {
|
|
60299
60300
|
type: "object",
|
|
60300
|
-
description: "Retry with exponential backoff
|
|
60301
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60301
60302
|
properties: {
|
|
60302
60303
|
attempts: {
|
|
60303
60304
|
type: "integer",
|
|
@@ -60310,7 +60311,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60310
60311
|
seconds: {
|
|
60311
60312
|
type: "integer",
|
|
60312
60313
|
minimum: 1,
|
|
60313
|
-
description: "
|
|
60314
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60314
60315
|
},
|
|
60315
60316
|
random_factor: {
|
|
60316
60317
|
type: "integer",
|
|
@@ -60435,7 +60436,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60435
60436
|
},
|
|
60436
60437
|
exponential: {
|
|
60437
60438
|
type: "object",
|
|
60438
|
-
description: "Retry with exponential backoff
|
|
60439
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60439
60440
|
properties: {
|
|
60440
60441
|
attempts: {
|
|
60441
60442
|
type: "integer",
|
|
@@ -60448,7 +60449,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60448
60449
|
seconds: {
|
|
60449
60450
|
type: "integer",
|
|
60450
60451
|
minimum: 1,
|
|
60451
|
-
description: "
|
|
60452
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60452
60453
|
},
|
|
60453
60454
|
random_factor: {
|
|
60454
60455
|
type: "integer",
|
|
@@ -60721,7 +60722,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60721
60722
|
},
|
|
60722
60723
|
exponential: {
|
|
60723
60724
|
type: "object",
|
|
60724
|
-
description: "Retry with exponential backoff
|
|
60725
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60725
60726
|
properties: {
|
|
60726
60727
|
attempts: {
|
|
60727
60728
|
type: "integer",
|
|
@@ -60734,7 +60735,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60734
60735
|
seconds: {
|
|
60735
60736
|
type: "integer",
|
|
60736
60737
|
minimum: 1,
|
|
60737
|
-
description: "
|
|
60738
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60738
60739
|
},
|
|
60739
60740
|
random_factor: {
|
|
60740
60741
|
type: "integer",
|
|
@@ -60841,7 +60842,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60841
60842
|
},
|
|
60842
60843
|
exponential: {
|
|
60843
60844
|
type: "object",
|
|
60844
|
-
description: "Retry with exponential backoff
|
|
60845
|
+
description: "Retry with exponential backoff: the n-th retry waits multiplier × seconds^n",
|
|
60845
60846
|
properties: {
|
|
60846
60847
|
attempts: {
|
|
60847
60848
|
type: "integer",
|
|
@@ -60854,7 +60855,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
60854
60855
|
seconds: {
|
|
60855
60856
|
type: "integer",
|
|
60856
60857
|
minimum: 1,
|
|
60857
|
-
description: "
|
|
60858
|
+
description: "Base of the exponential (seconds); the n-th retry waits multiplier × seconds^n, where n counts constant retries too"
|
|
60858
60859
|
},
|
|
60859
60860
|
random_factor: {
|
|
60860
60861
|
type: "integer",
|
|
@@ -74119,7 +74120,7 @@ var init_new = __esm(async () => {
|
|
|
74119
74120
|
}
|
|
74120
74121
|
}
|
|
74121
74122
|
};
|
|
74122
|
-
command13 = new Command().description("create a new raw app from a template").option("--summary <summary:string>", "App summary (short description). Skips the prompt when provided. Triggers non-interactive mode.").option("--path <path:string>", "App path (e.g., f/folder/my_app or u/username/my_app). Skips the prompt when provided. Triggers non-interactive mode.").option("--framework <framework:string>", "Framework template: react19 | react18 | svelte5 | vue. Skips the prompt when provided. Triggers non-interactive mode.").option("--datatable <datatable:string>", "Datatable to wire up. Without this flag in non-interactive mode, no datatable is configured.").option("--schema <schema:string>", "Schema to use with --datatable.
|
|
74123
|
+
command13 = new Command().description("create a new raw app from a template").option("--summary <summary:string>", "App summary (short description). Skips the prompt when provided. Triggers non-interactive mode.").option("--path <path:string>", "App path (e.g., f/folder/my_app or u/username/my_app). Skips the prompt when provided. Triggers non-interactive mode.").option("--framework <framework:string>", "Framework template: react19 | react18 | svelte5 | vue. Skips the prompt when provided. Triggers non-interactive mode.").option("--datatable <datatable:string>", "Datatable to wire up. Without this flag in non-interactive mode, no datatable is configured.").option("--schema <schema:string>", "Schema to use with --datatable. If it doesn't exist yet, a sql_to_apply/ migration (CREATE SCHEMA IF NOT EXISTS) is written for it.").option("--overwrite", "Overwrite the target directory if it already exists, without prompting.").option("--no-open-in-desktop", "Do not prompt to open the new app in Claude Desktop.").action(newApp);
|
|
74123
74124
|
new_default = command13;
|
|
74124
74125
|
});
|
|
74125
74126
|
|
|
@@ -76387,6 +76388,23 @@ async function list10(opts) {
|
|
|
76387
76388
|
x.super_admin ? "true" : "false"
|
|
76388
76389
|
])).render();
|
|
76389
76390
|
}
|
|
76391
|
+
async function listWorkspaceUsers(opts) {
|
|
76392
|
+
if (opts.json)
|
|
76393
|
+
setSilent(true);
|
|
76394
|
+
opts = await mergeConfigWithConfigFile(opts);
|
|
76395
|
+
const workspace = await resolveWorkspace(opts);
|
|
76396
|
+
await requireLogin(opts);
|
|
76397
|
+
const users = await listUsers({ workspace: workspace.workspaceId });
|
|
76398
|
+
if (opts.json) {
|
|
76399
|
+
console.log(JSON.stringify(users));
|
|
76400
|
+
} else {
|
|
76401
|
+
new Table2().header(["username", "email", "role"]).padding(2).border(true).body(users.map((u) => [
|
|
76402
|
+
u.username,
|
|
76403
|
+
u.email,
|
|
76404
|
+
u.is_admin ? "admin" : u.operator ? "operator" : "developer"
|
|
76405
|
+
])).render();
|
|
76406
|
+
}
|
|
76407
|
+
}
|
|
76390
76408
|
function rdString() {
|
|
76391
76409
|
return Math.random().toString(36).slice(2, 7);
|
|
76392
76410
|
}
|
|
@@ -76715,6 +76733,8 @@ var init_user = __esm(async () => {
|
|
|
76715
76733
|
init_services_gen();
|
|
76716
76734
|
await __promiseAll([
|
|
76717
76735
|
init_auth(),
|
|
76736
|
+
init_context(),
|
|
76737
|
+
init_conf(),
|
|
76718
76738
|
init_types(),
|
|
76719
76739
|
init_instance(),
|
|
76720
76740
|
init_yaml()
|
|
@@ -76722,7 +76742,7 @@ var init_user = __esm(async () => {
|
|
|
76722
76742
|
import_yaml34 = __toESM(require_dist(), 1);
|
|
76723
76743
|
instanceUsersPath = INSTANCE_USERS_PATH;
|
|
76724
76744
|
instanceGroupsPath = INSTANCE_GROUPS_PATH;
|
|
76725
|
-
command19 = new Command().description("user related commands").action(list10).command("add", "Create a user").arguments("<email:string> [password:string]").option("--superadmin", "Specify to make the new user superadmin.").option("--company <company:string>", "Specify to set the company of the new user.").option("--name <name:string>", "Specify to set the name of the new user.").action(add3).command("remove", "Delete a user").arguments("<email:string>").action(remove2).command("create-token", "Create a new API token for the authenticated user").option("--email <email:string>", "Specify credentials to use for authentication. This will not be stored. It will only be used to exchange for a token with the API server, which will not be stored either.", {
|
|
76745
|
+
command19 = new Command().description("user related commands").action(list10).command("list", "List the users of the workspace").option("--json", "Output as JSON (for piping to jq)").action(listWorkspaceUsers).command("add", "Create a user").arguments("<email:string> [password:string]").option("--superadmin", "Specify to make the new user superadmin.").option("--company <company:string>", "Specify to set the company of the new user.").option("--name <name:string>", "Specify to set the name of the new user.").action(add3).command("remove", "Delete a user").arguments("<email:string>").action(remove2).command("create-token", "Create a new API token for the authenticated user").option("--email <email:string>", "Specify credentials to use for authentication. This will not be stored. It will only be used to exchange for a token with the API server, which will not be stored either.", {
|
|
76726
76746
|
depends: ["password"]
|
|
76727
76747
|
}).option("--password <password:string>", "Specify credentials to use for authentication. This will not be stored. It will only be used to exchange for a token with the API server, which will not be stored either.", {
|
|
76728
76748
|
depends: ["email"]
|
|
@@ -79585,7 +79605,7 @@ A data pipeline is NOT a flow: it is a set of independent scripts in one folder,
|
|
|
79585
79605
|
## Raw App Development
|
|
79586
79606
|
|
|
79587
79607
|
You MUST use the \`raw-app\` skill to create or modify raw apps.
|
|
79588
|
-
When a new app needs to be created, YOU run \`wmill app new\` yourself with \`--summary\`, \`--path\`, and \`--framework\` flags (and any other relevant flags). Do NOT ask the user to run it. If you don't have
|
|
79608
|
+
When a new app needs to be created, YOU run \`wmill app new\` yourself with \`--summary\`, \`--path\`, and \`--framework\` flags (and any other relevant flags). Do NOT ask the user to run it. If you don't have a summary or a path, ask the user via \`AskUserQuestion\` (one call, all missing fields) — never invent them. The framework is not asked: \`react19\` unless the user or the project's existing apps say otherwise. An app that stores data also needs its data table and schema settled with the user first. See the \`raw-app\` skill for the full procedure.
|
|
79589
79609
|
|
|
79590
79610
|
## Triggers
|
|
79591
79611
|
|
|
@@ -80480,21 +80500,23 @@ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<
|
|
|
80480
80500
|
* Run a script asynchronously by its path
|
|
80481
80501
|
* @param path - Script path in Windmill
|
|
80482
80502
|
* @param args - Arguments to pass to the script
|
|
80483
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
80503
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
80504
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
80484
80505
|
* @param tag - Override the worker tag the job runs on
|
|
80485
80506
|
* @returns Job ID of the created job
|
|
80486
80507
|
*/
|
|
80487
|
-
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
80508
|
+
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
80488
80509
|
|
|
80489
80510
|
/**
|
|
80490
80511
|
* Run a script asynchronously by its hash
|
|
80491
80512
|
* @param hash_ - Script hash in Windmill
|
|
80492
80513
|
* @param args - Arguments to pass to the script
|
|
80493
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
80514
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
80515
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
80494
80516
|
* @param tag - Override the worker tag the job runs on
|
|
80495
80517
|
* @returns Job ID of the created job
|
|
80496
80518
|
*/
|
|
80497
|
-
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
80519
|
+
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
80498
80520
|
|
|
80499
80521
|
/**
|
|
80500
80522
|
* Run a flow asynchronously by its path
|
|
@@ -81313,21 +81335,23 @@ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<
|
|
|
81313
81335
|
* Run a script asynchronously by its path
|
|
81314
81336
|
* @param path - Script path in Windmill
|
|
81315
81337
|
* @param args - Arguments to pass to the script
|
|
81316
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
81338
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
81339
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
81317
81340
|
* @param tag - Override the worker tag the job runs on
|
|
81318
81341
|
* @returns Job ID of the created job
|
|
81319
81342
|
*/
|
|
81320
|
-
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
81343
|
+
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
81321
81344
|
|
|
81322
81345
|
/**
|
|
81323
81346
|
* Run a script asynchronously by its hash
|
|
81324
81347
|
* @param hash_ - Script hash in Windmill
|
|
81325
81348
|
* @param args - Arguments to pass to the script
|
|
81326
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
81349
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
81350
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
81327
81351
|
* @param tag - Override the worker tag the job runs on
|
|
81328
81352
|
* @returns Job ID of the created job
|
|
81329
81353
|
*/
|
|
81330
|
-
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
81354
|
+
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
81331
81355
|
|
|
81332
81356
|
/**
|
|
81333
81357
|
* Run a flow asynchronously by its path
|
|
@@ -82252,21 +82276,23 @@ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<
|
|
|
82252
82276
|
* Run a script asynchronously by its path
|
|
82253
82277
|
* @param path - Script path in Windmill
|
|
82254
82278
|
* @param args - Arguments to pass to the script
|
|
82255
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
82279
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
82280
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
82256
82281
|
* @param tag - Override the worker tag the job runs on
|
|
82257
82282
|
* @returns Job ID of the created job
|
|
82258
82283
|
*/
|
|
82259
|
-
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
82284
|
+
async runScriptByPathAsync(path: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
82260
82285
|
|
|
82261
82286
|
/**
|
|
82262
82287
|
* Run a script asynchronously by its hash
|
|
82263
82288
|
* @param hash_ - Script hash in Windmill
|
|
82264
82289
|
* @param args - Arguments to pass to the script
|
|
82265
|
-
* @param scheduledInSeconds - Schedule execution for a future time (in seconds)
|
|
82290
|
+
* @param scheduledInSeconds - Schedule execution for a future time (in seconds), or {@link RunScriptAsyncOptions}
|
|
82291
|
+
* \`{ scheduledInSeconds?, tag?, retry? }\`, e.g. \`{ retry: { constant: { attempts: 3, seconds: 10 } } }\`
|
|
82266
82292
|
* @param tag - Override the worker tag the job runs on
|
|
82267
82293
|
* @returns Job ID of the created job
|
|
82268
82294
|
*/
|
|
82269
|
-
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null = null, tag: string | null = null): Promise<string>
|
|
82295
|
+
async runScriptByHashAsync(hash_: string, args: Record<string, any> | null = null, scheduledInSeconds: number | null | RunScriptAsyncOptions = null, tag: string | null = null): Promise<string>
|
|
82270
82296
|
|
|
82271
82297
|
/**
|
|
82272
82298
|
* Run a flow asynchronously by its path
|
|
@@ -84147,10 +84173,14 @@ def post(endpoint, raise_for_status = True, **kwargs) -> httpx.Response
|
|
|
84147
84173
|
def create_token(duration = dt.timedelta(days=1)) -> str
|
|
84148
84174
|
|
|
84149
84175
|
# Create a script job by path and return its job id.
|
|
84150
|
-
|
|
84176
|
+
#
|
|
84177
|
+
# \`\`retry\`\` re-runs the job when it fails, with the policy a schedule takes,
|
|
84178
|
+
# e.g. \`\`{"constant": {"attempts": 3, "seconds": 10}}\`\`. The returned id is
|
|
84179
|
+
# the first attempt's; each retry is a job of its own, recorded as a child of it.
|
|
84180
|
+
def run_script_by_path_async(path: str, args: dict = None, scheduled_in_secs: int = None, tag: str = None, retry: dict = None) -> str
|
|
84151
84181
|
|
|
84152
|
-
# Create a script job by hash and return its job id.
|
|
84153
|
-
def run_script_by_hash_async(hash_: str, args: dict = None, scheduled_in_secs: int = None, tag: str = None) -> str
|
|
84182
|
+
# Create a script job by hash and return its job id. See \`\`run_script_by_path_async\`\` for \`\`retry\`\`.
|
|
84183
|
+
def run_script_by_hash_async(hash_: str, args: dict = None, scheduled_in_secs: int = None, tag: str = None, retry: dict = None) -> str
|
|
84154
84184
|
|
|
84155
84185
|
# Create a flow job and return its job id.
|
|
84156
84186
|
def run_flow_async(path: str, args: dict = None, scheduled_in_secs: int = None, do_not_track_in_parent: bool = True, tag: str = None) -> str
|
|
@@ -85420,6 +85450,7 @@ These are strict Windmill schema rules. Follow them exactly.
|
|
|
85420
85450
|
- \`preprocessor_module\` and \`failure_module\` only support \`script\` or \`rawscript\`
|
|
85421
85451
|
- \`preprocessor_module\` runs before normal modules and cannot reference \`results.*\`
|
|
85422
85452
|
- \`failure_module\` can use the \`error\` object with \`error.message\`, \`error.step_id\`, \`error.name\`, and \`error.stack\`
|
|
85453
|
+
- A flow whose \`failure_module\` runs still ends as failed, unless the handler returns an object with \`recover: true\`: the flow then ends as a success. This also holds when the failing step is inside a loop, a branch or a subflow. \`recover\` never changes which steps run; whether a loop or branch carries on past a failure is still decided by its own settings (\`skip_failures\`, \`continue_on_error\`)
|
|
85423
85454
|
|
|
85424
85455
|
Correct shape:
|
|
85425
85456
|
|
|
@@ -85577,7 +85608,7 @@ names, so neither is name-checked at all — leave those summaries as they are.
|
|
|
85577
85608
|
|
|
85578
85609
|
## AI Decision Modules
|
|
85579
85610
|
|
|
85580
|
-
An \`aidecision\` module asks a decision model (TypeSafe's Jev or
|
|
85611
|
+
An \`aidecision\` module asks a decision model (TypeSafe's Jev, Cloudflare's Clef or OpenAI's Decisions API) typed questions about a \`state\` and
|
|
85581
85612
|
answers each with calibrated probabilities instead of text. Prefer it over an \`aiagent\` when the step
|
|
85582
85613
|
is a judgment (classify, route, score or a yes/no check) that needs no tools and no free text: it
|
|
85583
85614
|
is faster, cheaper, and its answers have a fixed shape.
|
|
@@ -85615,8 +85646,9 @@ is faster, cheaper, and its answers have a fixed shape.
|
|
|
85615
85646
|
}
|
|
85616
85647
|
\`\`\`
|
|
85617
85648
|
|
|
85618
|
-
- \`provider.kind\` is \`typesafe\` (\`model\` \`jev-latest\` unless a version is pinned)
|
|
85619
|
-
(\`model\` \`clef\`, or \`clef-flash\` for faster answers)
|
|
85649
|
+
- \`provider.kind\` is \`typesafe\` (\`model\` \`jev-latest\` unless a version is pinned), \`cloudflare\`
|
|
85650
|
+
(\`model\` \`clef\`, or \`clef-flash\` for faster answers) or \`openai\` (\`model\` \`gpt-6-luna\`, never a
|
|
85651
|
+
chat model); the resource is of that same type
|
|
85620
85652
|
- \`state\` is the content to evaluate: usually a text, such as the message to classify. To combine
|
|
85621
85653
|
several values, pass an object with descriptive keys holding only what the questions need
|
|
85622
85654
|
(\`({ message: flow_input.message, plan: results.get_account.plan })\`); an array of strings also works
|
|
@@ -85630,6 +85662,12 @@ is faster, cheaper, and its answers have a fixed shape.
|
|
|
85630
85662
|
- The result is \`{ output, model, usage }\` with \`output\` keyed by question name, so a later step
|
|
85631
85663
|
reads \`results.triage.output.intent.choice\`, \`results.triage.output.urgency.score\` or
|
|
85632
85664
|
\`results.triage.output.angry.noul > 0.7\`
|
|
85665
|
+
- On \`openai\` the same \`questions\` are translated for its Decisions API and the answers read the
|
|
85666
|
+
same way (\`choice\`, \`score\`, \`noul\`), except that \`probabilities\` is a list of
|
|
85667
|
+
\`{ value, probability }\` (plus \`label\` on a score) and a score has no \`legend\`. A question OpenAI
|
|
85668
|
+
refuses to answer fails the step. A \`state\` that is
|
|
85669
|
+
an array of user messages (\`[{ role: "user", content: [{ type: "input_text", text }, { type: "input_image", image_url: "data:image/png;base64,..." }] }]\`)
|
|
85670
|
+
is sent as is, which is how an image is evaluated; any other object or array is sent as JSON text
|
|
85633
85671
|
|
|
85634
85672
|
### Branching on the Answers
|
|
85635
85673
|
|
|
@@ -85674,6 +85712,10 @@ can call one, not an agent used as a tool.
|
|
|
85674
85712
|
- \`results.step_id.property\` - Access specific property from a previous step output only when that step result is in scope
|
|
85675
85713
|
- \`flow_input.iter.value\` - Current iteration value inside a \`forloopflow\`; in a \`whileloopflow\` it is just the iteration index (a plain number, same as \`flow_input.iter.index\`)
|
|
85676
85714
|
- \`flow_input.iter.index\` - Current loop index when inside a loop (\`forloopflow\` or \`whileloopflow\`)
|
|
85715
|
+
- After a suspend step (approval), the next step's javascript expressions also get:
|
|
85716
|
+
- \`resume\` - the last resume payload (the resume form values); with \`continue_on_disapprove_timeout\`, a disapproval or timeout yields \`{ error: { name: "SuspendedDisapproved" | "SuspendedTimedOut", message } }\` instead
|
|
85717
|
+
- \`resumes\` - every resume payload, in arrival order
|
|
85718
|
+
- \`approvers\` - a plain array of strings, one per resume: for a resume through the \`resume\`/\`cancel\` URL from \`getResumeUrls(approver)\`, the \`approver\` passed there if any; otherwise (including the \`approvalPage\` link) the resuming user's username, else \`"anonymous"\`, e.g. \`approvers[0]\`. It is NOT the \`{ resume_id, approver }\` objects stored in the flow status, so \`approvers[0].approver\` is always undefined
|
|
85677
85719
|
|
|
85678
85720
|
## Loop Structure Rules
|
|
85679
85721
|
|
|
@@ -85985,7 +86027,7 @@ Reference a specific resource using \`$res:\` prefix:
|
|
|
85985
86027
|
|
|
85986
86028
|
## OpenFlow Schema
|
|
85987
86029
|
|
|
85988
|
-
{"OpenFlow":{"type":"object","description":"Top-level flow definition containing metadata, configuration, and the flow structure","properties":{"summary":{"type":"string","description":"Short description of what this flow does"},"description":{"type":"string","description":"Detailed documentation for this flow"},"value":{"$ref":"#/components/schemas/FlowValue"},"schema":{"type":"object","description":"JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')"},"on_behalf_of_email":{"type":"string","description":"Address of the account the flow runs on behalf of. Derived from on_behalf_of on read; accepted on write, where it is resolved to the account it names."},"on_behalf_of":{"type":"string","description":"The flow runs with the permissions of this identity: u/{username}, g/{group}, or a bare email when the username is itself email-shaped. The only stored half of the identity; on_behalf_of_email is derived from it. Omit it when writing and it is resolved from that address instead."}},"required":["summary","value"]},"FlowValue":{"type":"object","description":"The flow structure containing modules and optional preprocessor/failure handlers","properties":{"modules":{"type":"array","description":"Array of steps that execute in sequence. Each step can be a script, subflow, loop, or branch","items":{"$ref":"#/components/schemas/FlowModule"}},"failure_module":{"description":"Special module that executes when the flow fails. Receives error object with message, name, stack, and step_id. Must have id 'failure'. Only supports script/rawscript types","$ref":"#/components/schemas/FlowModule"},"preprocessor_module":{"description":"Special module that runs before the first step on external triggers. Must have id 'preprocessor'. Only supports script/rawscript types. Cannot reference other step results","$ref":"#/components/schemas/FlowModule"},"same_worker":{"type":"boolean","description":"If true, all steps run on the same worker for better performance"},"preserve_step_tags":{"type":"boolean","description":"If true and the flow runs on a custom worker tag, steps that declare their own non-empty tag run on it instead of inheriting the flow tag. Steps without their own tag still inherit the flow tag."},"concurrent_limit":{"type":"number","description":"Maximum number of concurrent executions of this flow"},"concurrency_key":{"type":"string","description":"Expression to group concurrent executions (e.g., by user ID)"},"concurrency_time_window_s":{"type":"number","description":"Time window in seconds for concurrent_limit"},"debounce_delay_s":{"type":"integer","description":"Delay in seconds to debounce flow executions"},"debounce_key":{"type":"string","description":"Expression to group debounced executions"},"debounce_args_to_accumulate":{"type":"array","description":"Arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"integer","description":"Maximum total time in seconds that a job can be debounced"},"max_total_debounces_amount":{"type":"integer","description":"Maximum number of times a job can be debounced"},"skip_expr":{"type":"string","description":"JavaScript expression to conditionally skip the entire flow"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for flow results"},"cache_ignore_s3_path":{"type":"boolean"},"delete_after_secs":{"type":"integer","description":"If set, delete the flow job's args, result and logs after this many seconds following job completion"},"flow_env":{"type":"object","description":"Environment variables available to all steps. Values can be strings, JSON values, or special references: '$var:path' (workspace variable) or '$res:path' (resource).","additionalProperties":{}},"priority":{"type":"number","description":"Execution priority (higher numbers run first)"},"early_return":{"type":"string","description":"JavaScript expression to return early from the flow"},"chat_input_enabled":{"type":"boolean","description":"Whether this flow accepts chat-style input"},"notes":{"type":"array","description":"Sticky notes attached to the flow","items":{"$ref":"#/components/schemas/FlowNote"}},"groups":{"type":"array","description":"Semantic groups of modules for organizational purposes","items":{"$ref":"#/components/schemas/FlowGroup"}}},"required":["modules"]},"Retry":{"type":"object","description":"Retry configuration for failed module executions","properties":{"constant":{"type":"object","description":"Retry with constant delay between attempts","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"seconds":{"type":"integer","description":"Seconds to wait between retries"}}},"exponential":{"type":"object","description":"Retry with exponential backoff (delay doubles each time)","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"multiplier":{"type":"integer","description":"Multiplier for exponential backoff"},"seconds":{"type":"integer","minimum":1,"description":"Initial delay in seconds"},"random_factor":{"type":"integer","minimum":0,"maximum":100,"description":"Random jitter percentage (0-100) to avoid thundering herd"}}},"retry_if":{"$ref":"#/components/schemas/RetryIf"}}},"FlowNote":{"type":"object","description":"A sticky note attached to a flow for documentation and annotation","properties":{"id":{"type":"string","description":"Unique identifier for the note"},"text":{"type":"string","description":"Content of the note"},"position":{"type":"object","description":"Position of the note in the flow editor","properties":{"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"}},"required":["x","y"]},"size":{"type":"object","description":"Size of the note in the flow editor","properties":{"width":{"type":"number","description":"Width in pixels"},"height":{"type":"number","description":"Height in pixels"}},"required":["width","height"]},"color":{"type":"string","description":"Color of the note, one of: yellow, blue, green, purple, pink, orange, red, cyan, lime, gray. Any other value renders unstyled."},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes. 'group' notes are deprecated; segment a flow with FlowValue.groups instead."},"locked":{"type":"boolean","default":false,"description":"Whether the note is locked and cannot be edited or moved"},"contained_node_ids":{"type":"array","items":{"type":"string"},"description":"For group notes, the IDs of nodes contained within this group"}},"required":["id","text","color","type"]},"FlowGroup":{"type":"object","description":"A semantic group of flow modules for organizational purposes. Does not affect execution \\u2014 modules remain in their original position in the flow. Groups provide naming and collapsibility in the editor. Members are computed dynamically from all nodes on paths between start_id and end_id.","properties":{"summary":{"type":"string","description":"Display name for this group"},"note":{"type":"string","description":"Markdown note shown below the group header"},"autocollapse":{"type":"boolean","default":false,"description":"If true, this group is collapsed by default in the flow editor. UI hint only."},"start_id":{"type":"string","description":"ID of the first flow module in this group (topological entry point)"},"end_id":{"type":"string","description":"ID of the last flow module in this group (topological exit point)"},"color":{"type":"string","description":"Color for the group in the flow editor, one of: yellow, blue, green, purple, pink, orange, red, cyan, lime, gray. Omit it to let the editor pick one."}},"required":["start_id","end_id"]},"RetryIf":{"type":"object","description":"Conditional retry based on error or result","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables"}},"required":["expr"]},"StopAfterIf":{"type":"object","description":"Early termination condition for a module","properties":{"skip_if_stopped":{"type":"boolean","description":"If true, following steps are skipped when this condition triggers"},"expr":{"type":"string","description":"JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"},"error_message":{"type":"string","nullable":true,"description":"Custom error message when stopping with an error. Mutually exclusive with skip_if_stopped. If set to a non-empty string, the flow stops with this error. If empty string, a default error message is used. If null or omitted, no error is raised."},"error_include_result":{"type":"boolean","description":"When stopping with an error (error_message set), embed the stopping step's own result inside the raised error object (as error.result) instead of discarding it. The top-level result stays { error }. Defaults to false."}},"required":["expr"]},"FlowModule":{"type":"object","description":"A single step in a flow. Can be a script, subflow, loop, or branch","properties":{"id":{"type":"string","description":"Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"},"value":{"$ref":"#/components/schemas/FlowModuleValue"},"stop_after_if":{"description":"Early termination condition evaluated after this step completes","$ref":"#/components/schemas/StopAfterIf"},"stop_after_all_iters_if":{"description":"For loops only - early termination condition evaluated after all iterations complete","$ref":"#/components/schemas/StopAfterIf"},"skip_if":{"type":"object","description":"Conditionally skip this step based on previous results or flow inputs","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'"}},"required":["expr"]},"sleep":{"description":"Delay before executing this step (in seconds or as expression)","$ref":"#/components/schemas/InputTransform"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for this step's results"},"cache_ignore_s3_path":{"type":"boolean"},"timeout":{"description":"Maximum execution time in seconds (static value or expression)","$ref":"#/components/schemas/InputTransform"},"delete_after_secs":{"type":"integer","description":"If set, delete the step's args, result and logs after this many seconds following job completion"},"summary":{"type":"string","description":"Short description of what this step does"},"mock":{"type":"object","description":"Mock configuration for testing without executing the actual step","properties":{"enabled":{"type":"boolean","description":"If true, return mock value instead of executing"},"return_value":{"description":"Value to return when mocked"}}},"suspend":{"type":"object","description":"Configuration for approval/resume steps that wait for user input","properties":{"required_events":{"type":"integer","description":"Number of approvals required before continuing"},"timeout":{"type":"integer","description":"Timeout in seconds before auto-continuing or canceling"},"resume_form":{"type":"object","description":"Form schema for collecting input when resuming","properties":{"schema":{"type":"object","description":"JSON Schema for the resume form"}}},"user_auth_required":{"type":"boolean","description":"If true, only authenticated users can approve"},"user_groups_required":{"description":"Expression or list of groups that can approve","$ref":"#/components/schemas/InputTransform"},"self_approval_disabled":{"type":"boolean","description":"If true, the user who started the flow cannot approve"},"hide_cancel":{"type":"boolean","description":"If true, hide the cancel button on the approval form"},"continue_on_disapprove_timeout":{"type":"boolean","description":"If true, continue flow on timeout instead of canceling"},"skin":{"type":"string","enum":["detailed","minimal"],"description":"How the approval request is presented, on the approval page and in Slack/Teams approval messages. 'detailed' (used when unset) shows the flow details (arguments, graph, approvers); 'minimal' shows only the request: the step description, form and approve/reject actions"}}},"priority":{"type":"number","description":"Execution priority for this step (higher numbers run first)"},"continue_on_error":{"type":"boolean","description":"If true, flow continues even if this step fails"},"job_token_scopes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scopes the token of this step's jobs is restricted to (domain:action[:resource], e.g. oidc:write), on top of the flow's own restriction: a step can only narrow it. Applies to everything the step runs (loop and branch bodies, AI agent tools)."},"retry":{"description":"Retry configuration if this step fails","$ref":"#/components/schemas/Retry"},"debouncing":{"description":"Debounce configuration for this step (EE only)","type":"object","properties":{"debounce_delay_s":{"type":"integer","description":"Delay in seconds to debounce this step's executions across flow runs"},"debounce_key":{"type":"string","description":"Expression to group debounced executions. Supports $workspace and $args[name]. Default: $workspace/flow/<flow_path>-<step_id>"},"debounce_args_to_accumulate":{"type":"array","description":"Array-type arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"integer","description":"Maximum total time in seconds before forced execution"},"max_total_debounces_amount":{"type":"integer","description":"Maximum number of debounces before forced execution"}}}},"required":["value","id"]},"InputTransform":{"description":"Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs","oneOf":[{"$ref":"#/components/schemas/StaticTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"StaticTransform":{"type":"object","description":"Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'","properties":{"value":{"description":"The static value. For resources, use format '$res:path/to/resource'"},"type":{"type":"string","enum":["static"]}},"required":["type"]},"JavascriptTransform":{"type":"object","description":"JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside for loops, use 'flow_input.iter.value' for the current iteration value (in while loops it equals 'flow_input.iter.index')","properties":{"expr":{"type":"string","description":"JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"},"type":{"type":"string","enum":["javascript"]}},"required":["expr","type"]},"AiTransform":{"type":"object","description":"Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.","properties":{"type":{"type":"string","enum":["ai"]}},"required":["type"]},"AIProviderKind":{"type":"string","description":"Supported AI provider types","enum":["openai","azure_openai","azure_foundry","anthropic","mistral","deepseek","googleai","groq","openrouter","togetherai","customai","aws_bedrock","typesafe","cloudflare"]},"ProviderConfig":{"type":"object","description":"Complete AI provider configuration with resource reference and model selection","properties":{"kind":{"$ref":"#/components/schemas/AIProviderKind"},"resource":{"type":"string","description":"Resource reference in format '$res:{resource_path}' pointing to provider credentials"},"model":{"type":"string","description":"Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')"},"reasoning_effort":{"type":"string","description":"Provider-native reasoning effort token (e.g. 'low', 'high', 'none') for models that support extended thinking. Optional; unset leaves the provider default."}},"required":["kind","resource","model"]},"StaticProviderTransform":{"type":"object","description":"Static provider configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/ProviderConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"ProviderTransform":{"description":"Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticProviderTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticProviderTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"MemoryOff":{"type":"object","description":"No conversation memory/context","properties":{"kind":{"type":"string","enum":["off"]}},"required":["kind"]},"MemoryWindow":{"type":"object","description":"Keeps the most recent messages of the memory named by the run's memory id (or the step's\\n\`memory_id\`). Without a memory id the agent runs without memory.\\n","properties":{"kind":{"type":"string","enum":["window"]},"context_length":{"type":"integer","description":"Number of most recent messages to load and store. 0 turns memory off."}},"required":["kind","context_length"]},"MemoryAuto":{"type":"object","deprecated":true,"description":"Deprecated, still read as it was written: the run's memory id, else the \`memory_id\` here.\\nThe step's own \`memory_id\` is not read while this kind is set; switch the kind to \`window\`\\nto use it. Without a \`context_length\`, or with 0, it is \`off\` and reads \`previous_messages\`.\\n","properties":{"kind":{"type":"string","enum":["auto"]},"context_length":{"type":"integer","description":"Maximum number of messages to retain in context"},"memory_id":{"type":"string","description":"Identifier for persistent memory across agent invocations"}},"required":["kind"]},"MemoryCompaction":{"type":"object","description":"Keeps the whole memory named by the run's memory id (or the step's \`memory_id\`), replacing\\nits older part with a summary as the conversation approaches the model's context window.\\nWithout a memory id the agent runs without memory, and compaction bounds the run's own loop.\\n","properties":{"kind":{"type":"string","enum":["compaction"]},"context_window":{"type":"integer","description":"Overrides the context window looked up from the model, in tokens. Only a model\\nWindmill does not know needs one; those fall back to 128000.\\n"}},"required":["kind"]},"MemoryMessage":{"type":"object","description":"A single message in conversation history","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]},"MemoryManual":{"type":"object","deprecated":true,"description":"Deprecated, still read as it was written. Move the step to \`off\` with \`previous_messages\` instead.","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Managed memory, stored by Windmill and replayed with each request. The memory is named by a memory id, see \`memory_id\`. While it is off, a step can supply its history in \`previous_messages\`.","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryWindow"},{"$ref":"#/components/schemas/MemoryCompaction"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","window":"#/components/schemas/MemoryWindow","compaction":"#/components/schemas/MemoryCompaction","auto":"#/components/schemas/MemoryAuto","manual":"#/components/schemas/MemoryManual"}}},"StaticMemoryTransform":{"type":"object","description":"Static memory configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/MemoryConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"MemoryTransform":{"description":"Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticMemoryTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticMemoryTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"FlowModuleValue":{"description":"The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type","oneOf":[{"$ref":"#/components/schemas/RawScript"},{"$ref":"#/components/schemas/PathScript"},{"$ref":"#/components/schemas/PathFlow"},{"$ref":"#/components/schemas/ForloopFlow"},{"$ref":"#/components/schemas/WhileloopFlow"},{"$ref":"#/components/schemas/BranchOne"},{"$ref":"#/components/schemas/BranchAll"},{"$ref":"#/components/schemas/Identity"},{"$ref":"#/components/schemas/AiAgent"},{"$ref":"#/components/schemas/AiDecision"}],"discriminator":{"propertyName":"type","mapping":{"rawscript":"#/components/schemas/RawScript","script":"#/components/schemas/PathScript","flow":"#/components/schemas/PathFlow","forloopflow":"#/components/schemas/ForloopFlow","whileloopflow":"#/components/schemas/WhileloopFlow","branchone":"#/components/schemas/BranchOne","branchall":"#/components/schemas/BranchAll","identity":"#/components/schemas/Identity","aiagent":"#/components/schemas/AiAgent","aidecision":"#/components/schemas/AiDecision"}}},"RawScript":{"type":"object","description":"Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"content":{"type":"string","description":"The script source code. Should export a 'main' function"},"language":{"type":"string","description":"Programming language for this script","enum":["deno","bun","bunnative","python3","go","bash","powershell","postgresql","mysql","bigquery","snowflake","mssql","oracledb","graphql","nativets","php","rust","ansible","csharp","nu","java","ruby","rlang","duckdb"]},"path":{"type":"string","description":"Optional path for saving this script"},"lock":{"type":"string","description":"Lock file content for dependencies"},"type":{"type":"string","enum":["rawscript"]},"tag":{"type":"string","description":"Worker group tag for execution routing"},"concurrent_limit":{"type":"number","description":"Maximum concurrent executions of this script"},"concurrency_time_window_s":{"type":"number","description":"Time window for concurrent_limit"},"custom_concurrency_key":{"type":"string","description":"Custom key for grouping concurrent executions"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"},"assets":{"type":"array","description":"External resources this script accesses (S3 objects, resources, etc.)","items":{"type":"object","required":["path","kind"],"properties":{"path":{"type":"string","description":"Path to the asset"},"kind":{"type":"string","description":"Type of asset","enum":["s3object","resource","ducklake","datatable","volume","dbt"]},"access_type":{"type":"string","nullable":true,"description":"Access level for this asset","enum":["r","w","rw"]},"alt_access_type":{"type":"string","nullable":true,"description":"Alternative access level","enum":["r","w","rw"]}}}}},"required":["type","content","language","input_transforms"]},"PathScript":{"type":"object","description":"Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the script in the workspace (e.g., 'f/scripts/send_email')"},"hash":{"type":"string","description":"Optional specific version hash of the script to use"},"type":{"type":"string","enum":["script"]},"tag_override":{"type":"string","description":"Override the script's default worker group tag"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"}},"required":["type","path","input_transforms"]},"PathFlow":{"type":"object","description":"Reference to an existing flow by path. Use this to call another flow as a subflow","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the flow in the workspace (e.g., 'f/flows/process_user')"},"type":{"type":"string","enum":["flow"]}},"required":["type","path","input_transforms"]},"ForloopFlow":{"type":"object","description":"Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations","properties":{"modules":{"type":"array","description":"Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'","items":{"$ref":"#/components/schemas/FlowModule"}},"iterator":{"description":"JavaScript expression that returns an array to iterate over. Can reference 'results.step_id' or 'flow_input'","$ref":"#/components/schemas/InputTransform"},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["forloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true. Limits resource usage. Can be static number or expression","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","iterator","skip_failures","type"]},"WhileloopFlow":{"type":"object","description":"Executes nested modules repeatedly until stopped. The implicit iterator is the iteration counter, so 'flow_input.iter.value' equals 'flow_input.iter.index' (0, 1, 2, ...) and never carries state. To carry state across iterations, a step reads its own previous-iteration result via 'results.<its_own_id>' with a first-iteration fallback - the loop's stop_after_if must then be on that inner step (a plain single-step body with stop_after_if on the loop module does not resolve 'results' across iterations and never terminates); plain counters can instead be derived from 'flow_input.iter.index', which works in every configuration. stop_after_if is evaluated after each iteration - on the loop module 'result' is the last iteration's result","properties":{"modules":{"type":"array","description":"Steps to execute in each iteration","items":{"$ref":"#/components/schemas/FlowModule"}},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["whileloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (use with caution in while loops)"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","skip_failures","type"]},"BranchOne":{"type":"object","description":"Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes","properties":{"branches":{"type":"array","description":"Array of branches to evaluate in order. The first branch with expr evaluating to true executes","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch condition"},"expr":{"type":"string","description":"JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"},"modules":{"type":"array","description":"Steps to execute if this branch's expr is true","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules","expr"]}},"default":{"type":"array","description":"Steps to execute if no branch expressions match","items":{"$ref":"#/components/schemas/FlowModule"}},"type":{"type":"string","enum":["branchone"]}},"required":["branches","default","type"]},"BranchAll":{"type":"object","description":"Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently","properties":{"branches":{"type":"array","description":"Array of branches that all execute (either in parallel or sequentially)","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch's purpose"},"skip_failure":{"type":"boolean","description":"If true, failure in this branch doesn't fail the entire flow"},"modules":{"type":"array","description":"Steps to execute in this branch","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules"]}},"type":{"type":"string","enum":["branchall"]},"parallel":{"type":"boolean","description":"If true, all branches execute concurrently. If false, they execute sequentially"}},"required":["branches","type"]},"AgentTool":{"type":"object","description":"A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool","properties":{"id":{"type":"string","description":"Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"},"summary":{"type":"string","description":"The name the AI agent calls this tool by, not a human label. On a flowmodule tool it must match ^[a-zA-Z0-9_]+$ - letters, numbers and underscores only (e.g. 'search_documentation', not 'Search documentation') - and always be set; on an mcp or websearch tool it is a plain label. Put the human-readable explanation in 'description'."},"description":{"type":"string","description":"Free-text description of the tool given to the AI to decide when and how to call it. Overrides the description auto-derived from the underlying script."},"job_token_scopes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scopes the token of this tool's jobs is restricted to, on top of the agent step's own restriction: a tool can only narrow it."},"value":{"$ref":"#/components/schemas/ToolValue"}},"required":["id","value"]},"ToolValue":{"description":"The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference","oneOf":[{"$ref":"#/components/schemas/FlowModuleTool"},{"$ref":"#/components/schemas/McpToolValue"},{"$ref":"#/components/schemas/WebsearchToolValue"}],"discriminator":{"propertyName":"tool_type","mapping":{"flowmodule":"#/components/schemas/FlowModuleTool","mcp":"#/components/schemas/McpToolValue","websearch":"#/components/schemas/WebsearchToolValue"}}},"FlowModuleTool":{"description":"A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module","allOf":[{"type":"object","properties":{"tool_type":{"type":"string","enum":["flowmodule"]}},"required":["tool_type"]},{"$ref":"#/components/schemas/FlowModuleValue"}]},"WebsearchToolValue":{"type":"object","description":"A tool implemented as a websearch tool. The AI can call this like any other websearch tool","properties":{"tool_type":{"type":"string","enum":["websearch"]}},"required":["tool_type"]},"McpToolValue":{"type":"object","description":"Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers","properties":{"tool_type":{"type":"string","enum":["mcp"]},"resource_path":{"type":"string","description":"Path to the MCP resource/server configuration"},"include_tools":{"type":"array","description":"Whitelist of specific tools to include from this MCP server","items":{"type":"string"}},"exclude_tools":{"type":"array","description":"Blacklist of tools to exclude from this MCP server","items":{"type":"string"}}},"required":["tool_type","resource_path"]},"AiAgent":{"type":"object","description":"AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task","properties":{"input_transforms":{"type":"object","description":"Input parameters for the AI agent mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"output_type":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Output format type.\\nValid values: 'text' (default) - plain text response, 'image' - image generation\\n"},"user_message":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"The user's prompt/message to the AI agent. Supports variable interpolation with\\nflow.input syntax. Required unless memory is off and \`previous_messages\` supplies\\nthe prompt; image output always needs it.\\n"},"system_prompt":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"System instructions that guide the AI's behavior, persona, and response style. Optional."},"streaming":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Boolean. If true, stream the AI response incrementally.\\nStreaming events include: token_delta, reasoning_token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\\n"},"memory":{"$ref":"#/components/schemas/MemoryTransform"},"memory_id":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"String. Names the memory this step reads and writes, overriding the memory id the run\\nwas started with (the chat conversation, an app chat session or the \`memory_id\` run\\nparameter). Leave unset to use the run's memory id. A fixed value shares one memory\\nacross every run; an expression such as \`flow_input.customer_id\` keeps one memory per\\nkey. When it evaluates to an empty value the agent runs without memory. Read only\\nwhile \`memory\` is \`window\` or \`compaction\`: it is ignored when memory is off, and an\\nolder \`auto\` or \`manual\` memory reads neither history input.\\n"},"previous_messages":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of MemoryMessage. History supplied by the flow, sent between the system prompt\\nand the user message. Read only while \`memory\` is off or absent: managed memory\\nignores it, and an older \`auto\` or \`manual\` memory reads neither history input.\\n"},"output_schema":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\\n"},"user_attachments":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of file references (images or PDFs) for the AI agent.\\nFormat: Array<{ bucket: string, key: string }> - S3 object references\\nExample: [{ bucket: 'my-bucket', key: 'documents/report.pdf' }]\\n"},"enabled_tools":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of strings naming which of the tools configured in \`tools\` the agent may call\\nthis run. Leaving it unset carries every one of them; an empty array carries none.\\nA tool is named as the model is shown it. An entry the model is shown nothing of is\\nnamed by what identifies it instead: an MCP server by its resource path, carrying\\nevery tool it exposes (which of them stays that entry's include_tools/exclude_tools),\\nand a websearch entry by the reserved name '__wm_web_search', whatever summary it carries\\n(no tool may take that name).\\nExample: ['get_user', 'u/admin/github_mcp', '__wm_web_search']\\n"},"max_completion_tokens":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Integer. Maximum number of tokens the AI will generate in its response.\\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\\n"},"temperature":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Float. Controls randomness/creativity of responses.\\nRange: 0.0 to 2.0 (provider-dependent)\\n- 0.0 = deterministic, focused responses\\n- 0.7 = balanced (common default)\\n- 1.0+ = more creative/random\\n"},"max_iterations":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Number. Limits how many times the agent can loop through reasoning and tool use.\\nRange: 1-1000.\\n"}}},"tools":{"type":"array","description":"Array of tools the agent can use. The agent decides which tools to call based on the task","items":{"$ref":"#/components/schemas/AgentTool"}},"type":{"type":"string","enum":["aiagent"]},"tag":{"type":"string","description":"Worker group tag for execution routing. If not set, the AI agent step runs on the flow's tag (default \`flow\`)"},"omit_output_from_conversation":{"type":"boolean","default":false,"description":"If true, this AI agent step does not persist its assistant or tool messages to the flow conversation when chat mode is enabled."},"agent":{"type":"string","description":"Path of a reusable \`ai_agent\` resource (hybrid linking). When set, the agent brain\\nconfig (provider/model/system prompt/etc.) and tool set are resolved at runtime from\\nthat resource; the module's input_transforms then only carry the flow-local inputs\\n(user_message, user_attachments, enabled_tools and the history inputs memory_id and previous_messages).\\n"},"tool_inputs":{"type":"object","description":"Host-local wiring for an agent's tool inputs, keyed by tool id then input key. Binds the\\nreferenced agent's tools to this flow's context (flow_input/results) without mutating the\\nshared resource; overlaid onto the tools' input_transforms at runtime \\u2014 including when\\n\`agent\` is unset, since a step forked for editing keeps these overrides until it is saved\\nback or unlinked.\\n","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}}},"parallel":{"type":"boolean","description":"If true, the agent can execute multiple tool calls in parallel"}},"required":["type","input_transforms"]},"AiDecision":{"type":"object","description":"AI decision step: one call to a decision model (TypeSafe's Jev, or Cloudflare's\\nJev-compatible Clef) that answers typed questions about a state with calibrated\\nprobabilities, instead of generating text.\\nPrefer it over an AI agent to classify, route, score or check something: it is fast,\\ncheap and its answers are structured. Its result is { output: { <question name>: answer },\\nmodel, usage }, so a later step reads e.g. results.<id>.output.intent.choice. To route on\\nthe answers, follow it with a branchone whose branch exprs read\\nresults.<id>.output.<question>.choice. Usable as an AI agent tool, where the calling agent\\nsupplies the state.\\n","properties":{"input_transforms":{"type":"object","description":"Input parameters for the decision mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"state":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"What the questions are asked about: a string, an object or an array of strings.\\nAn object with descriptive keys holding only what the questions need works best.\\nExample: { message: flow_input.message, plan: results.a.plan }\\n"},"questions":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Object mapping each question name to { type, instructions, criteria }, where type is:\\n- 'choice': criteria maps each option to its description (up to 255); the answer\\n has choice, probabilities and confidence\\n- 'score': criteria is an ordered array of 2 to 10 level descriptions; the answer\\n has score, legend, probabilities and confidence\\n- 'noul': yes/no, criteria optionally { true, false } descriptions; the answer has\\n noul, the probability of yes (0 to 1)\\nExample: { intent: { type: 'choice', instructions: 'What does the customer want?',\\ncriteria: { refund: 'Money back', bug: 'Something is broken' } } }\\n"}},"required":["provider","state","questions"]},"type":{"type":"string","enum":["aidecision"]},"tag":{"type":"string","description":"Worker group tag for execution routing. If not set, the step runs on the flow's tag (default \`flow\`)"}},"required":["type","input_transforms"]},"Identity":{"type":"object","description":"Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder","properties":{"type":{"type":"string","enum":["identity"]},"flow":{"type":"boolean","description":"If true, marks this as a flow identity (special handling)"}},"required":["type"]},"FlowStatus":{"type":"object","properties":{"step":{"type":"integer"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/FlowStatusModule"}},"user_states":{"additionalProperties":true},"preprocessor_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"}]},"failure_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"},{"type":"object","properties":{"parent_module":{"type":"string"}}}]},"retry":{"type":"object","properties":{"fail_count":{"type":"integer"},"failed_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"required":["step","modules","failure_module"]},"FlowStatusModule":{"type":"object","properties":{"type":{"type":"string","enum":["WaitingForPriorSteps","WaitingForEvents","WaitingForExecutor","InProgress","Success","Failure"]},"id":{"type":"string"},"job":{"type":"string","format":"uuid"},"count":{"type":"integer"},"progress":{"type":"integer"},"iterator":{"type":"object","properties":{"index":{"type":"integer"},"itered":{"type":"array","items":{}},"itered_len":{"type":"integer"},"args":{}}},"flow_jobs":{"type":"array","items":{"type":"string"}},"flow_jobs_success":{"type":"array","items":{"type":"boolean"}},"flow_jobs_duration":{"type":"object","properties":{"started_at":{"type":"array","items":{"type":"string"}},"duration_ms":{"type":"array","items":{"type":"integer"}}}},"branch_chosen":{"type":"object","properties":{"type":{"type":"string","enum":["branch","default"]},"branch":{"type":"integer"}},"required":["type"]},"branchall":{"type":"object","properties":{"branch":{"type":"integer"},"len":{"type":"integer"}},"required":["branch","len"]},"approvers":{"type":"array","items":{"type":"object","properties":{"resume_id":{"type":"integer"},"approver":{"type":"string"}},"required":["resume_id","approver"]}},"failed_retries":{"type":"array","items":{"type":"string","format":"uuid"}},"skipped":{"type":"boolean"},"agent_actions":{"type":"array","items":{"type":"object","oneOf":[{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"type":{"type":"string","enum":["tool_call"]},"module_id":{"type":"string"}},"required":["job_id","function_name","type","module_id"]},{"type":"object","properties":{"call_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"resource_path":{"type":"string"},"type":{"type":"string","enum":["mcp_tool_call"]},"arguments":{"type":"object"}},"required":["call_id","function_name","resource_path","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]}},"required":["content","type"]}]}},"agent_actions_success":{"type":"array","items":{"type":"boolean"}}},"required":["type"]}}
|
|
86030
|
+
{"OpenFlow":{"type":"object","description":"Top-level flow definition containing metadata, configuration, and the flow structure","properties":{"summary":{"type":"string","description":"Short description of what this flow does"},"description":{"type":"string","description":"Detailed documentation for this flow"},"value":{"$ref":"#/components/schemas/FlowValue"},"schema":{"type":"object","description":"JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')"},"on_behalf_of_email":{"type":"string","description":"Address of the account the flow runs on behalf of. Derived from on_behalf_of on read; accepted on write, where it is resolved to the account it names."},"on_behalf_of":{"type":"string","description":"The flow runs with the permissions of this identity: u/{username}, g/{group}, or a bare email when the username is itself email-shaped. The only stored half of the identity; on_behalf_of_email is derived from it. Omit it when writing and it is resolved from that address instead."}},"required":["summary","value"]},"FlowValue":{"type":"object","description":"The flow structure containing modules and optional preprocessor/failure handlers","properties":{"modules":{"type":"array","description":"Array of steps that execute in sequence. Each step can be a script, subflow, loop, or branch","items":{"$ref":"#/components/schemas/FlowModule"}},"failure_module":{"description":"Special module that executes when the flow fails. Receives error object with message, name, stack, and step_id. Must have id 'failure'. Only supports script/rawscript types","$ref":"#/components/schemas/FlowModule"},"preprocessor_module":{"description":"Special module that runs before the first step on external triggers. Must have id 'preprocessor'. Only supports script/rawscript types. Cannot reference other step results","$ref":"#/components/schemas/FlowModule"},"same_worker":{"type":"boolean","description":"If true, all steps run on the same worker for better performance"},"preserve_step_tags":{"type":"boolean","description":"If true and the flow runs on a custom worker tag, steps that declare their own non-empty tag run on it instead of inheriting the flow tag. Steps without their own tag still inherit the flow tag."},"concurrent_limit":{"type":"number","description":"Maximum number of concurrent executions of this flow"},"concurrency_key":{"type":"string","description":"Expression to group concurrent executions (e.g., by user ID)"},"concurrency_time_window_s":{"type":"number","description":"Time window in seconds for concurrent_limit"},"debounce_delay_s":{"type":"integer","description":"Delay in seconds to debounce flow executions"},"debounce_key":{"type":"string","description":"Expression to group debounced executions"},"debounce_args_to_accumulate":{"type":"array","description":"Arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"integer","description":"Maximum total time in seconds that a job can be debounced"},"max_total_debounces_amount":{"type":"integer","description":"Maximum number of times a job can be debounced"},"skip_expr":{"type":"string","description":"JavaScript expression to conditionally skip the entire flow"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for flow results"},"cache_ignore_s3_path":{"type":"boolean"},"delete_after_secs":{"type":"integer","description":"If set, delete the flow job's args, result and logs after this many seconds following job completion"},"flow_env":{"type":"object","description":"Environment variables available to all steps. Values can be strings, JSON values, or special references: '$var:path' (workspace variable) or '$res:path' (resource).","additionalProperties":{}},"priority":{"type":"number","description":"Execution priority (higher numbers run first)"},"early_return":{"type":"string","description":"JavaScript expression to return early from the flow"},"chat_input_enabled":{"type":"boolean","description":"Whether this flow accepts chat-style input"},"notes":{"type":"array","description":"Sticky notes attached to the flow","items":{"$ref":"#/components/schemas/FlowNote"}},"groups":{"type":"array","description":"Semantic groups of modules for organizational purposes","items":{"$ref":"#/components/schemas/FlowGroup"}}},"required":["modules"]},"Retry":{"type":"object","description":"Retry configuration for failed module executions","properties":{"constant":{"type":"object","description":"Retry with constant delay between attempts","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"seconds":{"type":"integer","description":"Seconds to wait between retries"}}},"exponential":{"type":"object","description":"Retry with exponential backoff: the n-th retry waits multiplier \\u00d7 seconds^n","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"multiplier":{"type":"integer","description":"Multiplier for exponential backoff"},"seconds":{"type":"integer","minimum":1,"description":"Base of the exponential (seconds); the n-th retry waits multiplier \\u00d7 seconds^n, where n counts constant retries too"},"random_factor":{"type":"integer","minimum":0,"maximum":100,"description":"Random jitter percentage (0-100) to avoid thundering herd"}}},"retry_if":{"$ref":"#/components/schemas/RetryIf"}}},"FlowNote":{"type":"object","description":"A sticky note attached to a flow for documentation and annotation","properties":{"id":{"type":"string","description":"Unique identifier for the note"},"text":{"type":"string","description":"Content of the note"},"position":{"type":"object","description":"Position of the note in the flow editor","properties":{"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"}},"required":["x","y"]},"size":{"type":"object","description":"Size of the note in the flow editor","properties":{"width":{"type":"number","description":"Width in pixels"},"height":{"type":"number","description":"Height in pixels"}},"required":["width","height"]},"color":{"type":"string","description":"Color of the note, one of: yellow, blue, green, purple, pink, orange, red, cyan, lime, gray. Any other value renders unstyled."},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes. 'group' notes are deprecated; segment a flow with FlowValue.groups instead."},"locked":{"type":"boolean","default":false,"description":"Whether the note is locked and cannot be edited or moved"},"contained_node_ids":{"type":"array","items":{"type":"string"},"description":"For group notes, the IDs of nodes contained within this group"}},"required":["id","text","color","type"]},"FlowGroup":{"type":"object","description":"A semantic group of flow modules for organizational purposes. Does not affect execution \\u2014 modules remain in their original position in the flow. Groups provide naming and collapsibility in the editor. Members are computed dynamically from all nodes on paths between start_id and end_id.","properties":{"summary":{"type":"string","description":"Display name for this group"},"note":{"type":"string","description":"Markdown note shown below the group header"},"autocollapse":{"type":"boolean","default":false,"description":"If true, this group is collapsed by default in the flow editor. UI hint only."},"start_id":{"type":"string","description":"ID of the first flow module in this group (topological entry point)"},"end_id":{"type":"string","description":"ID of the last flow module in this group (topological exit point)"},"color":{"type":"string","description":"Color for the group in the flow editor, one of: yellow, blue, green, purple, pink, orange, red, cyan, lime, gray. Omit it to let the editor pick one."}},"required":["start_id","end_id"]},"RetryIf":{"type":"object","description":"Conditional retry based on error or result","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables"}},"required":["expr"]},"StopAfterIf":{"type":"object","description":"Early termination condition for a module","properties":{"skip_if_stopped":{"type":"boolean","description":"If true, following steps are skipped when this condition triggers"},"expr":{"type":"string","description":"JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"},"error_message":{"type":"string","nullable":true,"description":"Custom error message when stopping with an error. Mutually exclusive with skip_if_stopped. If set to a non-empty string, the flow stops with this error. If empty string, a default error message is used. If null or omitted, no error is raised."},"error_include_result":{"type":"boolean","description":"When stopping with an error (error_message set), embed the stopping step's own result inside the raised error object (as error.result) instead of discarding it. The top-level result stays { error }. Defaults to false."}},"required":["expr"]},"FlowModule":{"type":"object","description":"A single step in a flow. Can be a script, subflow, loop, or branch","properties":{"id":{"type":"string","description":"Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"},"value":{"$ref":"#/components/schemas/FlowModuleValue"},"stop_after_if":{"description":"Early termination condition evaluated after this step completes","$ref":"#/components/schemas/StopAfterIf"},"stop_after_all_iters_if":{"description":"For loops only - early termination condition evaluated after all iterations complete","$ref":"#/components/schemas/StopAfterIf"},"skip_if":{"type":"object","description":"Conditionally skip this step based on previous results or flow inputs","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'"}},"required":["expr"]},"sleep":{"description":"Delay before executing this step (in seconds or as expression)","$ref":"#/components/schemas/InputTransform"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for this step's results"},"cache_ignore_s3_path":{"type":"boolean"},"timeout":{"description":"Maximum execution time in seconds (static value or expression)","$ref":"#/components/schemas/InputTransform"},"delete_after_secs":{"type":"integer","description":"If set, delete the step's args, result and logs after this many seconds following job completion"},"summary":{"type":"string","description":"Short description of what this step does"},"mock":{"type":"object","description":"Mock configuration for testing without executing the actual step","properties":{"enabled":{"type":"boolean","description":"If true, return mock value instead of executing"},"return_value":{"description":"Value to return when mocked"}}},"suspend":{"type":"object","description":"Configuration for approval/resume steps that wait for user input","properties":{"required_events":{"type":"integer","description":"Number of approvals required before continuing"},"timeout":{"type":"integer","description":"Timeout in seconds before auto-continuing or canceling"},"resume_form":{"type":"object","description":"Form schema for collecting input when resuming","properties":{"schema":{"type":"object","description":"JSON Schema for the resume form"}}},"user_auth_required":{"type":"boolean","description":"If true, only authenticated users can approve"},"user_groups_required":{"description":"Expression or list of groups that can approve","$ref":"#/components/schemas/InputTransform"},"self_approval_disabled":{"type":"boolean","description":"If true, the user who started the flow cannot approve"},"hide_cancel":{"type":"boolean","description":"If true, hide the cancel button on the approval form"},"continue_on_disapprove_timeout":{"type":"boolean","description":"If true, continue flow on timeout instead of canceling"},"skin":{"type":"string","enum":["detailed","minimal"],"description":"How the approval request is presented, on the approval page and in Slack/Teams approval messages. 'detailed' (used when unset) shows the flow details (arguments, graph, approvers); 'minimal' shows only the request: the step description, form and approve/reject actions"}}},"priority":{"type":"number","description":"Execution priority for this step (higher numbers run first)"},"continue_on_error":{"type":"boolean","description":"If true, flow continues even if this step fails"},"job_token_scopes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scopes the token of this step's jobs is restricted to (domain:action[:resource], e.g. oidc:write), on top of the flow's own restriction: a step can only narrow it. Applies to everything the step runs (loop and branch bodies, AI agent tools)."},"retry":{"description":"Retry configuration if this step fails","$ref":"#/components/schemas/Retry"},"debouncing":{"description":"Debounce configuration for this step (EE only)","type":"object","properties":{"debounce_delay_s":{"type":"integer","description":"Delay in seconds to debounce this step's executions across flow runs"},"debounce_key":{"type":"string","description":"Expression to group debounced executions. Supports $workspace and $args[name]. Default: $workspace/flow/<flow_path>-<step_id>"},"debounce_args_to_accumulate":{"type":"array","description":"Array-type arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"integer","description":"Maximum total time in seconds before forced execution"},"max_total_debounces_amount":{"type":"integer","description":"Maximum number of debounces before forced execution"}}}},"required":["value","id"]},"InputTransform":{"description":"Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs","oneOf":[{"$ref":"#/components/schemas/StaticTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"StaticTransform":{"type":"object","description":"Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'","properties":{"value":{"description":"The static value. For resources, use format '$res:path/to/resource'"},"type":{"type":"string","enum":["static"]}},"required":["type"]},"JavascriptTransform":{"type":"object","description":"JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside for loops, use 'flow_input.iter.value' for the current iteration value (in while loops it equals 'flow_input.iter.index')","properties":{"expr":{"type":"string","description":"JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"},"type":{"type":"string","enum":["javascript"]}},"required":["expr","type"]},"AiTransform":{"type":"object","description":"Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.","properties":{"type":{"type":"string","enum":["ai"]}},"required":["type"]},"AIProviderKind":{"type":"string","description":"Supported AI provider types","enum":["openai","azure_openai","azure_foundry","anthropic","mistral","deepseek","googleai","groq","openrouter","togetherai","customai","aws_bedrock","typesafe","cloudflare"]},"ProviderConfig":{"type":"object","description":"Complete AI provider configuration with resource reference and model selection","properties":{"kind":{"$ref":"#/components/schemas/AIProviderKind"},"resource":{"type":"string","description":"Resource reference in format '$res:{resource_path}' pointing to provider credentials"},"model":{"type":"string","description":"Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')"},"reasoning_effort":{"type":"string","description":"Provider-native reasoning effort token (e.g. 'low', 'high', 'none') for models that support extended thinking. Optional; unset leaves the provider default."}},"required":["kind","resource","model"]},"StaticProviderTransform":{"type":"object","description":"Static provider configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/ProviderConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"ProviderTransform":{"description":"Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticProviderTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticProviderTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"MemoryOff":{"type":"object","description":"No conversation memory/context","properties":{"kind":{"type":"string","enum":["off"]}},"required":["kind"]},"MemoryWindow":{"type":"object","description":"Keeps the most recent messages of the memory named by the run's memory id (or the step's\\n\`memory_id\`). Without a memory id the agent runs without memory.\\n","properties":{"kind":{"type":"string","enum":["window"]},"context_length":{"type":"integer","description":"Number of most recent messages to load and store. 0 turns memory off."}},"required":["kind","context_length"]},"MemoryAuto":{"type":"object","deprecated":true,"description":"Deprecated, still read as it was written: the run's memory id, else the \`memory_id\` here.\\nThe step's own \`memory_id\` is not read while this kind is set; switch the kind to \`window\`\\nto use it. Without a \`context_length\`, or with 0, it is \`off\` and reads \`previous_messages\`.\\n","properties":{"kind":{"type":"string","enum":["auto"]},"context_length":{"type":"integer","description":"Maximum number of messages to retain in context"},"memory_id":{"type":"string","description":"Identifier for persistent memory across agent invocations"}},"required":["kind"]},"MemoryCompaction":{"type":"object","description":"Keeps the whole memory named by the run's memory id (or the step's \`memory_id\`), replacing\\nits older part with a summary as the conversation approaches the model's context window.\\nWithout a memory id the agent runs without memory, and compaction bounds the run's own loop.\\n","properties":{"kind":{"type":"string","enum":["compaction"]},"context_window":{"type":"integer","description":"Overrides the context window looked up from the model, in tokens. Only a model\\nWindmill does not know needs one; those fall back to 128000.\\n"}},"required":["kind"]},"MemoryMessage":{"type":"object","description":"A single message in conversation history","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]},"MemoryManual":{"type":"object","deprecated":true,"description":"Deprecated, still read as it was written. Move the step to \`off\` with \`previous_messages\` instead.","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Managed memory, stored by Windmill and replayed with each request. The memory is named by a memory id, see \`memory_id\`. While it is off, a step can supply its history in \`previous_messages\`.","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryWindow"},{"$ref":"#/components/schemas/MemoryCompaction"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","window":"#/components/schemas/MemoryWindow","compaction":"#/components/schemas/MemoryCompaction","auto":"#/components/schemas/MemoryAuto","manual":"#/components/schemas/MemoryManual"}}},"StaticMemoryTransform":{"type":"object","description":"Static memory configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/MemoryConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"MemoryTransform":{"description":"Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticMemoryTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticMemoryTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"FlowModuleValue":{"description":"The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type","oneOf":[{"$ref":"#/components/schemas/RawScript"},{"$ref":"#/components/schemas/PathScript"},{"$ref":"#/components/schemas/PathFlow"},{"$ref":"#/components/schemas/ForloopFlow"},{"$ref":"#/components/schemas/WhileloopFlow"},{"$ref":"#/components/schemas/BranchOne"},{"$ref":"#/components/schemas/BranchAll"},{"$ref":"#/components/schemas/Identity"},{"$ref":"#/components/schemas/AiAgent"},{"$ref":"#/components/schemas/AiDecision"}],"discriminator":{"propertyName":"type","mapping":{"rawscript":"#/components/schemas/RawScript","script":"#/components/schemas/PathScript","flow":"#/components/schemas/PathFlow","forloopflow":"#/components/schemas/ForloopFlow","whileloopflow":"#/components/schemas/WhileloopFlow","branchone":"#/components/schemas/BranchOne","branchall":"#/components/schemas/BranchAll","identity":"#/components/schemas/Identity","aiagent":"#/components/schemas/AiAgent","aidecision":"#/components/schemas/AiDecision"}}},"RawScript":{"type":"object","description":"Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"content":{"type":"string","description":"The script source code. Should export a 'main' function"},"language":{"type":"string","description":"Programming language for this script","enum":["deno","bun","bunnative","python3","go","bash","powershell","postgresql","mysql","bigquery","snowflake","mssql","oracledb","graphql","nativets","php","rust","ansible","csharp","nu","java","ruby","rlang","duckdb"]},"path":{"type":"string","description":"Optional path for saving this script"},"lock":{"type":"string","description":"Lock file content for dependencies"},"type":{"type":"string","enum":["rawscript"]},"tag":{"type":"string","description":"Worker group tag for execution routing"},"concurrent_limit":{"type":"number","description":"Maximum concurrent executions of this script"},"concurrency_time_window_s":{"type":"number","description":"Time window for concurrent_limit"},"custom_concurrency_key":{"type":"string","description":"Custom key for grouping concurrent executions"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"},"assets":{"type":"array","description":"External resources this script accesses (S3 objects, resources, etc.)","items":{"type":"object","required":["path","kind"],"properties":{"path":{"type":"string","description":"Path to the asset"},"kind":{"type":"string","description":"Type of asset","enum":["s3object","resource","ducklake","datatable","volume","dbt"]},"access_type":{"type":"string","nullable":true,"description":"Access level for this asset","enum":["r","w","rw"]},"alt_access_type":{"type":"string","nullable":true,"description":"Alternative access level","enum":["r","w","rw"]}}}}},"required":["type","content","language","input_transforms"]},"PathScript":{"type":"object","description":"Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the script in the workspace (e.g., 'f/scripts/send_email')"},"hash":{"type":"string","description":"Optional specific version hash of the script to use"},"type":{"type":"string","enum":["script"]},"tag_override":{"type":"string","description":"Override the script's default worker group tag"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"}},"required":["type","path","input_transforms"]},"PathFlow":{"type":"object","description":"Reference to an existing flow by path. Use this to call another flow as a subflow","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the flow in the workspace (e.g., 'f/flows/process_user')"},"type":{"type":"string","enum":["flow"]}},"required":["type","path","input_transforms"]},"ForloopFlow":{"type":"object","description":"Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations","properties":{"modules":{"type":"array","description":"Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'","items":{"$ref":"#/components/schemas/FlowModule"}},"iterator":{"description":"JavaScript expression that returns an array to iterate over. Can reference 'results.step_id' or 'flow_input'","$ref":"#/components/schemas/InputTransform"},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["forloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true. Limits resource usage. Can be static number or expression","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","iterator","skip_failures","type"]},"WhileloopFlow":{"type":"object","description":"Executes nested modules repeatedly until stopped. The implicit iterator is the iteration counter, so 'flow_input.iter.value' equals 'flow_input.iter.index' (0, 1, 2, ...) and never carries state. To carry state across iterations, a step reads its own previous-iteration result via 'results.<its_own_id>' with a first-iteration fallback - the loop's stop_after_if must then be on that inner step (a plain single-step body with stop_after_if on the loop module does not resolve 'results' across iterations and never terminates); plain counters can instead be derived from 'flow_input.iter.index', which works in every configuration. stop_after_if is evaluated after each iteration - on the loop module 'result' is the last iteration's result","properties":{"modules":{"type":"array","description":"Steps to execute in each iteration","items":{"$ref":"#/components/schemas/FlowModule"}},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["whileloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (use with caution in while loops)"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","skip_failures","type"]},"BranchOne":{"type":"object","description":"Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes","properties":{"branches":{"type":"array","description":"Array of branches to evaluate in order. The first branch with expr evaluating to true executes","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch condition"},"expr":{"type":"string","description":"JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"},"modules":{"type":"array","description":"Steps to execute if this branch's expr is true","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules","expr"]}},"default":{"type":"array","description":"Steps to execute if no branch expressions match","items":{"$ref":"#/components/schemas/FlowModule"}},"type":{"type":"string","enum":["branchone"]}},"required":["branches","default","type"]},"BranchAll":{"type":"object","description":"Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently","properties":{"branches":{"type":"array","description":"Array of branches that all execute (either in parallel or sequentially)","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch's purpose"},"skip_failure":{"type":"boolean","description":"If true, failure in this branch doesn't fail the entire flow"},"modules":{"type":"array","description":"Steps to execute in this branch","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules"]}},"type":{"type":"string","enum":["branchall"]},"parallel":{"type":"boolean","description":"If true, all branches execute concurrently. If false, they execute sequentially"}},"required":["branches","type"]},"AgentTool":{"type":"object","description":"A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool","properties":{"id":{"type":"string","description":"Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"},"summary":{"type":"string","description":"The name the AI agent calls this tool by, not a human label. On a flowmodule tool it must match ^[a-zA-Z0-9_]+$ - letters, numbers and underscores only (e.g. 'search_documentation', not 'Search documentation') - and always be set; on an mcp or websearch tool it is a plain label. Put the human-readable explanation in 'description'."},"description":{"type":"string","description":"Free-text description of the tool given to the AI to decide when and how to call it. Overrides the description auto-derived from the underlying script."},"job_token_scopes":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scopes the token of this tool's jobs is restricted to, on top of the agent step's own restriction: a tool can only narrow it."},"value":{"$ref":"#/components/schemas/ToolValue"}},"required":["id","value"]},"ToolValue":{"description":"The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference","oneOf":[{"$ref":"#/components/schemas/FlowModuleTool"},{"$ref":"#/components/schemas/McpToolValue"},{"$ref":"#/components/schemas/WebsearchToolValue"}],"discriminator":{"propertyName":"tool_type","mapping":{"flowmodule":"#/components/schemas/FlowModuleTool","mcp":"#/components/schemas/McpToolValue","websearch":"#/components/schemas/WebsearchToolValue"}}},"FlowModuleTool":{"description":"A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module","allOf":[{"type":"object","properties":{"tool_type":{"type":"string","enum":["flowmodule"]}},"required":["tool_type"]},{"$ref":"#/components/schemas/FlowModuleValue"}]},"WebsearchToolValue":{"type":"object","description":"A tool implemented as a websearch tool. The AI can call this like any other websearch tool","properties":{"tool_type":{"type":"string","enum":["websearch"]}},"required":["tool_type"]},"McpToolValue":{"type":"object","description":"Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers","properties":{"tool_type":{"type":"string","enum":["mcp"]},"resource_path":{"type":"string","description":"Path to the MCP resource/server configuration"},"include_tools":{"type":"array","description":"Whitelist of specific tools to include from this MCP server","items":{"type":"string"}},"exclude_tools":{"type":"array","description":"Blacklist of tools to exclude from this MCP server","items":{"type":"string"}}},"required":["tool_type","resource_path"]},"AiAgent":{"type":"object","description":"AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task","properties":{"input_transforms":{"type":"object","description":"Input parameters for the AI agent mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"output_type":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Output format type.\\nValid values: 'text' (default) - plain text response, 'image' - image generation\\n"},"user_message":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"The user's prompt/message to the AI agent. Supports variable interpolation with\\nflow.input syntax. Required unless memory is off and \`previous_messages\` supplies\\nthe prompt; image output always needs it.\\n"},"system_prompt":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"System instructions that guide the AI's behavior, persona, and response style. Optional."},"streaming":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Boolean. If true, stream the AI response incrementally.\\nStreaming events include: token_delta, reasoning_token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\\n"},"memory":{"$ref":"#/components/schemas/MemoryTransform"},"memory_id":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"String. Names the memory this step reads and writes, overriding the memory id the run\\nwas started with (the chat conversation, an app chat session or the \`memory_id\` run\\nparameter). Leave unset to use the run's memory id. A fixed value shares one memory\\nacross every run; an expression such as \`flow_input.customer_id\` keeps one memory per\\nkey. When it evaluates to an empty value the agent runs without memory. Read only\\nwhile \`memory\` is \`window\` or \`compaction\`: it is ignored when memory is off, and an\\nolder \`auto\` or \`manual\` memory reads neither history input.\\n"},"previous_messages":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of MemoryMessage. History supplied by the flow, sent between the system prompt\\nand the user message. Read only while \`memory\` is off or absent: managed memory\\nignores it, and an older \`auto\` or \`manual\` memory reads neither history input.\\n"},"output_schema":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\\n"},"user_attachments":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of file references (images or PDFs) for the AI agent.\\nFormat: Array<{ bucket: string, key: string }> - S3 object references\\nExample: [{ bucket: 'my-bucket', key: 'documents/report.pdf' }]\\n"},"enabled_tools":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of strings naming which of the tools configured in \`tools\` the agent may call\\nthis run. Leaving it unset carries every one of them; an empty array carries none.\\nA tool is named as the model is shown it. An entry the model is shown nothing of is\\nnamed by what identifies it instead: an MCP server by its resource path, carrying\\nevery tool it exposes (which of them stays that entry's include_tools/exclude_tools),\\nand a websearch entry by the reserved name '__wm_web_search', whatever summary it carries\\n(no tool may take that name).\\nExample: ['get_user', 'u/admin/github_mcp', '__wm_web_search']\\n"},"max_completion_tokens":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Integer. Maximum number of tokens the AI will generate in its response.\\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\\n"},"temperature":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Float. Controls randomness/creativity of responses.\\nRange: 0.0 to 2.0 (provider-dependent)\\n- 0.0 = deterministic, focused responses\\n- 0.7 = balanced (common default)\\n- 1.0+ = more creative/random\\n"},"max_iterations":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Number. Limits how many times the agent can loop through reasoning and tool use.\\nRange: 1-1000.\\n"}}},"tools":{"type":"array","description":"Array of tools the agent can use. The agent decides which tools to call based on the task","items":{"$ref":"#/components/schemas/AgentTool"}},"type":{"type":"string","enum":["aiagent"]},"tag":{"type":"string","description":"Worker group tag for execution routing. If not set, the AI agent step runs on the flow's tag (default \`flow\`)"},"omit_output_from_conversation":{"type":"boolean","default":false,"description":"If true, this AI agent step does not persist its assistant or tool messages to the flow conversation when chat mode is enabled."},"agent":{"type":"string","description":"Path of a reusable \`ai_agent\` resource (hybrid linking). When set, the agent brain\\nconfig (provider/model/system prompt/etc.) and tool set are resolved at runtime from\\nthat resource; the module's input_transforms then only carry the flow-local inputs\\n(user_message, user_attachments, enabled_tools and the history inputs memory_id and previous_messages).\\n"},"tool_inputs":{"type":"object","description":"Host-local wiring for an agent's tool inputs, keyed by tool id then input key. Binds the\\nreferenced agent's tools to this flow's context (flow_input/results) without mutating the\\nshared resource; overlaid onto the tools' input_transforms at runtime \\u2014 including when\\n\`agent\` is unset, since a step forked for editing keeps these overrides until it is saved\\nback or unlinked.\\n","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}}},"parallel":{"type":"boolean","description":"If true, the agent can execute multiple tool calls in parallel"}},"required":["type","input_transforms"]},"AiDecision":{"type":"object","description":"AI decision step: one call to a decision model (TypeSafe's Jev, Cloudflare's\\nJev-compatible Clef, or OpenAI's Decisions API) that answers typed questions about a\\nstate with calibrated probabilities, instead of generating text.\\nPrefer it over an AI agent to classify, route, score or check something: it is fast,\\ncheap and its answers are structured. Its result is { output: { <question name>: answer },\\nmodel, usage }, so a later step reads e.g. results.<id>.output.intent.choice. To route on\\nthe answers, follow it with a branchone whose branch exprs read\\nresults.<id>.output.<question>.choice. Usable as an AI agent tool, where the calling agent\\nsupplies the state.\\n","properties":{"input_transforms":{"type":"object","description":"Input parameters for the decision mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"state":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"What the questions are asked about: a string, an object or an array of strings.\\nAn object with descriptive keys holding only what the questions need works best.\\nExample: { message: flow_input.message, plan: results.a.plan }\\n"},"questions":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Object mapping each question name to { type, instructions, criteria }, where type is:\\n- 'choice': criteria maps each option to its description (up to 255); the answer\\n has choice, probabilities and confidence\\n- 'score': criteria is an ordered array of 2 to 10 level descriptions; the answer\\n has score, legend, probabilities and confidence\\n- 'noul': yes/no, criteria optionally { true, false } descriptions; the answer has\\n noul, the probability of yes (0 to 1)\\nExample: { intent: { type: 'choice', instructions: 'What does the customer want?',\\ncriteria: { refund: 'Money back', bug: 'Something is broken' } } }\\n"}},"required":["provider","state","questions"]},"type":{"type":"string","enum":["aidecision"]},"tag":{"type":"string","description":"Worker group tag for execution routing. If not set, the step runs on the flow's tag (default \`flow\`)"}},"required":["type","input_transforms"]},"Identity":{"type":"object","description":"Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder","properties":{"type":{"type":"string","enum":["identity"]},"flow":{"type":"boolean","description":"If true, marks this as a flow identity (special handling)"}},"required":["type"]},"FlowStatus":{"type":"object","properties":{"step":{"type":"integer"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/FlowStatusModule"}},"user_states":{"additionalProperties":true},"preprocessor_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"}]},"failure_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"},{"type":"object","properties":{"parent_module":{"type":"string"}}}]},"retry":{"type":"object","properties":{"fail_count":{"type":"integer"},"failed_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"required":["step","modules","failure_module"]},"FlowStatusModule":{"type":"object","properties":{"type":{"type":"string","enum":["WaitingForPriorSteps","WaitingForEvents","WaitingForExecutor","InProgress","Success","Failure"]},"id":{"type":"string"},"job":{"type":"string","format":"uuid"},"count":{"type":"integer"},"progress":{"type":"integer"},"iterator":{"type":"object","properties":{"index":{"type":"integer"},"itered":{"type":"array","items":{}},"itered_len":{"type":"integer"},"args":{}}},"flow_jobs":{"type":"array","items":{"type":"string"}},"flow_jobs_success":{"type":"array","items":{"type":"boolean"}},"flow_jobs_duration":{"type":"object","properties":{"started_at":{"type":"array","items":{"type":"string"}},"duration_ms":{"type":"array","items":{"type":"integer"}}}},"branch_chosen":{"type":"object","properties":{"type":{"type":"string","enum":["branch","default"]},"branch":{"type":"integer"}},"required":["type"]},"branchall":{"type":"object","properties":{"branch":{"type":"integer"},"len":{"type":"integer"}},"required":["branch","len"]},"approvers":{"type":"array","items":{"type":"object","properties":{"resume_id":{"type":"integer"},"approver":{"type":"string"}},"required":["resume_id","approver"]}},"failed_retries":{"type":"array","items":{"type":"string","format":"uuid"}},"skipped":{"type":"boolean"},"agent_actions":{"type":"array","items":{"type":"object","oneOf":[{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"type":{"type":"string","enum":["tool_call"]},"module_id":{"type":"string"}},"required":["job_id","function_name","type","module_id"]},{"type":"object","properties":{"call_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"resource_path":{"type":"string"},"type":{"type":"string","enum":["mcp_tool_call"]},"arguments":{"type":"object"}},"required":["call_id","function_name","resource_path","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]}},"required":["content","type"]}]}},"agent_actions_success":{"type":"array","items":{"type":"boolean"}}},"required":["type"]}}
|
|
85989
86031
|
`,
|
|
85990
86032
|
"raw-app": `---
|
|
85991
86033
|
name: raw-app
|
|
@@ -86000,47 +86042,53 @@ This guide covers raw apps from the terminal: scaffolding via \`wmill app new\`,
|
|
|
86000
86042
|
|
|
86001
86043
|
**You — the AI agent — create the app yourself by running \`wmill app new\` with the right flags. Do NOT tell the user to "run \`wmill app new\` and follow the prompts" or wait for them to do it.** The bare \`wmill app new\` is an interactive wizard that hangs waiting for stdin in any non-TTY context (which includes you). Always pass flags.
|
|
86002
86044
|
|
|
86003
|
-
### Step 1 —
|
|
86045
|
+
### Step 1 — Settle the setup
|
|
86004
86046
|
|
|
86005
|
-
You need three
|
|
86047
|
+
You need three values to run the command:
|
|
86006
86048
|
|
|
86007
86049
|
1. **summary** — a short description of the app
|
|
86008
86050
|
2. **path** — the windmill path, e.g. \`f/folder/my_app\` or \`u/username/my_app\`
|
|
86009
86051
|
3. **framework** — one of \`react19\` (recommended), \`react18\`, \`svelte5\`, \`vue\`
|
|
86010
86052
|
|
|
86011
|
-
|
|
86053
|
+
**summary and path**: if the user's request did not supply them, ask. Do not guess values and do not invent paths.
|
|
86054
|
+
|
|
86055
|
+
**framework**: never ask. Use the one the user named, otherwise the one the project's existing apps use, otherwise \`react19\` (see "Starting a new app" in the authoring guide).
|
|
86056
|
+
|
|
86057
|
+
**data setup**: when the app has to store data and the user did not say where, ask which data table, which schema and which tables, as "Data setup" in the authoring guide lays out. \`wmill datatable list\` gives the data tables to offer.
|
|
86012
86058
|
|
|
86013
|
-
Use whichever interactive question facility your runtime provides — a structured multi-choice tool if available, otherwise plain chat — and group
|
|
86059
|
+
Use whichever interactive question facility your runtime provides — a structured multi-choice tool if available, otherwise plain chat — and group everything missing into a single round-trip so the user answers at once:
|
|
86014
86060
|
|
|
86015
|
-
- For \`framework\` — multiple-choice with the four allowed values; mark \`react19\` as \`(Recommended)\` and put it first.
|
|
86016
86061
|
- For \`summary\` and \`path\` — provide one or two example values as multiple-choice options (the user can pick "Other" to type a free-form answer).
|
|
86062
|
+
- For the data setup — the choices the authoring guide lists, the default first.
|
|
86017
86063
|
|
|
86018
|
-
Only proceed once
|
|
86064
|
+
Only proceed once every value is concrete. If the user replies with something ambiguous, ask again rather than guessing.
|
|
86019
86065
|
|
|
86020
86066
|
### Step 2 — Run the command yourself
|
|
86021
86067
|
|
|
86022
|
-
Once
|
|
86068
|
+
Once the setup is settled, run it:
|
|
86023
86069
|
|
|
86024
86070
|
\`\`\`bash
|
|
86025
86071
|
wmill app new \\
|
|
86026
86072
|
--summary "Customer dashboard" \\
|
|
86027
86073
|
--path f/sales/dashboard \\
|
|
86028
|
-
--framework react19
|
|
86074
|
+
--framework react19 \\
|
|
86075
|
+
--datatable main \\
|
|
86076
|
+
--schema app1
|
|
86029
86077
|
\`\`\`
|
|
86030
86078
|
|
|
86031
|
-
|
|
86079
|
+
\`--summary\`, \`--path\` and \`--framework\` are the minimum. The datatable wizard and the "Open in Claude Desktop?" prompt are skipped silently because passing any of them puts the command in non-interactive mode, so the data setup only reaches the app through the flags below.
|
|
86032
86080
|
|
|
86033
86081
|
### Optional flags
|
|
86034
86082
|
|
|
86035
|
-
Layer these in only when the user asked for them:
|
|
86036
|
-
|
|
86037
86083
|
| Flag | When to add it |
|
|
86038
86084
|
|---|---|
|
|
86039
|
-
| \`--datatable <name>\` | The
|
|
86040
|
-
| \`--schema <name>\` | Together with \`--datatable
|
|
86085
|
+
| \`--datatable <name>\` | The app stores data: the data table settled in step 1. Without it, the app is created with no datatable. |
|
|
86086
|
+
| \`--schema <name>\` | Together with \`--datatable\`, when the app's tables go in a schema, new or existing. If the schema doesn't exist yet, writes a \`sql_to_apply/\` migration with \`CREATE SCHEMA IF NOT EXISTS\`, applied like any other migration (see "SQL Migrations" below). Leave it out for \`public\`. |
|
|
86041
86087
|
| \`--overwrite\` | The target directory already exists and the user said it's OK to replace. Without it, non-interactive mode aborts with an error so you don't clobber existing work. |
|
|
86042
86088
|
| \`--no-open-in-desktop\` | Already implied in non-interactive mode; only needed if you're somehow running interactively. |
|
|
86043
86089
|
|
|
86090
|
+
Existing tables the app reuses have no flag: list them under \`data.tables\` in \`raw_app.yaml\` (see "Data tables" below).
|
|
86091
|
+
|
|
86044
86092
|
### Step 3 — Offer the visual preview
|
|
86045
86093
|
|
|
86046
86094
|
After \`wmill app new\` and any initial edits to \`App.tsx\` / \`index.tsx\`, **offer** to open the visual preview as a one-sentence next step (e.g. "Want me to open the visual preview?"). Don't auto-open — opening the dev page has side effects (browser window, possibly a \`launch.json\` entry when an embedded preview tool is in play) the user should consent to.
|
|
@@ -86051,8 +86099,9 @@ For apps the preview command runs from the app folder (\`cd <app_path>__raw_app
|
|
|
86051
86099
|
|
|
86052
86100
|
- ❌ Running \`wmill app new\` with no flags (the prompt will hang).
|
|
86053
86101
|
- ❌ Telling the user to "run \`wmill app new\` and follow the prompts" — that's a step backwards from what you can do directly.
|
|
86054
|
-
- ❌ Inventing a path
|
|
86055
|
-
- ❌
|
|
86102
|
+
- ❌ Inventing a path or summary instead of asking the user.
|
|
86103
|
+
- ❌ Asking which framework to use — \`react19\` is the default when nothing says otherwise.
|
|
86104
|
+
- ❌ Creating a schema or tables for a new app before the user has said where its data goes.
|
|
86056
86105
|
- ❌ Passing \`--overwrite\` automatically when the directory exists — confirm with the user first.
|
|
86057
86106
|
|
|
86058
86107
|
### Interactive (only when a human is at the terminal)
|
|
@@ -86239,6 +86288,38 @@ A raw app has three logical parts:
|
|
|
86239
86288
|
- **Backend runnables** — server-side scripts the frontend calls, each addressed by a unique key.
|
|
86240
86289
|
- **Data** — optional whitelisted datatables (managed PostgreSQL) that the backend runnables can query. The frontend never queries the database directly; backend runnables are the only bridge.
|
|
86241
86290
|
|
|
86291
|
+
## Starting a new app
|
|
86292
|
+
|
|
86293
|
+
A new app gets the setup Windmill's own new-app dialog gives one: a framework, then where its data lives.
|
|
86294
|
+
|
|
86295
|
+
### Framework
|
|
86296
|
+
|
|
86297
|
+
Use the framework the user named. When they named none, follow what there is to follow: the app being edited, or the apps the request points at. With nothing to follow, use **React 19**, the recommended default, **without asking**. React 18, Svelte 5 and Vue are for when they are asked for.
|
|
86298
|
+
|
|
86299
|
+
### Data setup
|
|
86300
|
+
|
|
86301
|
+
When a new app has to store data and the user did not say where, **ask before creating anything**: no app, no schema, no table. Where the data lives is the user's decision, and tables created in the wrong place stay there. Look up the workspace's data tables first so every choice you offer exists, then ask, as proposed answers rather than open questions:
|
|
86302
|
+
|
|
86303
|
+
1. **Data table**: which one to use, the default first (\`main\` when it exists, otherwise the first listed). Skip this one when the workspace has a single data table.
|
|
86304
|
+
2. **Schema**: where the app's new tables go.
|
|
86305
|
+
- A **new schema**, the usual choice, offered first. Suggest the first unused name among \`app1\`, \`app2\`, …
|
|
86306
|
+
- An **existing schema** of that data table, by name.
|
|
86307
|
+
- **None**: the tables go in \`public\`.
|
|
86308
|
+
3. **Tables**: only when that data table already holds tables the app could use, whether to **reuse** them (name them) or **create new ones**.
|
|
86309
|
+
|
|
86310
|
+
Do not ask when:
|
|
86311
|
+
|
|
86312
|
+
- the user already said where the data goes. A part they left out takes its default above: the default data table, a new \`appN\` schema, new tables;
|
|
86313
|
+
- the app, or its saved draft, already carries a data config (\`data.datatable\`, \`data.schema\` or \`data.tables\`). That config is the answer;
|
|
86314
|
+
- the app stores nothing.
|
|
86315
|
+
|
|
86316
|
+
With no data table in the workspace there is nothing to choose: say that one has to be configured in the workspace settings before the app can store data.
|
|
86317
|
+
|
|
86318
|
+
A question left unanswered or dismissed is not a go-ahead for the defaults: stop there and say what is still needed.
|
|
86319
|
+
|
|
86320
|
+
Then build what was chosen: the data table and schema become the app's \`data.datatable\` and \`data.schema\`, the tables it uses, reused or new, go in \`data.tables\`, and a new schema is created (\`CREATE SCHEMA IF NOT EXISTS\`) before the tables that go in it.
|
|
86321
|
+
\`wmill app new --datatable <name> --schema <name>\` records both and, for a schema that does not exist yet, writes the migration in \`sql_to_apply/\` that creates it: nothing exists in the database until \`wmill app dev\` applies that migration, so the app's table migrations come after it.
|
|
86322
|
+
|
|
86242
86323
|
## Frontend
|
|
86243
86324
|
|
|
86244
86325
|
### Entrypoint
|
|
@@ -87693,7 +87774,7 @@ app related commands
|
|
|
87693
87774
|
- \`--path <path:string>\` - App path (e.g., f/folder/my_app or u/username/my_app). Skips the prompt when provided. Triggers non-interactive mode.
|
|
87694
87775
|
- \`--framework <framework:string>\` - Framework template: react19 | react18 | svelte5 | vue. Skips the prompt when provided. Triggers non-interactive mode.
|
|
87695
87776
|
- \`--datatable <datatable:string>\` - Datatable to wire up. Without this flag in non-interactive mode, no datatable is configured.
|
|
87696
|
-
- \`--schema <schema:string>\` - Schema to use with --datatable.
|
|
87777
|
+
- \`--schema <schema:string>\` - Schema to use with --datatable. If it doesn't exist yet, a sql_to_apply/ migration (CREATE SCHEMA IF NOT EXISTS) is written for it.
|
|
87697
87778
|
- \`--overwrite\` - Overwrite the target directory if it already exists, without prompting.
|
|
87698
87779
|
- \`--no-open-in-desktop\` - Do not prompt to open the new app in Claude Desktop.
|
|
87699
87780
|
- \`app generate-agents [app_folder:string]\` - regenerate AGENTS.md and DATATABLES.md from remote workspace
|
|
@@ -88377,6 +88458,8 @@ user related commands
|
|
|
88377
88458
|
|
|
88378
88459
|
**Subcommands:**
|
|
88379
88460
|
|
|
88461
|
+
- \`user list\` - List the users of the workspace
|
|
88462
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
88380
88463
|
- \`user add <email:string> [password:string]\` - Create a user
|
|
88381
88464
|
- \`--superadmin\` - Specify to make the new user superadmin.
|
|
88382
88465
|
- \`--company <company:string>\` - Specify to set the company of the new user.
|
|
@@ -88725,7 +88808,8 @@ properties:
|
|
|
88725
88808
|
description: Seconds to wait between retries
|
|
88726
88809
|
exponential:
|
|
88727
88810
|
type: object
|
|
88728
|
-
description: Retry with exponential backoff
|
|
88811
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
88812
|
+
× seconds^n'
|
|
88729
88813
|
properties:
|
|
88730
88814
|
attempts:
|
|
88731
88815
|
type: integer
|
|
@@ -88736,7 +88820,8 @@ properties:
|
|
|
88736
88820
|
seconds:
|
|
88737
88821
|
type: integer
|
|
88738
88822
|
minimum: 1
|
|
88739
|
-
description:
|
|
88823
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
88824
|
+
× seconds^n, where n counts constant retries too
|
|
88740
88825
|
random_factor:
|
|
88741
88826
|
type: integer
|
|
88742
88827
|
minimum: 0
|
|
@@ -88824,7 +88909,8 @@ properties:
|
|
|
88824
88909
|
description: Seconds to wait between retries
|
|
88825
88910
|
exponential:
|
|
88826
88911
|
type: object
|
|
88827
|
-
description: Retry with exponential backoff
|
|
88912
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
88913
|
+
× seconds^n'
|
|
88828
88914
|
properties:
|
|
88829
88915
|
attempts:
|
|
88830
88916
|
type: integer
|
|
@@ -88835,7 +88921,8 @@ properties:
|
|
|
88835
88921
|
seconds:
|
|
88836
88922
|
type: integer
|
|
88837
88923
|
minimum: 1
|
|
88838
|
-
description:
|
|
88924
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
88925
|
+
× seconds^n, where n counts constant retries too
|
|
88839
88926
|
random_factor:
|
|
88840
88927
|
type: integer
|
|
88841
88928
|
minimum: 0
|
|
@@ -88908,7 +88995,8 @@ properties:
|
|
|
88908
88995
|
description: Seconds to wait between retries
|
|
88909
88996
|
exponential:
|
|
88910
88997
|
type: object
|
|
88911
|
-
description: Retry with exponential backoff
|
|
88998
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
88999
|
+
× seconds^n'
|
|
88912
89000
|
properties:
|
|
88913
89001
|
attempts:
|
|
88914
89002
|
type: integer
|
|
@@ -88919,7 +89007,8 @@ properties:
|
|
|
88919
89007
|
seconds:
|
|
88920
89008
|
type: integer
|
|
88921
89009
|
minimum: 1
|
|
88922
|
-
description:
|
|
89010
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89011
|
+
× seconds^n, where n counts constant retries too
|
|
88923
89012
|
random_factor:
|
|
88924
89013
|
type: integer
|
|
88925
89014
|
minimum: 0
|
|
@@ -89029,7 +89118,8 @@ properties:
|
|
|
89029
89118
|
description: Seconds to wait between retries
|
|
89030
89119
|
exponential:
|
|
89031
89120
|
type: object
|
|
89032
|
-
description: Retry with exponential backoff
|
|
89121
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89122
|
+
× seconds^n'
|
|
89033
89123
|
properties:
|
|
89034
89124
|
attempts:
|
|
89035
89125
|
type: integer
|
|
@@ -89040,7 +89130,8 @@ properties:
|
|
|
89040
89130
|
seconds:
|
|
89041
89131
|
type: integer
|
|
89042
89132
|
minimum: 1
|
|
89043
|
-
description:
|
|
89133
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89134
|
+
× seconds^n, where n counts constant retries too
|
|
89044
89135
|
random_factor:
|
|
89045
89136
|
type: integer
|
|
89046
89137
|
minimum: 0
|
|
@@ -89192,7 +89283,8 @@ properties:
|
|
|
89192
89283
|
description: Seconds to wait between retries
|
|
89193
89284
|
exponential:
|
|
89194
89285
|
type: object
|
|
89195
|
-
description: Retry with exponential backoff
|
|
89286
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89287
|
+
× seconds^n'
|
|
89196
89288
|
properties:
|
|
89197
89289
|
attempts:
|
|
89198
89290
|
type: integer
|
|
@@ -89203,7 +89295,8 @@ properties:
|
|
|
89203
89295
|
seconds:
|
|
89204
89296
|
type: integer
|
|
89205
89297
|
minimum: 1
|
|
89206
|
-
description:
|
|
89298
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89299
|
+
× seconds^n, where n counts constant retries too
|
|
89207
89300
|
random_factor:
|
|
89208
89301
|
type: integer
|
|
89209
89302
|
minimum: 0
|
|
@@ -89361,7 +89454,8 @@ properties:
|
|
|
89361
89454
|
description: Seconds to wait between retries
|
|
89362
89455
|
exponential:
|
|
89363
89456
|
type: object
|
|
89364
|
-
description: Retry with exponential backoff
|
|
89457
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89458
|
+
× seconds^n'
|
|
89365
89459
|
properties:
|
|
89366
89460
|
attempts:
|
|
89367
89461
|
type: integer
|
|
@@ -89372,7 +89466,8 @@ properties:
|
|
|
89372
89466
|
seconds:
|
|
89373
89467
|
type: integer
|
|
89374
89468
|
minimum: 1
|
|
89375
|
-
description:
|
|
89469
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89470
|
+
× seconds^n, where n counts constant retries too
|
|
89376
89471
|
random_factor:
|
|
89377
89472
|
type: integer
|
|
89378
89473
|
minimum: 0
|
|
@@ -89487,7 +89582,8 @@ properties:
|
|
|
89487
89582
|
description: Seconds to wait between retries
|
|
89488
89583
|
exponential:
|
|
89489
89584
|
type: object
|
|
89490
|
-
description: Retry with exponential backoff
|
|
89585
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89586
|
+
× seconds^n'
|
|
89491
89587
|
properties:
|
|
89492
89588
|
attempts:
|
|
89493
89589
|
type: integer
|
|
@@ -89498,7 +89594,8 @@ properties:
|
|
|
89498
89594
|
seconds:
|
|
89499
89595
|
type: integer
|
|
89500
89596
|
minimum: 1
|
|
89501
|
-
description:
|
|
89597
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89598
|
+
× seconds^n, where n counts constant retries too
|
|
89502
89599
|
random_factor:
|
|
89503
89600
|
type: integer
|
|
89504
89601
|
minimum: 0
|
|
@@ -89585,7 +89682,8 @@ properties:
|
|
|
89585
89682
|
description: Seconds to wait between retries
|
|
89586
89683
|
exponential:
|
|
89587
89684
|
type: object
|
|
89588
|
-
description: Retry with exponential backoff
|
|
89685
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89686
|
+
× seconds^n'
|
|
89589
89687
|
properties:
|
|
89590
89688
|
attempts:
|
|
89591
89689
|
type: integer
|
|
@@ -89596,7 +89694,8 @@ properties:
|
|
|
89596
89694
|
seconds:
|
|
89597
89695
|
type: integer
|
|
89598
89696
|
minimum: 1
|
|
89599
|
-
description:
|
|
89697
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89698
|
+
× seconds^n, where n counts constant retries too
|
|
89600
89699
|
random_factor:
|
|
89601
89700
|
type: integer
|
|
89602
89701
|
minimum: 0
|
|
@@ -89677,7 +89776,8 @@ properties:
|
|
|
89677
89776
|
description: Seconds to wait between retries
|
|
89678
89777
|
exponential:
|
|
89679
89778
|
type: object
|
|
89680
|
-
description: Retry with exponential backoff
|
|
89779
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89780
|
+
× seconds^n'
|
|
89681
89781
|
properties:
|
|
89682
89782
|
attempts:
|
|
89683
89783
|
type: integer
|
|
@@ -89688,7 +89788,8 @@ properties:
|
|
|
89688
89788
|
seconds:
|
|
89689
89789
|
type: integer
|
|
89690
89790
|
minimum: 1
|
|
89691
|
-
description:
|
|
89791
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89792
|
+
× seconds^n, where n counts constant retries too
|
|
89692
89793
|
random_factor:
|
|
89693
89794
|
type: integer
|
|
89694
89795
|
minimum: 0
|
|
@@ -89775,7 +89876,8 @@ properties:
|
|
|
89775
89876
|
description: Seconds to wait between retries
|
|
89776
89877
|
exponential:
|
|
89777
89878
|
type: object
|
|
89778
|
-
description: Retry with exponential backoff
|
|
89879
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
89880
|
+
× seconds^n'
|
|
89779
89881
|
properties:
|
|
89780
89882
|
attempts:
|
|
89781
89883
|
type: integer
|
|
@@ -89786,7 +89888,8 @@ properties:
|
|
|
89786
89888
|
seconds:
|
|
89787
89889
|
type: integer
|
|
89788
89890
|
minimum: 1
|
|
89789
|
-
description:
|
|
89891
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
89892
|
+
× seconds^n, where n counts constant retries too
|
|
89790
89893
|
random_factor:
|
|
89791
89894
|
type: integer
|
|
89792
89895
|
minimum: 0
|
|
@@ -89926,7 +90029,8 @@ properties:
|
|
|
89926
90029
|
description: Seconds to wait between retries
|
|
89927
90030
|
exponential:
|
|
89928
90031
|
type: object
|
|
89929
|
-
description: Retry with exponential backoff
|
|
90032
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
90033
|
+
× seconds^n'
|
|
89930
90034
|
properties:
|
|
89931
90035
|
attempts:
|
|
89932
90036
|
type: integer
|
|
@@ -89937,7 +90041,8 @@ properties:
|
|
|
89937
90041
|
seconds:
|
|
89938
90042
|
type: integer
|
|
89939
90043
|
minimum: 1
|
|
89940
|
-
description:
|
|
90044
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
90045
|
+
× seconds^n, where n counts constant retries too
|
|
89941
90046
|
random_factor:
|
|
89942
90047
|
type: integer
|
|
89943
90048
|
minimum: 0
|
|
@@ -90127,7 +90232,8 @@ properties:
|
|
|
90127
90232
|
description: Seconds to wait between retries
|
|
90128
90233
|
exponential:
|
|
90129
90234
|
type: object
|
|
90130
|
-
description: Retry with exponential backoff
|
|
90235
|
+
description: 'Retry with exponential backoff: the n-th retry waits multiplier
|
|
90236
|
+
× seconds^n'
|
|
90131
90237
|
properties:
|
|
90132
90238
|
attempts:
|
|
90133
90239
|
type: integer
|
|
@@ -90138,7 +90244,8 @@ properties:
|
|
|
90138
90244
|
seconds:
|
|
90139
90245
|
type: integer
|
|
90140
90246
|
minimum: 1
|
|
90141
|
-
description:
|
|
90247
|
+
description: Base of the exponential (seconds); the n-th retry waits multiplier
|
|
90248
|
+
× seconds^n, where n counts constant retries too
|
|
90142
90249
|
random_factor:
|
|
90143
90250
|
type: integer
|
|
90144
90251
|
minimum: 0
|