You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/compared_to/peers.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Those frameworks are a great source of inspiration for us but we bring a more pr
32
32
33
33
<br/>
34
34
35
-
From a tech stack perspective, we rely on the ACID properties of PostgreSQL to achieve persistence and transactionality of the workflow's state. We made the simplifying assumption to be an at-least-once workflow engine, where in the exceptionally rare events of an infrastructure crash (machine shutdown, network split, etc), we will recover automatically but it is up to the application developer to implement idempotency in parts where it is critical for everything else, we support the same feature set ([retries](../flows/14_retries.md), [error handler](../flows/7_flow_error_handler.md), [suspend/sleep](../flows/15_sleep.md), [approval steps](../flows/11_flow_approval.md), [cancellation](../flows/2_early_stop.md), [inner workflows](../getting_started/9_trigger_flows/index.mdx#trigger-a-flow-from-another-flow)).
35
+
From a tech stack perspective, we rely on the ACID properties of PostgreSQL to achieve persistence and transactionality of the workflow's state. We made the simplifying assumption to be an at-least-once workflow engine, where in the exceptionally rare events of an infrastructure crash (machine shutdown, network split, etc), we will recover automatically but it is up to the application developer to implement idempotency in parts where it is critical for everything else, we support the same feature set ([retries](../flows/14_retries.md), [error handler](../flows/7_flow_error_handler.md), [suspend/sleep](../flows/15_sleep.md), [approval steps](../flows/11_flow_approval.mdx), [cancellation](../flows/2_early_stop.md), [inner workflows](../getting_started/9_trigger_flows/index.mdx#trigger-a-flow-from-another-flow)).
Copy file name to clipboardExpand all lines: docs/compared_to/retool.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ executable through [autogenerated UIs](../core_concepts/6_auto_generated_uis/ind
101
101
Retool is not originally designed as a workflow engine.
102
102
Its flow capabilities are geared towards non-technical users, similar to n8n.
103
103
Adding steps or for loops can be frustrating.
104
-
Flows will be limited without features like [approval steps](../flows/11_flow_approval.md), [early stop](../flows/2_early_stop.md), [sleep](../flows/15_sleep.md), etc.
104
+
Flows will be limited without features like [approval steps](../flows/11_flow_approval.mdx), [early stop](../flows/2_early_stop.md), [sleep](../flows/15_sleep.md), etc.
105
105
106
106
The flow-building experience is cumbersome, as Retool has not managed to incorporate the same level
107
107
of low-code simplicity found in its app builder (e.g. picking inputs from previous steps’ outputs).
Copy file name to clipboardExpand all lines: docs/core_concepts/11_persistent_storage/index.mdx
+46-14Lines changed: 46 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
+
importDocCardfrom'@site/src/components/DocCard';
2
+
1
3
# Persistent Storage
2
4
3
5
Persistent storage refers to any method of storing data that remains intact and accessible even after a system is powered off, restarted, or experiences a crash.
4
6
5
-
In the context of Windmill, the stakes are: **where to effectively store and manage the data manipulated by Windmill**? (ETL, data ingestion and preprocessing, data migration and sync etc.)
7
+
In the context of Windmill, the stakes are: **where to effectively store and manage the data manipulated by Windmill** (ETL, data ingestion and preprocessing, data migration and sync etc.) ?
6
8
7
9
:::info TLDR
8
10
@@ -48,15 +50,17 @@ Within Windmill, you can use States and Resources as a way to store a transient
48
50
49
51
#### States
50
52
51
-
[States](../3_resources_and_types/index.mdx#states) are actually resources (but excluded from the Workspace tab for clarity). They are used by scripts to keep data persistent between runs of the same script by the same trigger (schedule or user).
53
+
In Windmill, [States](../3_resources_and_types/index.mdx#states) are considered as resources, but they are excluded from the Workspace tab for clarity.
54
+
They are displayed on the Resources menu, under a dedicated tab.
55
+
56
+
States are used by scripts to keep data persistent between runs of the same script by the same trigger (schedule or user).
52
57
53
-
A state is an object stored as a resource of the resource type `state` which is meant to persist across distinct executions of the same script. This is what enables Flows to watch for changes in most event watching scenarios. The pattern is as follows:
58
+
A state is an object stored as a resource of the resource type `state` which is meant to persist across distinct executions of the same script.
59
+
This is what enables Flows to watch for changes in most event watching scenarios. The pattern is as follows:
54
60
55
-
- Retrieve the last state or, if undefined, assume it is the first
56
-
execution.
61
+
- Retrieve the last state or, if undefined, assume it is the first execution.
57
62
- Retrieve the current state in the external system you are watching, e.g. the
58
-
list of users having starred your repo or the maximum ID of posts on Hacker
59
-
News.
63
+
list of users having starred your repo or the maximum ID of posts on Hacker News.
60
64
- Calculate the difference between the current state and the last internal
61
65
state. This difference is what you will want to act upon.
62
66
- Set the new state as the current state so that you do not process the
@@ -66,21 +70,49 @@ A state is an object stored as a resource of the resource type `state` which is
66
70
one Flow per item. This is exactly the pattern used when your Flow is in the
67
71
mode of "Watching changes regularly".
68
72
69
-
The convenience functions do this in TypeScript are:
73
+
The convenience functions do this are:
74
+
75
+
*TypeScript*
70
76
71
77
-`getState()` which retrieves an object of any type (internally a simple
72
78
Resource) at a path determined by `getStatePath`, which is unique to the user
73
79
currently executing the Script, the Flow in which it is currently getting
74
-
called in - if any - and the path of the Script
75
-
-`setState(value: any)` which sets the new state
80
+
called in - if any - and the path of the Script.
81
+
-`setState(value: any)` which sets the new state.
82
+
83
+
> Please note it requires [importing](../../advanced/6_imports/index.md) the wmill client library from Deno/Bun.
84
+
85
+
<br/>
86
+
87
+
*Python*
88
+
89
+
-`get_state()` which retrieves an object of any type (internally a simple
90
+
Resource) at a path determined by `get_state_path`, which is unique to the user
91
+
currently executing the Script, the Flow in which it is currently getting
92
+
called in - if any - and the path of the Script.
93
+
-`set_state(value: Any)` which sets the new state.
94
+
95
+
<br/>
96
+
97
+
> Please note it requires [importing](../../advanced/6_imports/index.md) the wmill client library from Python.
98
+
99
+
<br/>
100
+
101
+
<divclass="grid grid-cols-2 gap-6 mb-4">
102
+
<DocCard
103
+
title="Resources and Resource Types"
104
+
description="Resources are structured configurations and connections to third-party systems, with Resource Types defining the schema for each Resource."
105
+
href="/docs/core_concepts/resources_and_types"
106
+
/>
107
+
</div>
76
108
77
109
#### Resources
78
110
79
-
States are a specific type of resource in Windmill where the type is `state` the path is automatically calculated for you based on the schedule path (if any) and the script path. In some cases, you want to set the path arbitrarily and/or use a different type than `state`. In this case, you can use the `setResource` and `getResource` functions. A same resource can be used across different scripts and flows.
111
+
[States](#states) are a specific type of resource in Windmill where the type is `state` the path is automatically calculated for you based on the schedule path (if any) and the script path. In some cases, you want to set the path arbitrarily and/or use a different type than `state`. In this case, you can use the `setResource` and `getResource` functions. A same resource can be used across different scripts and flows.
80
112
81
113
-`setResource(value: any, path?: string, initializeToTypeIfNotExist?: string)`: which sets a resource at a given path. This is
82
-
equivalent to `setState` but allows you to set an arbitrary path and chose a type other than state if wanted. [See api](https://deno.land/x/windmill/mod.ts?s=setResource)
83
-
-`getResource(path: string)`: gets a resource at a given path. [See api](https://deno.land/x/windmill/mod.ts?s=getResource)
114
+
equivalent to `setState` but allows you to set an arbitrary path and chose a type other than state if wanted. [See api](https://deno.land/x/windmill/mod.ts?s=setResource).
115
+
-`getResource(path: string)`: gets a resource at a given path. [See api](https://deno.land/x/windmill/mod.ts?s=getResource).
84
116
85
117
The states can be seen in the [Resources](../3_resources_and_types/index.mdx) section with a
86
118
[Resource Type](../3_resources_and_types/index.mdx#create-a-resource-type) of `state`.
@@ -116,7 +148,7 @@ Once the Shared Directory is enabled, you can use it in your flow by referencing
116
148
117
149
:::tip
118
150
119
-
Keep in mind that the contents of the `./shared` folder are not preserved across [suspends](../../flows/11_flow_approval.md) and [sleeps](../../flows/15_sleep.md). The directory is temporary and active only during the execution of the flow.
151
+
Keep in mind that the contents of the `./shared` folder are not preserved across [suspends](../../flows/11_flow_approval.mdx) and [sleeps](../../flows/15_sleep.md). The directory is temporary and active only during the execution of the flow.
Copy file name to clipboardExpand all lines: docs/core_concepts/16_roles_and_permissions/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Users can be given different levels of permissions:
45
45
The recommended way to share scripts and flows with operators is through [auto-generated apps](../6_auto_generated_uis/index.md#automatically-generated-apps).
46
46
With the second option being of sharing the script and [variables](../2_variables_and_secrets/index.mdx) it depends on (but operators won't be able to load variable directly from the UI/api, only use them within the scripts they have access to).
47
47
48
-
5.**Anonymous app viewers**: Anonymous app viewers are individuals who can access and view Windmill apps without being a user but by knowing the [secret URL](../../apps/0_toolbar.mdx#deploy) that allows app viewing. They do not have any editing or privileges to execute scripts and flows. The apps that they see execute the scripts and flows that are part of the app but only on behalf of the app author. The anonymous user cannot execute any of the scripts and flows part of the apps outside of the inputs authorized by the app through a policy that is automatically generated by the app.
48
+
5.**Anonymous app viewers**: Anonymous app viewers are individuals who can access and view Windmill apps without being a user but by knowing the [secret URL](../../apps/0_toolbar.md#deploy) that allows app viewing. They do not have any editing or privileges to execute scripts and flows. The apps that they see execute the scripts and flows that are part of the app but only on behalf of the app author. The anonymous user cannot execute any of the scripts and flows part of the apps outside of the inputs authorized by the app through a policy that is automatically generated by the app.
Copy file name to clipboardExpand all lines: docs/core_concepts/3_resources_and_types/index.mdx
+54-2Lines changed: 54 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -86,10 +86,62 @@ default, etc). You can also view the schema by toggling the "As JSON" option:
86
86
87
87
## States
88
88
89
-
In Windmill, states are considered as resources, but they are excluded from the Workspace tab for clarity. States are used by scripts to keep data persistent between runs of the same script by the same trigger (schedule or user).
90
-
89
+
In Windmill, states are considered as resources, but they are excluded from the Workspace tab for clarity.
91
90
They are displayed on the Resources menu, under a dedicated tab.
92
91
92
+
States are used by scripts to keep data persistent between runs of the same script by the same trigger (schedule or user).
93
+
94
+
A state is an object stored as a resource of the resource type `state` which is meant to persist across distinct executions of the same script.
95
+
This is what enables Flows to watch for changes in most event watching scenarios. The pattern is as follows:
96
+
97
+
- Retrieve the last state or, if undefined, assume it is the first execution.
98
+
- Retrieve the current state in the external system you are watching, e.g. the
99
+
list of users having starred your repo or the maximum ID of posts on Hacker News.
100
+
- Calculate the difference between the current state and the last internal
101
+
state. This difference is what you will want to act upon.
102
+
- Set the new state as the current state so that you do not process the
103
+
elements you just processed.
104
+
- Return the differences calculated previously so that you can process them in
105
+
the next steps. You will likely want to [forloop](../../flows/12_flow_loops.md) over the items and trigger
106
+
one Flow per item. This is exactly the pattern used when your Flow is in the
107
+
mode of "Watching changes regularly".
108
+
109
+
The convenience functions do this are:
110
+
111
+
*TypeScript*
112
+
113
+
-`getState()` which retrieves an object of any type (internally a simple
114
+
Resource) at a path determined by `getStatePath`, which is unique to the user
115
+
currently executing the Script, the Flow in which it is currently getting
116
+
called in - if any - and the path of the Script.
117
+
-`setState(value: any)` which sets the new state.
118
+
119
+
> Please note it requires [importing](../../advanced/6_imports/index.md) the wmill client library from Deno/Bun.
120
+
121
+
<br/>
122
+
123
+
*Python*
124
+
125
+
-`get_state()` which retrieves an object of any type (internally a simple
126
+
Resource) at a path determined by `get_state_path`, which is unique to the user
127
+
currently executing the Script, the Flow in which it is currently getting
128
+
called in - if any - and the path of the Script.
129
+
-`set_state(value: Any)` which sets the new state.
130
+
131
+
<br/>
132
+
133
+
> Please note it requires [importing](../../advanced/6_imports/index.md) the wmill client library from Python.
134
+
135
+
<br/>
136
+
137
+
<divclass="grid grid-cols-2 gap-6 mb-4">
138
+
<DocCard
139
+
title="Persistent Storage"
140
+
description="Ensure that your data is safely stored and easily accessible whenever required."
0 commit comments