windmill-cli 1.807.0 → 1.809.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.
Files changed (2) hide show
  1. package/esm/main.js +241 -66
  2. 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.807.0",
16769
+ VERSION: "1.809.0",
16770
16770
  WITH_CREDENTIALS: true,
16771
16771
  interceptors: {
16772
16772
  request: new Interceptors,
@@ -19971,7 +19971,7 @@ var init_auth = __esm(async () => {
19971
19971
  });
19972
19972
 
19973
19973
  // src/core/constants.ts
19974
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.807.0";
19974
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.809.0";
19975
19975
 
19976
19976
  // src/utils/git.ts
19977
19977
  import { execSync, spawnSync } from "node:child_process";
@@ -56373,7 +56373,7 @@ var init_openflow = __esm(() => {
56373
56373
  openflow_default = {
56374
56374
  openapi: "3.0.3",
56375
56375
  info: {
56376
- version: "1.807.0",
56376
+ version: "1.809.0",
56377
56377
  title: "OpenFlow Spec",
56378
56378
  contact: {
56379
56379
  name: "Ruben Fiszel",
@@ -56849,6 +56849,14 @@ var init_openflow = __esm(() => {
56849
56849
  continue_on_disapprove_timeout: {
56850
56850
  type: "boolean",
56851
56851
  description: "If true, continue flow on timeout instead of canceling"
56852
+ },
56853
+ skin: {
56854
+ type: "string",
56855
+ enum: [
56856
+ "detailed",
56857
+ "minimal"
56858
+ ],
56859
+ 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"
56852
56860
  }
56853
56861
  }
56854
56862
  },
@@ -60120,6 +60128,40 @@ var init_src = __esm(() => {
60120
60128
  init_validation();
60121
60129
  });
60122
60130
 
60131
+ // src/utils/app_files.ts
60132
+ function deploysWithRawApp(relativePath) {
60133
+ const segments = relativePath.split("/").filter(Boolean);
60134
+ if (segments.length === 0)
60135
+ return false;
60136
+ const name = segments[segments.length - 1];
60137
+ const dirs = segments.slice(0, -1);
60138
+ if (dirs[0] === APP_BACKEND_FOLDER)
60139
+ return dirs.length === 1;
60140
+ if (NEVER_DEPLOYED_FILES.has(name))
60141
+ return false;
60142
+ if (dirs.some((d) => NEVER_DEPLOYED_DIRS.has(d)))
60143
+ return false;
60144
+ if (dirs[0] === RECORDINGS_FOLDER)
60145
+ return false;
60146
+ return true;
60147
+ }
60148
+ var NEVER_DEPLOYED_DIRS, NEVER_DEPLOYED_FILES;
60149
+ var init_app_files = __esm(async () => {
60150
+ await init_app_metadata();
60151
+ NEVER_DEPLOYED_DIRS = new Set([
60152
+ "node_modules",
60153
+ "dist",
60154
+ ".claude",
60155
+ "sql_to_apply"
60156
+ ]);
60157
+ NEVER_DEPLOYED_FILES = new Set([
60158
+ "package-lock.json",
60159
+ "DATATABLES.md",
60160
+ "AGENTS.md",
60161
+ "wmill.d.ts"
60162
+ ]);
60163
+ });
60164
+
60123
60165
  // src/core/permissioned_as.ts
60124
60166
  async function buildPermissionedAsContext(workspace, syncBehavior) {
60125
60167
  if (parseSyncBehavior(syncBehavior) < 1) {
@@ -60160,10 +60202,45 @@ function contentHasOnBehalfOf(content, typeStr) {
60160
60202
  }
60161
60203
  return false;
60162
60204
  }
60205
+ function isAppTypeStr(typeStr) {
60206
+ return typeStr === "app" || typeStr === "raw_app";
60207
+ }
60208
+ function appFolderOf(path, typeStr) {
60209
+ return extractFolderPath(path, typeStr) ?? path;
60210
+ }
60211
+ function toPosix(path) {
60212
+ return path.replaceAll("\\", "/");
60213
+ }
60214
+ function appsArrivingOrLeaving(changes) {
60215
+ const folders = new Set;
60216
+ for (const change of changes) {
60217
+ if (change.name === "edited")
60218
+ continue;
60219
+ const path = toPosix(change.path);
60220
+ if (!isAppFolderMetadataFile(path) && !isRawAppFolderMetadataFile(path)) {
60221
+ continue;
60222
+ }
60223
+ let typeStr;
60224
+ try {
60225
+ typeStr = getTypeStrFromPath(path);
60226
+ } catch {
60227
+ continue;
60228
+ }
60229
+ if (isAppTypeStr(typeStr))
60230
+ folders.add(appFolderOf(path, typeStr));
60231
+ }
60232
+ return folders;
60233
+ }
60163
60234
  async function preCheckPermissionedAs(changes, userEmail, userIsAdminOrDeployer, acceptOverride, isInteractive) {
60164
60235
  if (userIsAdminOrDeployer)
60165
60236
  return;
60166
60237
  const wouldChangeItems = [];
60238
+ const addItem = (item) => {
60239
+ if (!wouldChangeItems.some((i) => i.path === item.path)) {
60240
+ wouldChangeItems.push(item);
60241
+ }
60242
+ };
60243
+ const arrivingOrLeaving = appsArrivingOrLeaving(changes);
60167
60244
  for (const change of changes) {
60168
60245
  let typeStr;
60169
60246
  try {
@@ -60171,6 +60248,14 @@ async function preCheckPermissionedAs(changes, userEmail, userIsAdminOrDeployer,
60171
60248
  } catch {
60172
60249
  continue;
60173
60250
  }
60251
+ if (isAppTypeStr(typeStr)) {
60252
+ const path = toPosix(change.path);
60253
+ const folder = appFolderOf(path, typeStr);
60254
+ if (!arrivingOrLeaving.has(folder) && (typeStr === "app" || deploysWithRawApp(path.slice(folder.length)))) {
60255
+ addItem({ path: folder, currentOwner: "(app policy owner)" });
60256
+ }
60257
+ continue;
60258
+ }
60174
60259
  if (change.name === "added") {
60175
60260
  const content = change.content;
60176
60261
  if (!content)
@@ -60180,11 +60265,6 @@ async function preCheckPermissionedAs(changes, userEmail, userIsAdminOrDeployer,
60180
60265
  if ((isScriptMeta || isFlowMeta) && contentHasOnBehalfOf(content, typeStr)) {
60181
60266
  const label = typeStr === "script" ? "(script owner)" : "(flow owner)";
60182
60267
  wouldChangeItems.push({ path: change.path, currentOwner: label });
60183
- } else if (typeStr === "app") {
60184
- wouldChangeItems.push({
60185
- path: change.path,
60186
- currentOwner: "(app policy owner)"
60187
- });
60188
60268
  }
60189
60269
  continue;
60190
60270
  }
@@ -60217,12 +60297,6 @@ async function preCheckPermissionedAs(changes, userEmail, userIsAdminOrDeployer,
60217
60297
  }
60218
60298
  }
60219
60299
  continue;
60220
- } else if (typeStr === "app") {
60221
- wouldChangeItems.push({
60222
- path: change.path,
60223
- currentOwner: "(app policy owner)"
60224
- });
60225
- continue;
60226
60300
  } else if (typeStr === "schedule") {
60227
60301
  const match = beforeContent.match(/email:\s*["']?([^\s"']+)["']?/);
60228
60302
  if (match) {
@@ -60273,6 +60347,8 @@ var init_permissioned_as = __esm(async () => {
60273
60347
  await __promiseAll([
60274
60348
  init_confirm(),
60275
60349
  init_types(),
60350
+ init_resource_folders(),
60351
+ init_app_files(),
60276
60352
  init_conf()
60277
60353
  ]);
60278
60354
  });
@@ -62611,9 +62687,10 @@ async function createScript2(bundleContent, workspaceId, body, workspace) {
62611
62687
  }
62612
62688
  return performance.now() - start;
62613
62689
  }
62614
- async function collidingDbtProject(basePath) {
62690
+ async function collidingDbtProject(basePath, baseDir) {
62615
62691
  const project = basePath + "__dbt/dbt_project.yml";
62616
- return await stat4(project).then(() => true).catch(() => false) ? project : undefined;
62692
+ const onDisk = baseDir ? path9.join(baseDir, project) : project;
62693
+ return await stat4(onDisk).then(() => true).catch(() => false) ? project : undefined;
62617
62694
  }
62618
62695
  async function collidingOrdinaryScript(basePath) {
62619
62696
  for (const ext of exts) {
@@ -62642,7 +62719,8 @@ async function readScriptContent(filePath) {
62642
62719
  throw e;
62643
62720
  }
62644
62721
  }
62645
- async function findContentFile(filePath) {
62722
+ async function findContentFile(filePath, baseDir) {
62723
+ const onDisk = (p) => baseDir ? path9.join(baseDir, p) : p;
62646
62724
  const isModuleFolderMeta = isModuleEntryMetadata(filePath);
62647
62725
  const toCandidate = (ext) => isModuleFolderMeta ? filePath.replace(MODULE_ENTRY_META_RE, "$1script" + ext) : filePath.endsWith("script.json") ? filePath.replace(".script.json", ext) : filePath.endsWith("script.lock") ? filePath.replace(".script.lock", ext) : filePath.replace(".script.yaml", ext);
62648
62726
  if (!isModuleFolderMeta && !/\.script\.(yaml|json|lock)$/.test(filePath)) {
@@ -62650,14 +62728,14 @@ async function findContentFile(filePath) {
62650
62728
  }
62651
62729
  const candidates = exts.map(toCandidate);
62652
62730
  const validCandidates = (await Promise.all(candidates.map((x) => {
62653
- return stat4(x).catch(() => {
62731
+ return stat4(onDisk(x)).catch(() => {
62654
62732
  return;
62655
62733
  }).then((x) => x?.isFile()).then((e) => {
62656
62734
  return { path: x, file: e };
62657
62735
  });
62658
62736
  }))).filter((x) => x.file).map((x) => x.path);
62659
62737
  const dbtCandidate = toCandidate("__dbt/" + DBT_DESCRIPTOR_NAME);
62660
- const dbtProject = await collidingDbtProject(dbtCandidate.slice(0, -("__dbt/" + DBT_DESCRIPTOR_NAME).length));
62738
+ const dbtProject = await collidingDbtProject(dbtCandidate.slice(0, -("__dbt/" + DBT_DESCRIPTOR_NAME).length), baseDir);
62661
62739
  const nonDbtCandidates = validCandidates.filter((c) => c !== dbtCandidate);
62662
62740
  if (dbtProject && nonDbtCandidates.length > 0) {
62663
62741
  throw dbtPathCollisionError(dbtProject, nonDbtCandidates.join(", "));
@@ -63789,6 +63867,42 @@ async function checkMissingLocks(opts, directory) {
63789
63867
  }
63790
63868
  return issues;
63791
63869
  }
63870
+ function isStandaloneScriptMetadata(rootedPath) {
63871
+ if (isFolderResourcePathAnyFormat(rootedPath) || isFilesetResource(rootedPath)) {
63872
+ return false;
63873
+ }
63874
+ if (isModuleEntryMetadata(rootedPath))
63875
+ return true;
63876
+ if (getScriptBasePathFromModulePath(rootedPath) !== undefined)
63877
+ return false;
63878
+ return FLAT_SCRIPT_METADATA_REGEX.test(rootedPath);
63879
+ }
63880
+ function relativizeMessage(message, prefix) {
63881
+ if (!prefix)
63882
+ return message;
63883
+ const escaped = prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
63884
+ return message.replaceAll(new RegExp(`(^|[\\s(])${escaped}/`, "g"), "$1");
63885
+ }
63886
+ async function checkOrphanScriptMetadata(syncRoot, prefix, metadataPaths) {
63887
+ const issues = [];
63888
+ for (const metadataPath of metadataPaths) {
63889
+ const rootedPath = prefix ? `${prefix}/${metadataPath}` : metadataPath;
63890
+ try {
63891
+ await findContentFile(rootedPath, syncRoot);
63892
+ } catch (e) {
63893
+ if (!(e instanceof UnresolvableScriptContentFileError)) {
63894
+ debug(`Failed to resolve content file for ${rootedPath}: ${e}`);
63895
+ continue;
63896
+ }
63897
+ issues.push({
63898
+ path: metadataPath,
63899
+ target: "script",
63900
+ errors: [relativizeMessage(e.message, prefix)]
63901
+ });
63902
+ }
63903
+ }
63904
+ return issues;
63905
+ }
63792
63906
  async function runLint(opts, directory) {
63793
63907
  const initialCwd = process15.cwd();
63794
63908
  const explicitTargetDirectory = directory ? path10.resolve(initialCwd, directory) : undefined;
@@ -63806,8 +63920,11 @@ async function runLint(opts, directory) {
63806
63920
  const ignore = isSubdirectory ? (_p, _isDir) => false : await ignoreF(mergedOpts);
63807
63921
  const root = await FSFSElement(targetDirectory, [], false);
63808
63922
  const validator = new WindmillYamlValidator;
63923
+ const syncRoot = await findSyncRoot(targetDirectory);
63924
+ const metadataPrefix = normalizePath(path10.relative(syncRoot, targetDirectory));
63809
63925
  const warnings = [];
63810
63926
  const issues = [];
63927
+ const scriptMetadataPaths = [];
63811
63928
  let scannedFiles = 0;
63812
63929
  let validatedFiles = 0;
63813
63930
  let validFiles = 0;
@@ -63818,6 +63935,9 @@ async function runLint(opts, directory) {
63818
63935
  }
63819
63936
  const normalizedPath = normalizePath(entry.path);
63820
63937
  scannedFiles += 1;
63938
+ if (isStandaloneScriptMetadata(metadataPrefix ? `${metadataPrefix}/${normalizedPath}` : normalizedPath)) {
63939
+ scriptMetadataPaths.push(normalizedPath);
63940
+ }
63821
63941
  if (!YAML_FILE_REGEX.test(normalizedPath)) {
63822
63942
  continue;
63823
63943
  }
@@ -63850,6 +63970,7 @@ async function runLint(opts, directory) {
63850
63970
  validFiles += 1;
63851
63971
  }
63852
63972
  }
63973
+ issues.push(...await checkOrphanScriptMetadata(syncRoot, metadataPrefix, scriptMetadataPaths));
63853
63974
  if (opts.locksRequired) {
63854
63975
  const lockIssues = await checkMissingLocks(opts, explicitTargetDirectory);
63855
63976
  issues.push(...lockIssues);
@@ -63925,6 +64046,9 @@ async function lint(opts, directory) {
63925
64046
  process15.exit(1);
63926
64047
  }
63927
64048
  }
64049
+ function affectsLint(filename) {
64050
+ return /\.(ya?ml|json|lock)$/i.test(filename) || hasScriptExt(filename);
64051
+ }
63928
64052
  async function lintWatch(opts, directory) {
63929
64053
  const { watch } = await import("node:fs");
63930
64054
  const targetDir = directory ? path10.resolve(process15.cwd(), directory) : process15.cwd();
@@ -63943,7 +64067,7 @@ async function lintWatch(opts, directory) {
63943
64067
  await runAndReport();
63944
64068
  let debounce = null;
63945
64069
  watch(targetDir, { recursive: true }, (_event, filename) => {
63946
- if (!filename || !filename.toString().endsWith(".yaml") && !filename.toString().endsWith(".yml"))
64070
+ if (!filename || !affectsLint(filename.toString()))
63947
64071
  return;
63948
64072
  if (debounce)
63949
64073
  clearTimeout(debounce);
@@ -63951,7 +64075,7 @@ async function lintWatch(opts, directory) {
63951
64075
  });
63952
64076
  await new Promise(() => {});
63953
64077
  }
63954
- var YAML_FILE_REGEX, NATIVE_TRIGGER_REGEX, command6, lint_default;
64078
+ var YAML_FILE_REGEX, NATIVE_TRIGGER_REGEX, FLAT_SCRIPT_METADATA_REGEX, command6, lint_default;
63955
64079
  var init_lint = __esm(async () => {
63956
64080
  init_colors2();
63957
64081
  init_mod3();
@@ -63963,11 +64087,13 @@ var init_lint = __esm(async () => {
63963
64087
  init_sync(),
63964
64088
  init_script_common(),
63965
64089
  init_resource_folders(),
64090
+ init_utils(),
63966
64091
  init_script()
63967
64092
  ]);
63968
64093
  YAML_FILE_REGEX = /\.ya?ml$/i;
63969
64094
  NATIVE_TRIGGER_REGEX = /\.[^.]+_native_trigger\.ya?ml$/i;
63970
- command6 = new Command().description("Validate Windmill flow, schedule, and trigger YAML files in a directory").arguments("[directory:string]").option("--json", "Output results in JSON format").option("--fail-on-warn", "Exit with code 1 when warnings are emitted").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("-w, --watch", "Watch for file changes and re-lint automatically").action(lint);
64095
+ FLAT_SCRIPT_METADATA_REGEX = /\.script\.(yaml|json|lock)$/;
64096
+ command6 = new Command().description("Validate Windmill flow, schedule, and trigger YAML files in a directory, and report script metadata that has no deployable content file").arguments("[directory:string]").option("--json", "Output results in JSON format").option("--fail-on-warn", "Exit with code 1 when warnings are emitted").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("-w, --watch", "Watch for file changes and re-lint automatically").action(lint);
63971
64097
  lint_default = command6;
63972
64098
  });
63973
64099
 
@@ -65760,7 +65886,7 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
65760
65886
  }
65761
65887
  if (isRawAppFile(path)) {
65762
65888
  const suffix = path.split(getFolderSuffix("raw_app") + SEP9).pop()?.replaceAll(SEP9, "/");
65763
- if (suffix?.startsWith("dist/") || suffix?.startsWith(RECORDINGS_FOLDER + "/") || suffix == "wmill.d.ts" || suffix == "package-lock.json" || suffix == "DATATABLES.md") {
65889
+ if (suffix && !deploysWithRawApp(suffix)) {
65764
65890
  continue;
65765
65891
  }
65766
65892
  }
@@ -67885,7 +68011,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
67885
68011
  } catch {}
67886
68012
  }
67887
68013
  if (flowFolderExists) {
67888
- await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, { message: opts.message });
68014
+ await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, { message: opts.message, permissionedAsContext });
67889
68015
  } else {
67890
68016
  const remotePath = extractResourceName(target, "flow");
67891
68017
  if (remotePath) {
@@ -67913,7 +68039,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
67913
68039
  } catch {}
67914
68040
  }
67915
68041
  if (appFolderExists) {
67916
- await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, { message: opts.message });
68042
+ await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, { message: opts.message, permissionedAsContext });
67917
68043
  } else {
67918
68044
  const remotePath = extractResourceName(target, "app");
67919
68045
  if (remotePath) {
@@ -67941,7 +68067,11 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
67941
68067
  } catch {}
67942
68068
  }
67943
68069
  if (folderExists) {
67944
- await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, { message: opts.message, defaultTs: opts.defaultTs });
68070
+ await pushObj(workspaceId, target, undefined, undefined, opts.plainSecrets ?? false, alreadySynced, {
68071
+ message: opts.message,
68072
+ defaultTs: opts.defaultTs,
68073
+ permissionedAsContext
68074
+ });
67945
68075
  } else {
67946
68076
  const remotePath = extractResourceName(target, "raw_app");
67947
68077
  if (remotePath) {
@@ -68266,6 +68396,7 @@ var init_sync = __esm(async () => {
68266
68396
  init_flow_metadata(),
68267
68397
  init_app(),
68268
68398
  init_app_metadata(),
68399
+ init_app_files(),
68269
68400
  init_resource_folders(),
68270
68401
  init_script_common(),
68271
68402
  init_lock_dedup()
@@ -69484,7 +69615,7 @@ async function collectAppFiles(localPath) {
69484
69615
  const fullPath = dir + entry.name;
69485
69616
  const relativePath = basePath + entry.name;
69486
69617
  if (entry.isDirectory()) {
69487
- if (entry.name === APP_BACKEND_FOLDER || entry.name === "node_modules" || entry.name === "dist" || entry.name === ".claude" || entry.name === "sql_to_apply") {
69618
+ if (entry.name === APP_BACKEND_FOLDER || NEVER_DEPLOYED_DIRS.has(entry.name)) {
69488
69619
  continue;
69489
69620
  }
69490
69621
  if (basePath === "/" && entry.name === RECORDINGS_FOLDER) {
@@ -69492,7 +69623,7 @@ async function collectAppFiles(localPath) {
69492
69623
  }
69493
69624
  await readDirRecursive(fullPath + SEP11, relativePath + "/");
69494
69625
  } else if (entry.isFile()) {
69495
- if (entry.name === "raw_app.yaml" || entry.name === "package-lock.json" || entry.name === "DATATABLES.md" || entry.name === "AGENTS.md" || entry.name === "wmill.d.ts") {
69626
+ if (entry.name === "raw_app.yaml" || NEVER_DEPLOYED_FILES.has(entry.name)) {
69496
69627
  continue;
69497
69628
  }
69498
69629
  const content = await readTextFile(fullPath);
@@ -69503,7 +69634,7 @@ async function collectAppFiles(localPath) {
69503
69634
  await readDirRecursive(localPath);
69504
69635
  return files;
69505
69636
  }
69506
- async function pushRawApp(workspace, remotePath, localPath, message, defaultTs = "bun") {
69637
+ async function pushRawApp(workspace, remotePath, localPath, message, defaultTs = "bun", permissionedAsContext) {
69507
69638
  if (alreadySynced.includes(localPath)) {
69508
69639
  return;
69509
69640
  }
@@ -69516,6 +69647,7 @@ async function pushRawApp(workspace, remotePath, localPath, message, defaultTs =
69516
69647
  path: remotePath
69517
69648
  });
69518
69649
  } catch {}
69650
+ const deployedPolicy = app?.policy;
69519
69651
  markAccessFromPolicy(app);
69520
69652
  if (app) {
69521
69653
  app.policy = undefined;
@@ -69540,7 +69672,8 @@ async function pushRawApp(workspace, remotePath, localPath, message, defaultTs =
69540
69672
  replaceInlineScripts2(runnables, backendPath + SEP11, true);
69541
69673
  repopulateFields(runnables);
69542
69674
  const appForPolicy = { ...localApp, runnables };
69543
- await generatingPolicy(appForPolicy, remotePath, executionModeFromAppFile(localApp));
69675
+ const preserveFields = preserveOnBehalfOfFields(remotePath, deployedPolicy, permissionedAsContext);
69676
+ await generatingPolicy(appForPolicy, remotePath, executionModeForPush(localApp, deployedPolicy), basePolicy(localApp, deployedPolicy, !!preserveFields.preserve_on_behalf_of));
69544
69677
  const files = await collectAppFiles(localPath);
69545
69678
  async function createBundleRaw() {
69546
69679
  info(colors.yellow.bold(`Creating raw app ${remotePath} bundle...`));
@@ -69577,6 +69710,7 @@ async function pushRawApp(workspace, remotePath, localPath, message, defaultTs =
69577
69710
  path: remotePath,
69578
69711
  summary: localApp.summary,
69579
69712
  policy: appForPolicy.policy,
69713
+ ...preserveFields,
69580
69714
  deployment_message: message,
69581
69715
  skip_draft_deletion: true,
69582
69716
  ...localApp.custom_path ? { custom_path: localApp.custom_path } : {}
@@ -69607,11 +69741,11 @@ async function pushRawApp(workspace, remotePath, localPath, message, defaultTs =
69607
69741
  }
69608
69742
  await applyExtraPermsDiff(workspace, "raw_app", remotePath, localPerms, app?.extra_perms);
69609
69743
  }
69610
- async function generatingPolicy(app, path, executionMode) {
69744
+ async function generatingPolicy(app, path, executionMode, base) {
69611
69745
  info(colors.gray(`Generating fresh policy for app ${path}...`));
69612
69746
  try {
69613
- app.policy = await Q(app.runnables, app.policy);
69614
- app.policy.execution_mode = executionMode;
69747
+ app.policy = await Q(app.runnables, base);
69748
+ finalizeDerivedPolicy(app.policy, executionMode);
69615
69749
  } catch (e) {
69616
69750
  error(colors.red(`Error generating policy for app ${path}: ${e}`));
69617
69751
  throw e;
@@ -69633,8 +69767,10 @@ var init_raw_apps = __esm(async () => {
69633
69767
  init_types(),
69634
69768
  init_utils(),
69635
69769
  init_app(),
69770
+ init_permissioned_as(),
69636
69771
  init_bundle(),
69637
69772
  init_app_metadata(),
69773
+ init_app_files(),
69638
69774
  init_utils(),
69639
69775
  init_sync()
69640
69776
  ]);
@@ -72840,14 +72976,22 @@ function markAccessFromPolicy(app) {
72840
72976
  app.guests = true;
72841
72977
  }
72842
72978
  }
72843
- function executionModeFromAppFile(app) {
72979
+ function statedExecutionMode(app) {
72844
72980
  if (app?.["public"] ?? isExecutionModeAnonymous(app)) {
72845
72981
  return "anonymous";
72846
72982
  }
72847
72983
  if (app?.["guests"] ?? isExecutionModeGuest(app)) {
72848
72984
  return "guest";
72849
72985
  }
72850
- return "publisher";
72986
+ const mode = app?.["policy"]?.["execution_mode"];
72987
+ return mode === "viewer" || mode === "publisher" ? mode : undefined;
72988
+ }
72989
+ function executionModeForPush(localApp, deployedPolicy) {
72990
+ const stated = statedExecutionMode(localApp);
72991
+ if (stated) {
72992
+ return stated;
72993
+ }
72994
+ return deployedPolicy?.execution_mode === "viewer" ? "viewer" : "publisher";
72851
72995
  }
72852
72996
  async function pushApp(workspace, remotePath, localPath, message, permissionedAsContext) {
72853
72997
  if (alreadySynced2.includes(localPath)) {
@@ -72862,12 +73006,7 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
72862
73006
  path: remotePath
72863
73007
  });
72864
73008
  } catch {}
72865
- let remoteOnBehalfOf;
72866
- let remoteOnBehalfOfEmail;
72867
- if (app?.policy) {
72868
- remoteOnBehalfOf = app.policy.on_behalf_of;
72869
- remoteOnBehalfOfEmail = app.policy.on_behalf_of_email;
72870
- }
73009
+ const deployedPolicy = app?.policy;
72871
73010
  markAccessFromPolicy(app);
72872
73011
  if (app) {
72873
73012
  app.policy = undefined;
@@ -72878,18 +73017,8 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
72878
73017
  const path = localPath + "app.yaml";
72879
73018
  const localApp = await yamlParseFile(path);
72880
73019
  replaceInlineScripts2(localApp.value, localPath, true);
72881
- await generatingPolicy2(localApp, remotePath, executionModeFromAppFile(localApp));
72882
- const preserveFields = {};
72883
- if (permissionedAsContext?.userIsAdminOrDeployer) {
72884
- if (app) {
72885
- if (localApp.policy && remoteOnBehalfOf) {
72886
- localApp.policy.on_behalf_of = remoteOnBehalfOf;
72887
- localApp.policy.on_behalf_of_email = remoteOnBehalfOfEmail;
72888
- preserveFields.preserve_on_behalf_of = true;
72889
- info(`Preserving ${remoteOnBehalfOfEmail ?? remoteOnBehalfOf} as permissioned_as for app ${remotePath}`);
72890
- }
72891
- }
72892
- }
73020
+ const preserveFields = preserveOnBehalfOfFields(remotePath, deployedPolicy, permissionedAsContext);
73021
+ await generatingPolicy2(localApp, remotePath, executionModeForPush(localApp, deployedPolicy), basePolicy(localApp, deployedPolicy, !!preserveFields.preserve_on_behalf_of));
72893
73022
  const { extra_perms: localPerms, ...localAppBody } = localApp;
72894
73023
  if (app) {
72895
73024
  if (isSuperset(localAppBody, app)) {
@@ -72922,16 +73051,38 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
72922
73051
  }
72923
73052
  await applyExtraPermsDiff(workspace, "app", remotePath, localPerms, app?.extra_perms);
72924
73053
  }
72925
- async function generatingPolicy2(app, path, executionMode) {
73054
+ async function generatingPolicy2(app, path, executionMode, base) {
72926
73055
  info(colors.gray(`Generating fresh policy for app ${path}...`));
72927
73056
  try {
72928
- app.policy = await G3(app.value, undefined);
72929
- app.policy.execution_mode = executionMode;
73057
+ app.policy = await G3(app.value, base);
73058
+ finalizeDerivedPolicy(app.policy, executionMode);
72930
73059
  } catch (e) {
72931
73060
  error(colors.red(`Error generating policy for app ${path}: ${e}`));
72932
73061
  throw e;
72933
73062
  }
72934
73063
  }
73064
+ function basePolicy(localApp, deployedPolicy, claimsOnBehalfOf) {
73065
+ const stated = deployedPolicy ?? localApp?.policy;
73066
+ if (!stated || claimsOnBehalfOf) {
73067
+ return stated;
73068
+ }
73069
+ const base = { ...stated };
73070
+ delete base.on_behalf_of;
73071
+ delete base.on_behalf_of_email;
73072
+ return base;
73073
+ }
73074
+ function preserveOnBehalfOfFields(remotePath, deployedPolicy, permissionedAsContext) {
73075
+ const onBehalfOf = deployedPolicy?.on_behalf_of;
73076
+ if (!permissionedAsContext?.userIsAdminOrDeployer || !onBehalfOf) {
73077
+ return {};
73078
+ }
73079
+ info(`Preserving ${deployedPolicy?.on_behalf_of_email ?? onBehalfOf} as permissioned_as for app ${remotePath}`);
73080
+ return { preserve_on_behalf_of: true };
73081
+ }
73082
+ function finalizeDerivedPolicy(policy, executionMode) {
73083
+ policy.triggerables = undefined;
73084
+ policy.execution_mode = executionMode;
73085
+ }
72935
73086
  async function list6(opts) {
72936
73087
  const workspace = await resolveWorkspace(opts);
72937
73088
  await requireLogin(opts);
@@ -73035,7 +73186,7 @@ async function push5(opts, filePath, remotePath) {
73035
73186
  if (isRawAppByName || hasRawAppYaml) {
73036
73187
  await init_raw_apps();
73037
73188
  const merged = await mergeConfigWithConfigFile(opts);
73038
- await pushRawApp(workspace.workspaceId, remotePath, absoluteFilePath, undefined, merged.defaultTs);
73189
+ await pushRawApp(workspace.workspaceId, remotePath, absoluteFilePath, undefined, merged.defaultTs, await buildPermissionedAsContext(workspace.workspaceId, await readEffectiveSyncBehavior(opts, workspace)));
73039
73190
  info(colors.bold.underline.green("Raw app pushed"));
73040
73191
  } else {
73041
73192
  await pushApp(workspace.workspaceId, remotePath, absoluteFilePath, undefined, await buildPermissionedAsContext(workspace.workspaceId, await readEffectiveSyncBehavior(opts, workspace)));
@@ -75985,7 +76136,7 @@ async function pushObj(workspace, p, befObj, newObj, plainSecrets, alreadySynced
75985
76136
  if (!rawAppName) {
75986
76137
  throw new Error(`Could not extract raw app name from path: ${p}`);
75987
76138
  }
75988
- await pushRawApp(workspace, rawAppName, buildFolderPath(rawAppName, "raw_app"), message, defaultTs);
76139
+ await pushRawApp(workspace, rawAppName, buildFolderPath(rawAppName, "raw_app"), message, defaultTs, permissionedAsContext);
75989
76140
  } else if (typeEnding === "folder") {
75990
76141
  await pushFolder(workspace, p, befObj, newObj);
75991
76142
  } else if (typeEnding === "variable") {
@@ -79317,12 +79468,16 @@ workflow<T>(fn: (...args: any[]) => Promise<T>): void
79317
79468
  * resume exactly this approval — route them through your own channel. Without a
79318
79469
  * key the steps are named \`approval\`, \`approval_2\`, ...
79319
79470
  *
79471
+ * \`skin: "minimal"\` shows approvers only the request (form and approve/reject)
79472
+ * instead of the detailed page with the workflow's details. \`description\` is
79473
+ * shown above the form: a string, or a rich value such as \`{ markdown: "..." }\`.
79474
+ *
79320
79475
  * @example
79321
79476
  * const urls = await step("urls", () => getApprovalUrls("manager"));
79322
79477
  * await step("notify", () => sendEmail(urls.resume, urls.cancel));
79323
79478
  * const { value, approver } = await waitForApproval({ key: "manager", timeout: 3600 });
79324
79479
  */
79325
- waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
79480
+ waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; skin?: "detailed" | "minimal"; description?: string | object; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
79326
79481
 
79327
79482
  /**
79328
79483
  * Resume/cancel/approval-page URLs bound to one \`waitForApproval\` step.
@@ -80104,12 +80259,16 @@ workflow<T>(fn: (...args: any[]) => Promise<T>): void
80104
80259
  * resume exactly this approval — route them through your own channel. Without a
80105
80260
  * key the steps are named \`approval\`, \`approval_2\`, ...
80106
80261
  *
80262
+ * \`skin: "minimal"\` shows approvers only the request (form and approve/reject)
80263
+ * instead of the detailed page with the workflow's details. \`description\` is
80264
+ * shown above the form: a string, or a rich value such as \`{ markdown: "..." }\`.
80265
+ *
80107
80266
  * @example
80108
80267
  * const urls = await step("urls", () => getApprovalUrls("manager"));
80109
80268
  * await step("notify", () => sendEmail(urls.resume, urls.cancel));
80110
80269
  * const { value, approver } = await waitForApproval({ key: "manager", timeout: 3600 });
80111
80270
  */
80112
- waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
80271
+ waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; skin?: "detailed" | "minimal"; description?: string | object; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
80113
80272
 
80114
80273
  /**
80115
80274
  * Resume/cancel/approval-page URLs bound to one \`waitForApproval\` step.
@@ -80985,12 +81144,16 @@ workflow<T>(fn: (...args: any[]) => Promise<T>): void
80985
81144
  * resume exactly this approval — route them through your own channel. Without a
80986
81145
  * key the steps are named \`approval\`, \`approval_2\`, ...
80987
81146
  *
81147
+ * \`skin: "minimal"\` shows approvers only the request (form and approve/reject)
81148
+ * instead of the detailed page with the workflow's details. \`description\` is
81149
+ * shown above the form: a string, or a rich value such as \`{ markdown: "..." }\`.
81150
+ *
80988
81151
  * @example
80989
81152
  * const urls = await step("urls", () => getApprovalUrls("manager"));
80990
81153
  * await step("notify", () => sendEmail(urls.resume, urls.cancel));
80991
81154
  * const { value, approver } = await waitForApproval({ key: "manager", timeout: 3600 });
80992
81155
  */
80993
- waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
81156
+ waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; skin?: "detailed" | "minimal"; description?: string | object; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
80994
81157
 
80995
81158
  /**
80996
81159
  * Resume/cancel/approval-page URLs bound to one \`waitForApproval\` step.
@@ -82953,13 +83116,17 @@ async def sleep(seconds: int)
82953
83116
  # form: Optional form schema for the approval page.
82954
83117
  # self_approval: Whether the user who triggered the flow can approve it (default True).
82955
83118
  # key: Optional checkpoint key naming this approval step.
83119
+ # skin: \`\`"minimal"\`\` shows approvers only the request (form and approve/reject)
83120
+ # instead of the detailed page with the workflow's details.
83121
+ # description: Shown to approvers above the form: a string, or a rich value such as
83122
+ # \`\`{"markdown": "..."}\`\`.
82956
83123
  #
82957
83124
  # Example::
82958
83125
  #
82959
83126
  # urls = await step("urls", lambda: get_approval_urls("manager"))
82960
83127
  # await step("notify", lambda: send_email(urls["resume"], urls["cancel"]))
82961
83128
  # result = await wait_for_approval(key="manager", timeout=3600)
82962
- async def wait_for_approval(timeout: int = 1800, form: dict | None = None, self_approval: bool = True, key: str | None = None) -> dict
83129
+ async def wait_for_approval(timeout: int = 1800, form: dict | None = None, self_approval: bool = True, key: str | None = None, skin: Literal['detailed', 'minimal'] | None = None, description: str | dict | None = None) -> dict
82963
83130
 
82964
83131
  # Process items in parallel with optional concurrency control.
82965
83132
  #
@@ -83838,7 +84005,7 @@ Reference a specific resource using \`$res:\` prefix:
83838
84005
 
83839
84006
  ## OpenFlow Schema
83840
84007
 
83841
- {"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 (e.g., \\"yellow\\", \\"#ffff00\\")"},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes, 'group' for notes that group other nodes"},"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"}},"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"}}},"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"},"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"]},"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"]},"MemoryAuto":{"type":"object","description":"Automatic context management","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"]},"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","description":"Explicit message history","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Conversation memory configuration","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","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"}],"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"}}},"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."},"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 flow.input syntax."},"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"},"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"},"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"}},"required":["user_message"]},"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).\\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"]},"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"]}}`,
84008
+ {"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 (e.g., \\"yellow\\", \\"#ffff00\\")"},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes, 'group' for notes that group other nodes"},"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"}},"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"},"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"]},"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"]},"MemoryAuto":{"type":"object","description":"Automatic context management","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"]},"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","description":"Explicit message history","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Conversation memory configuration","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","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"}],"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"}}},"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."},"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 flow.input syntax."},"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"},"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"},"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"}},"required":["user_message"]},"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).\\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"]},"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"]}}`,
83842
84009
  "raw-app": `---
83843
84010
  name: raw-app
83844
84011
  description: MUST use when creating raw apps.
@@ -85074,12 +85241,16 @@ export async function sleep(seconds: number): Promise<void>
85074
85241
  * resume exactly this approval — route them through your own channel. Without a
85075
85242
  * key the steps are named \`approval\`, \`approval_2\`, ...
85076
85243
  *
85244
+ * \`skin: "minimal"\` shows approvers only the request (form and approve/reject)
85245
+ * instead of the detailed page with the workflow's details. \`description\` is
85246
+ * shown above the form: a string, or a rich value such as \`{ markdown: "..." }\`.
85247
+ *
85077
85248
  * @example
85078
85249
  * const urls = await step("urls", () => getApprovalUrls("manager"));
85079
85250
  * await step("notify", () => sendEmail(urls.resume, urls.cancel));
85080
85251
  * const { value, approver } = await waitForApproval({ key: "manager", timeout: 3600 });
85081
85252
  */
85082
- export function waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
85253
+ export function waitForApproval(options?: { timeout?: number; form?: object; selfApproval?: boolean; key?: string; skin?: "detailed" | "minimal"; description?: string | object; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
85083
85254
 
85084
85255
  /**
85085
85256
  * Resume/cancel/approval-page URLs bound to one \`waitForApproval\` step.
@@ -85255,13 +85426,17 @@ async def sleep(seconds: int)
85255
85426
  # form: Optional form schema for the approval page.
85256
85427
  # self_approval: Whether the user who triggered the flow can approve it (default True).
85257
85428
  # key: Optional checkpoint key naming this approval step.
85429
+ # skin: \`\`"minimal"\`\` shows approvers only the request (form and approve/reject)
85430
+ # instead of the detailed page with the workflow's details.
85431
+ # description: Shown to approvers above the form: a string, or a rich value such as
85432
+ # \`\`{"markdown": "..."}\`\`.
85258
85433
  #
85259
85434
  # Example::
85260
85435
  #
85261
85436
  # urls = await step("urls", lambda: get_approval_urls("manager"))
85262
85437
  # await step("notify", lambda: send_email(urls["resume"], urls["cancel"]))
85263
85438
  # result = await wait_for_approval(key="manager", timeout=3600)
85264
- async def wait_for_approval(timeout: int = 1800, form: dict | None = None, self_approval: bool = True, key: str | None = None) -> dict
85439
+ async def wait_for_approval(timeout: int = 1800, form: dict | None = None, self_approval: bool = True, key: str | None = None, skin: Literal['detailed', 'minimal'] | None = None, description: str | dict | None = None) -> dict
85265
85440
 
85266
85441
  # Get the resume/cancel/approval-page URLs bound to one \`\`wait_for_approval\`\` step.
85267
85442
  #
@@ -85683,7 +85858,7 @@ Manage jobs (import/export)
85683
85858
 
85684
85859
  ### lint
85685
85860
 
85686
- Validate Windmill flow, schedule, and trigger YAML files in a directory
85861
+ Validate Windmill flow, schedule, and trigger YAML files in a directory, and report script metadata that has no deployable content file
85687
85862
 
85688
85863
  **Arguments:** \`[directory:string]\`
85689
85864
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.807.0",
3
+ "version": "1.809.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",