windmill-cli 1.805.0 → 1.807.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 +89 -11
  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.805.0",
16769
+ VERSION: "1.807.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.805.0";
19974
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.807.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.805.0",
56376
+ version: "1.807.0",
56377
56377
  title: "OpenFlow Spec",
56378
56378
  contact: {
56379
56379
  name: "Ruben Fiszel",
@@ -75505,7 +75505,8 @@ async function pushNativeTrigger(workspace, filePath, _remoteTrigger, localTrigg
75505
75505
  is_flow: result.is_flow,
75506
75506
  service_config: result.service_config,
75507
75507
  error: result.error,
75508
- summary: result.summary
75508
+ summary: result.summary,
75509
+ enabled: result.enabled
75509
75510
  };
75510
75511
  debug(`Native trigger ${serviceName}/${externalId} exists on remote`);
75511
75512
  } catch {
@@ -82859,6 +82860,22 @@ def parse_sql_client_name(name: str) -> tuple[str, Optional[str]]
82859
82860
  # decoded back before the caller sees it: a \`\`datetime\`\` comes back as a
82860
82861
  # string, a tuple as a list.
82861
82862
  #
82863
+ # \`\`retry\`\` re-dispatches the task after a failure, inside \`\`@workflow\`\` only.
82864
+ # Every attempt is a step of its own (\`\`call_api\`\`, \`\`call_api#2\`\`, ...) and
82865
+ # the wait between two of them is a durable sleep, so a retrying task holds no
82866
+ # worker while it backs off. Keys: \`\`attempts\`\` (retries after the first
82867
+ # failure, a whole number from 0 to 100), \`\`delay\`\` (seconds before the first
82868
+ # retry, sub-second delays dropped), \`\`multiplier\`\` (applied to the delay
82869
+ # after each attempt, 1 keeps it constant), \`\`max_delay\`\` (ceiling in
82870
+ # seconds). \`\`attempts\`\` is required, and an out-of-range or unknown key is
82871
+ # rejected where the policy is written.
82872
+ #
82873
+ # A workflow sleeps once per round, so tasks backing off in the same fan-out
82874
+ # wait one after another rather than together: the delay before a fan-out
82875
+ # retries is the sum of every backoff pending in it, not the longest one, and
82876
+ # it grows with both the width of the fan-out and \`\`attempts\`\`. Retries with
82877
+ # no \`\`delay\`\` all go out in a single round.
82878
+ #
82862
82879
  # Usage::
82863
82880
  #
82864
82881
  # @task
@@ -82866,10 +82883,15 @@ def parse_sql_client_name(name: str) -> tuple[str, Optional[str]]
82866
82883
  #
82867
82884
  # @task(path="f/external_script", timeout=600, tag="gpu")
82868
82885
  # async def run_external(x: int): ...
82869
- def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
82886
+ #
82887
+ # @task(retry={"attempts": 3, "delay": 30, "multiplier": 2})
82888
+ # async def call_api(payload: dict): ...
82889
+ def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
82870
82890
 
82871
82891
  # Create a task that dispatches to a separate Windmill script.
82872
82892
  #
82893
+ # \`\`retry\`\` takes the same policy as :func:\`task\`.
82894
+ #
82873
82895
  # Usage::
82874
82896
  #
82875
82897
  # extract = task_script("f/data/extract", timeout=600)
@@ -82877,10 +82899,12 @@ def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, ti
82877
82899
  # @workflow
82878
82900
  # async def main():
82879
82901
  # data = await extract(url="https://...")
82880
- def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
82902
+ def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
82881
82903
 
82882
82904
  # Create a task that dispatches to a separate Windmill flow.
82883
82905
  #
82906
+ # \`\`retry\`\` takes the same policy as :func:\`task\`.
82907
+ #
82884
82908
  # Usage::
82885
82909
  #
82886
82910
  # pipeline = task_flow("f/etl/pipeline", priority=10)
@@ -82888,7 +82912,7 @@ def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = N
82888
82912
  # @workflow
82889
82913
  # async def main():
82890
82914
  # result = await pipeline(input=data)
82891
- def task_flow(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
82915
+ def task_flow(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
82892
82916
 
82893
82917
  # Decorator marking an async function as a workflow-as-code entry point.
82894
82918
  #
@@ -84936,6 +84960,34 @@ A caught failure reads the same whether it came from a task or from a \`step()\`
84936
84960
  Import: \`import { workflow, task, taskScript, taskFlow, step, sleep, waitForApproval, getApprovalUrls, getResumeUrls, parallel } from "windmill-client"\`
84937
84961
 
84938
84962
  \`\`\`typescript
84963
+ /**
84964
+ * Re-dispatch policy for a failed task.
84965
+ *
84966
+ * Every attempt is a step of its own (\`fetch\`, \`fetch#2\`, \`fetch#3\`), and the
84967
+ * wait between two of them is a durable sleep, so a retrying task holds no
84968
+ * worker while it backs off.
84969
+ *
84970
+ * A workflow sleeps once per round, so tasks backing off in the same fan-out
84971
+ * wait one after another rather than together: the delay before a fan-out
84972
+ * retries is the sum of every backoff pending in it, not the longest one, and
84973
+ * it grows with both the width of the fan-out and \`attempts\`. Retries with no
84974
+ * \`delay\` all go out in a single round.
84975
+ */
84976
+ export interface TaskRetry {
84977
+ /** Attempts after the first failure: \`2\` runs the task at most 3 times.
84978
+ * A whole number from 0 to 100; anything else is rejected where the policy
84979
+ * is written. */
84980
+ attempts: number;
84981
+ /** Seconds to wait before the first retry. Default 0, retry immediately.
84982
+ * Sub-second delays are dropped — a durable sleep resolves to the second. */
84983
+ delay?: number;
84984
+ /** Applied to the delay after each attempt: 1 (the default) keeps it
84985
+ * constant, 2 doubles it. */
84986
+ multiplier?: number;
84987
+ /** Ceiling for the delay in seconds, for a \`multiplier\` above 1. */
84988
+ max_delay?: number;
84989
+ }
84990
+
84939
84991
  export interface TaskOptions {
84940
84992
  timeout?: number;
84941
84993
  tag?: string;
@@ -84944,6 +84996,7 @@ export interface TaskOptions {
84944
84996
  concurrency_limit?: number;
84945
84997
  concurrency_key?: string;
84946
84998
  concurrency_time_window_s?: number;
84999
+ retry?: TaskRetry;
84947
85000
  }
84948
85001
 
84949
85002
  /**
@@ -84961,9 +85014,11 @@ export async function getResumeUrls(approver?: string, flowLevel?: boolean): Pro
84961
85014
  * @example
84962
85015
  * const extract_data = task(async (url: string) => { ... });
84963
85016
  * const run_external = task("f/external_script", async (x: number) => { ... });
85017
+ * const call_api = task(fetchOrders, { retry: { attempts: 3, delay: 30, multiplier: 2 } });
84964
85018
  *
84965
85019
  * Inside a \`workflow()\`, calling a task dispatches it as a step.
84966
- * Outside a workflow, the function body executes directly.
85020
+ * Outside a workflow, the function body executes directly and
85021
+ * {@link TaskOptions} — retry included — does not apply.
84967
85022
  *
84968
85023
  * A task runs as its own job, so its result is always encoded as JSON and
84969
85024
  * decoded back before the caller sees it: a \`Date\` comes back as a string, a
@@ -85107,6 +85162,22 @@ def get_resume_urls(approver: str = None, flow_level: bool = None) -> dict
85107
85162
  # decoded back before the caller sees it: a \`\`datetime\`\` comes back as a
85108
85163
  # string, a tuple as a list.
85109
85164
  #
85165
+ # \`\`retry\`\` re-dispatches the task after a failure, inside \`\`@workflow\`\` only.
85166
+ # Every attempt is a step of its own (\`\`call_api\`\`, \`\`call_api#2\`\`, ...) and
85167
+ # the wait between two of them is a durable sleep, so a retrying task holds no
85168
+ # worker while it backs off. Keys: \`\`attempts\`\` (retries after the first
85169
+ # failure, a whole number from 0 to 100), \`\`delay\`\` (seconds before the first
85170
+ # retry, sub-second delays dropped), \`\`multiplier\`\` (applied to the delay
85171
+ # after each attempt, 1 keeps it constant), \`\`max_delay\`\` (ceiling in
85172
+ # seconds). \`\`attempts\`\` is required, and an out-of-range or unknown key is
85173
+ # rejected where the policy is written.
85174
+ #
85175
+ # A workflow sleeps once per round, so tasks backing off in the same fan-out
85176
+ # wait one after another rather than together: the delay before a fan-out
85177
+ # retries is the sum of every backoff pending in it, not the longest one, and
85178
+ # it grows with both the width of the fan-out and \`\`attempts\`\`. Retries with
85179
+ # no \`\`delay\`\` all go out in a single round.
85180
+ #
85110
85181
  # Usage::
85111
85182
  #
85112
85183
  # @task
@@ -85114,10 +85185,15 @@ def get_resume_urls(approver: str = None, flow_level: bool = None) -> dict
85114
85185
  #
85115
85186
  # @task(path="f/external_script", timeout=600, tag="gpu")
85116
85187
  # async def run_external(x: int): ...
85117
- def task(_func = None, *, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
85188
+ #
85189
+ # @task(retry={"attempts": 3, "delay": 30, "multiplier": 2})
85190
+ # async def call_api(payload: dict): ...
85191
+ def task(_func = None, *, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
85118
85192
 
85119
85193
  # Create a task that dispatches to a separate Windmill script.
85120
85194
  #
85195
+ # \`\`retry\`\` takes the same policy as :func:\`task\`.
85196
+ #
85121
85197
  # Usage::
85122
85198
  #
85123
85199
  # extract = task_script("f/data/extract", timeout=600)
@@ -85125,10 +85201,12 @@ def task(_func = None, *, path: Optional[str] = None, tag: Optional[str] = None,
85125
85201
  # @workflow
85126
85202
  # async def main():
85127
85203
  # data = await extract(url="https://...")
85128
- def task_script(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
85204
+ def task_script(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
85129
85205
 
85130
85206
  # Create a task that dispatches to a separate Windmill flow.
85131
85207
  #
85208
+ # \`\`retry\`\` takes the same policy as :func:\`task\`.
85209
+ #
85132
85210
  # Usage::
85133
85211
  #
85134
85212
  # pipeline = task_flow("f/etl/pipeline", priority=10)
@@ -85136,7 +85214,7 @@ def task_script(path: str, *, timeout: Optional[int] = None, tag: Optional[str]
85136
85214
  # @workflow
85137
85215
  # async def main():
85138
85216
  # result = await pipeline(input=data)
85139
- def task_flow(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
85217
+ def task_flow(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
85140
85218
 
85141
85219
  # Decorator marking an async function as a workflow-as-code entry point.
85142
85220
  #
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.805.0",
3
+ "version": "1.807.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",