Skip to content

Commit 145a2e5

Browse files
committed
Workflow as code added to comparaison + cleaned VS Code doc
1 parent 8d85c47 commit 145a2e5

File tree

6 files changed

+47
-27
lines changed

6 files changed

+47
-27
lines changed
Loading
Binary file not shown.

docs/cli_local_dev/1_vscode-extension/index.mdx

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ The Windmill VS Code extension allows you to build scripts and flows in the comf
66

77
![VS Code Extension](../../../blog/2023-11-20-vscode/vscode_extension.png 'VS Code Extension')
88

9-
The extension can be used in particular from a [repository synchronized to a Windmill instance](../../advanced/3_cli/sync.mdx) to [develop scripts & flows locally](../../advanced/4_local_development/index.mdx) while keeping them synced to your workspace.
10-
11-
<div className="grid grid-cols-2 gap-6 mb-4">
12-
<DocCard
13-
title="Command-Line Interface - Sync"
14-
description="Sync with a Windmill workspace from Windmill CLI."
15-
href="/docs/advanced/cli"
16-
/>
17-
</div>
9+
The extension can be used in particular from a repository synchronized to a Windmill instance to [develop scripts & flows locally](../../advanced/4_local_development/index.mdx) while keeping them synced to your workspace.
1810

1911
<iframe
2012
style={{ aspectRatio: '16/9' }}
@@ -56,7 +48,7 @@ To run scripts locally, see [Run Locally](../../advanced/4_local_development/run
5648

5749
## Installation
5850

59-
1. First of all, have your workspace synced locally with [Windmill CLI](../../advanced/3_cli/index.mdx).
51+
First of all, have your workspace synced locally with [Windmill CLI](../../advanced/3_cli/index.mdx).
6052

6153
![Local workspace](../../../blog/2023-11-20-vscode/local_workspace.png.webp)
6254

@@ -74,6 +66,18 @@ In the settings menu, set the remote url, workspace name and [token](../../core_
7466

7567
3. From any script file, use `> Windmill: Run preview in the current editor` or Ctrl+Enter and Shift+Enter to generate the UI preview (provided that the script meets the [few rules](../../core_concepts/13_json_schema_and_parsing/index.md#json-schema-in-windmill) required by Windmill).
7668

69+
All details to set up the workspace folder:
70+
71+
<div className="grid grid-cols-2 gap-6 mb-4">
72+
<DocCard
73+
title="Setting up the workspace folder"
74+
description="Developing Windmill scripts and flows from your favorite IDE is made easy by using Windmill CLI."
75+
href="/docs/advanced/local_development#setting-up-the-workspace-folder"
76+
/>
77+
</div>
78+
79+
## Actions
80+
7781
The preview & run will work for any script meeting the specific language requirements (main function, imports) and being named with the dedicated file extension (.py, .go etc.). For scripts in Bun, name the file \[name\].bun.ts, ".ts" being by default Deno.
7882

7983
The extension will split your screen and display a panel. That panel will update automatically based on the edited document on the left.
@@ -83,34 +87,40 @@ The extension will split your screen and display a panel. That panel will update
8387

8488
In particular:
8589

86-
## Test scripts, flows and flows steps from VS Code
90+
### Test scripts, flows and flows steps
91+
92+
Once you have your scripts and flows locally (either pulled from a remote workspace or created from scratch), you can test them directly from VS Code.
8793

8894
<video
8995
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
9096
autoPlay
91-
loop
97+
controls
9298
src="/videos/vs_code_tour.mp4"
9399
/>
94100

95-
## Editing the YAML definition of a flow instantly updates the rendered graph
101+
### Update UI from YAML
102+
103+
Editing the YAML definition of a flow instantly updates the rendered graph
96104

97105
<video
98106
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
99107
autoPlay
100-
loop
108+
controls
101109
src="/videos/ui_to_yaml.mp4"
102110
/>
103111

104-
## Editing the flow from the UI immediately modifies the YAML definition
112+
### Update YAML from UI
113+
114+
Editing the flow from the UI immediately modifies the YAML definition
105115

106116
<video
107117
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
108118
autoPlay
109-
loop
119+
controls
110120
src="/videos/yaml_to_ui.mp4"
111121
/>
112122

113-
## Infer lockfile or Use current lockfile
123+
### Infer lockfile or Use current lockfile
114124

115125
With this toggle, you can choose to use the metadata lockfile instead of inferring them directly from the script.
116126

docs/compared_to/peers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Airflow and Temporal are the golden standards. They are very good, battle-tested
3232

3333
<br />
3434

35-
Those frameworks are a great source of inspiration for us but we bring a more principled and more opinionated approach so that one can focus on writing scripts rather than becoming a workflow engine expert. The goal of Windmill is to bring the benefits of those workflow engines in a more accessible package that is fit not just for data engineers but for hybrid teams made of data scientist, ops, and software engineers with standard scripts in Python/Typescript/Go/Bash and low-code builder for the graph itself the common denominator, without any sacrifice on performance (and actually we run workflows faster than those frameworks, more on that in [1]), features, scalability/reliability and by improving the debuggability and developer experience of those.
35+
Those frameworks are a great source of inspiration for us but we bring a more principled and more opinionated approach so that one can focus on writing scripts rather than becoming a workflow engine expert. The goal of Windmill is to bring the benefits of those workflow engines in a more accessible package that is fit not just for data engineers but for hybrid teams made of data scientist, ops, and software engineers with standard scripts in Python/Typescript/Go/Bash and low-code builder for the graph itself the common denominator, without any sacrifice on performance (and actually we run workflows faster than those frameworks, more on that in [1]), features, scalability/reliability and by improving the debuggability and developer experience of those. It is also possible to define [workflows-as-code](../core_concepts/31_workflows_as_code/index.mdx), in the same way as Prefect or Airflow (writing a program that defines the jobs and their dependencies, and then execute that program).
3636

3737
<br />
3838

docs/compared_to/prefect.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,29 +75,33 @@ We could also mention [storage of configuration](../core_concepts/3_resources_an
7575

7676
![Prefect features](../assets/compared_to/prefect_features.png.webp 'Prefect features')
7777

78-
The difference between Prefect and Windmill lies in the method of building flows.
79-
8078
Prefect is heavily code-based. Everything is and can only be defined in Python. The steps and their configurations are defined by code:
8179

8280
![Prefect flow](../assets/compared_to/flow_prefect.png.webp 'Prefect flow')
8381

84-
> [Flow](#benchmark-1) _Given a GitHub repository, logs the number of stargazers and contributors for that repo_ on Prefect.
82+
> [Flow](#benchmark-1) "_Given a GitHub repository, logs the number of stargazers and contributors for that repo_" on Prefect.
8583
8684
<br />
8785

88-
In Windmill, the steps are also code-based but built from scripts ([TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx), [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx), [Go](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [Bash](../getting_started/0_scripts_quickstart/4_bash_quickstart/index.mdx), [SQL](../getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx) ...). Users can write the code directly, choose a script from the workspace, the community library [WindmillHub](https://hub.windmill.dev/), or have it [generated with AI](#windmill-ai). Each script can be saved with [permissions](../core_concepts/16_roles_and_permissions/index.mdx) set from the workspace.
86+
Windmill offers both low-code and code-based solutions.
87+
88+
![Windmill compared to Prefect](../assets/compared_to/windmill_compared_prefect.png 'Windmill compared to Prefect')
89+
90+
### Flow Editor
91+
92+
In Windmill's [Flow Editor](../flows/1_flow_editor.mdx), the steps are also code-based but built from scripts ([TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx), [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx), [Go](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [Bash](../getting_started/0_scripts_quickstart/4_bash_quickstart/index.mdx), [SQL](../getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx) ...). Users can write the code directly, choose a script from the workspace, the community library [WindmillHub](https://hub.windmill.dev/), or have it [generated with AI](#windmill-ai). Each script can be saved with [permissions](../core_concepts/16_roles_and_permissions/index.mdx) set from the workspace.
8993

9094
The structuring of the flow and the configurations for each step are defined from a User Interface. With a _code when you need_ mindset, the user can navigate the flow editor in low-code.
9195

9296
![Windmill flow](../assets/compared_to/flow_windmill.png.webp 'Windmill flow')
9397

94-
> [Flow](#benchmark-1) _Given a GitHub repository, logs the number of stargazers and contributors for that repo_ on Windmill.
98+
> [Flow](#benchmark-1) "_Given a GitHub repository, logs the number of stargazers and contributors for that repo_" on Windmill.
9599
96100
<br />
97101

98102
In particular, Windmill [generates automatically UIs](../core_concepts/6_auto_generated_uis/index.mdx) for flows and steps and lets users [test](../core_concepts/23_instant_preview/index.mdx) flows, steps or flow until a given step, from the UI.
99103

100-
Flows can be [defined visually / YAML](../advanced/4_local_development/index.mdx) on a local environment. In particular, Windmill has a VS Code extension to edit from your code editor scripts and workflows-as-code.
104+
Flows can be [defined visually / YAML](../advanced/4_local_development/index.mdx) on a local environment. In particular, Windmill has a [VS Code extension](../cli_local_dev/1_vscode-extension/index.mdx) to edit from your code editor scripts flows YAML.
101105

102106
<div className="grid grid-cols-2 gap-6 mb-4">
103107
<DocCard
@@ -107,7 +111,13 @@ Flows can be [defined visually / YAML](../advanced/4_local_development/index.mdx
107111
/>
108112
</div>
109113

110-
![Windmill compared to Prefect](../assets/compared_to/windmill_compared_prefect.png.webp 'Windmill compared to Prefect')
114+
### Workflows as Code
115+
116+
[Flows](#flow-editor) are not the only way to write distributed programs that execute distinct jobs. Another approach is to write a program that defines the jobs and their dependencies, and then execute that program. This is known as [workflows as code](../core_concepts/31_workflows_as_code/index.mdx).
117+
118+
![Script in python executing workflow as code](../core_concepts/31_workflows_as_code/python_editor.png "Script in python executing workflow as code")
119+
120+
Windmill supports defining workflows as code in a single script in both [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx) and [TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) using intuitive and lightweight syntax.
111121

112122
## Triggers
113123

docs/core_concepts/31_workflows_as_code/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import TabItem from '@theme/TabItem';
55

66
[Flows](../../flows/1_flow_editor.mdx) are not the only way to write distributed programs that execute distinct jobs. Another approach is to write a program that defines the jobs and their dependencies, and then execute that program. This is known as workflows as code.
77

8-
![Script in python executing workflow as code](python_editor.png "Script in python executing workflow as code")
8+
![Script in python executing workflow as code](./python_editor.png "Script in python executing workflow as code")
99

1010
One way of doing this is to use the [API of Windmill](https://app.windmill.dev/openapi.html) itself, to run jobs imperatively, using run_script and run_flow (their sync or async counterparts). This is a powerful way to define workflows, but it can be complex and verbose.
1111

12-
It also requires to define the different jobs in different scripts. This is why, Windmill supports defining workflows as code in a single script in both [Python](../../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx) and [TypeScript](../../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) using intuitive and lightweight syntax.
12+
It also requires to define the different jobs in different scripts. This is why Windmill supports defining workflows as code in a single script in both [Python](../../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx) and [TypeScript](../../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) using intuitive and lightweight syntax.
1313

1414
The syntax is highlighted in the below examples, note that the subtask are indeed executed as distinct jobs, with their own logs, and their relationship with their parent task is recorded which allows for the timeline of each task to be displayed in the UI.
1515

0 commit comments

Comments
 (0)