Skip to content

Commit 46ad984

Browse files
authored
Workflow as code docs & changelog, some app updates (windmill-labs#541)
1 parent 4de4da3 commit 46ad984

File tree

21 files changed

+184
-68
lines changed

21 files changed

+184
-68
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
slug: workflow-as-code
3+
version: v1.284.0
4+
title: Workflow as Code
5+
tags: ['Scripts', 'Flow Editor']
6+
image: ./python_editor.png
7+
description: Flows 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.
8+
features:
9+
[
10+
'Define workflows as code in a single script intuitive and lightweight syntax.',
11+
'Support for Python.',
12+
'Support for TypeScript.',
13+
]
14+
docs: /docs/core_concepts/workflows_as_code
15+
---
Loading

docs/advanced/11_git_sync/cli_sync.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import DocCard from '@site/src/components/DocCard';
66

77
# CLI Sync
88

9-
You can use Windmill CLI to sync workspace to a git repository. Either with raw syncing using `wmill sync pull` & `wmill sync push` or with stateful syncing using `wmill sync pull --stateful` & `wmill sync push --stateful`.
9+
You can use [Windmill CLI](../3_cli/index.mdx) to sync workspace to a git repository. Either with raw syncing using `wmill sync pull` & `wmill sync push` or with stateful syncing using `wmill sync pull --stateful` & `wmill sync push --stateful`.
1010

1111
For more details, see:
1212

docs/advanced/13_version_control/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ More details at:
3636

3737
## CLI Sync
3838

39-
You can use Windmill CLI to sync workspace to a git repository.
39+
You can use [Windmill CLI](../3_cli/index.mdx) to sync workspace to a git repository.
4040

4141
More details at:
4242

docs/apps/4_app_configuration_settings/button.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ The button component has a special parameter called `On Success`. This parameter
5151
- **Set the tab of a Tabs component**: the button sets the tab of a Tabs component after the runnable is executed.
5252
- **Display a toast**: the button displays a toast after the runnable is executed.
5353

54-
### **Go to an URL configuration:**
54+
### Go to an URL configuration
5555

5656
| Name | Type | Connectable | Templatable | Default | Description |
5757
| ------- | :-----: | :---------: | :---------: | :-----------: | ---------------------------------------------- |
5858
| URL | string | true | false | /apps/get/foo | The URL to redirect the user to. |
5959
| New Tab | boolean | false | false | true | Whether the URL should be opened in a new tab. |
6060

61-
### **Set the tab of a Tabs component configuration:**
61+
### Set the tab of a Tabs component configuration
6262

6363
| Name | Type | Connectable | Templatable | Default | Description |
6464
| ------- | :---------------------------------: | :---------: | :---------: | :-----: | --------------------------------------------------------------------------------------- |
6565
| Set Tab | Array`<{id: string, index:number}>` | false | false | [] | The tabs to set. The id is the id of the Tabs component and the index is the tab index. |
6666

67-
### **Display a toast configuration:**
67+
### Display a toast configuration
6868

6969
| Name | Type | Connectable | Templatable | Default | Description |
7070
| ------- | :----: | :---------: | :---------: | :---------: | ------------------------------------ |

docs/apps/4_app_configuration_settings/dropdown_menu.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,9 @@ Each item is a [Button component](./button.mdx).
4949
| Fill container | boolean | false | false | false | Whether the dropdown menu should fill the component container. |
5050
| Before Icon | string | false | false | Undefined | The icon to display before the label. |
5151
| After Icon | string | false | false | Undefined | The icon to display after the label. |
52+
53+
## Outputs
54+
55+
| Name | Type | Description |
56+
| ------- | :-----: | -------------------------------- |
57+
| latestButtonClicked | string | The id of the [Button component](./button.mdx) that was latest picked by the user. |

docs/core_concepts/1_scheduling/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Managing scripts, flows and apps on Windmill works at the [workspace](../16_role
3737

3838
<br />
3939

40-
Cron jobs are one of **many ways to [trigger workflows](../../getting_started/9_trigger_flows/index.mdx) in Windmill** (among [webhooks](../4_webhooks/index.mdx), [auto-generated UIs][flows], [customized UIs][apps], [Command Line Interface](../../advanced/3_cli/index.mdx), [Slackbots](/blog/handler-slack-commands) etc.)
40+
Cron jobs are one of **many ways to [trigger workflows](../../getting_started/9_trigger_flows/index.mdx) in Windmill** (among [webhooks](../4_webhooks/index.mdx), [auto-generated UIs](../6_auto_generated_uis/index.mdx), [customized UIs][apps], [Command Line Interface](../../advanced/3_cli/index.mdx), [Slackbots](/blog/handler-slack-commands) etc.)
4141

42-
:::
42+
:::)
4343

4444
## Configure Schedules for Each Task ([Script][scripts], [Workflows][flows])
4545

@@ -211,4 +211,4 @@ From a script or flow's Run page (after being [deployed](../0_draft_and_deploy/i
211211

212212
[flows]: ../../getting_started/6_flows_quickstart/index.mdx
213213
[scripts]: ../../getting_started/0_scripts_quickstart/index.mdx
214-
[apps]: ../../getting_started/7_apps_quickstart/index.mdx
214+
[apps]: ../../getting_started/7_apps_quickstart/index.mdx

docs/core_concepts/31_workflows_as_code/index.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import Tabs from '@theme/Tabs';
22
import TabItem from '@theme/TabItem';
33

4-
# Workflows as code
4+
# Workflows as Code
55

6-
![Script in python executing workflow as code ](python_editor.png)
6+
[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-
Flows 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.
8+
![Script in python executing workflow as code](python_editor.png "Script in python executing workflow as code")
99

10-
One way of doing this is to use the API of windmill 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.
10+
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 require to define the different jobs in different scripts. This is why, Windmill supports to define workflows as code in a single script in both Python and Typescript 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

14-
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 allow for the timeline of each task to be displayed in the UI.
14+
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

16-
To have some steps refer to other scripts and flows not in this file, use the normal functions `run_script` from the windmill SDK. The script below is a normal script and does not need special consideration. As such, it will already work with all the features of normal script and can be synced with the git and the CLI.
16+
To have some steps refer to other scripts and flows not in this file, use the normal functions `run_script` from the windmill SDK. The script below is a normal script and does not need special consideration. As such, it will already work with all the features of normal script and can be [synced with the git](../../advanced/11_git_sync/index.mdx) and the [CLI](../../advanced/11_git_sync/cli_sync.mdx).
1717

18-
</TabItem>
18+
<Tabs className="unique-tabs">
1919
<TabItem value="python" label="Python" attributes={{className: "text-xs p-4 !mt-0 !ml-0"}}>
2020

2121
```python

docs/core_concepts/index.mdx

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,51 @@ On top of its editors to build endpoints, flows and apps, Windmill comes with a
77
## Windmill Features
88

99
<div className="grid grid-cols-2 gap-6 mb-4">
10+
<DocCard
11+
title="Architecture"
12+
description="Schema of Windmill architecture"
13+
href="/docs/misc/architecture"
14+
/>
1015
<DocCard
1116
title="Auto-generated UIs"
1217
description="Windmill creates auto-generated user interfaces for scripts and flows based on their parameters."
1318
href="/docs/core_concepts/auto_generated_uis"
1419
/>
15-
<DocCard
16-
title="Windmill AI"
17-
description="Have AI complete code on Windmill."
18-
href="/docs/core_concepts/ai_generation"
19-
/>
2020
<DocCard
2121
title="JSON Schema and Parsing"
2222
description="JSON Schemas are used for defining the input specification for scripts and flows, and specifying resource types."
2323
href="/docs/core_concepts/json_schema_and_parsing"
2424
/>
25+
<DocCard
26+
title="Instant Preview & Testing"
27+
description="Windmill allows users to see and test what they are building directly from the editor, even before deployment."
28+
href="/docs/core_concepts/instant_preview"
29+
/>
2530
<DocCard
2631
title="Dependency Management & Imports"
2732
description="Windmill's strength lies in its ability to run scripts without having to deal with separate dependency files."
2833
href="/docs/advanced/imports"
2934
/>
3035
<DocCard
31-
title="Instant Preview & Testing"
32-
description="Windmill allows users to see and test what they are building directly from the editor, even before deployment."
33-
href="/docs/core_concepts/instant_preview"
36+
title="Workflows as Code"
37+
description="Write a program that defines the jobs and their dependencies, and then execute that program within a script"
38+
href="/docs/core_concepts/workflows_as_code"
39+
/>
40+
<DocCard
41+
title="Draft and Deploy"
42+
description="Develop and cooperate in a structured way."
43+
href="/docs/core_concepts/draft_and_deploy"
3444
/>
3545
<DocCard
3646
title="Persistent Storage"
3747
description="Ensure that your data is safely stored and easily accessible whenever required."
3848
href="/docs/core_concepts/persistent_storage"
3949
/>
50+
<DocCard
51+
title="Data Pipelines"
52+
description="Windmill enables building fast, powerful, reliable, and easy-to-build data pipelines."
53+
href="/docs/core_concepts/data_pipelines"
54+
/>
4055
<DocCard
4156
title="Roles and Permissions"
4257
description="Control access and manage permissions within your instance and workspaces."
@@ -53,20 +68,15 @@ On top of its editors to build endpoints, flows and apps, Windmill comes with a
5368
href="/docs/core_concepts/error_handling"
5469
/>
5570
<DocCard
56-
title="Collaboration in Windmill"
57-
description="Collaboration in Windmill is simplified through various features and workflows."
58-
href="/docs/core_concepts/collaboration"
71+
title="Monitor Past and Future Runs"
72+
description="Get an aggregated view of past and future runs on your workspace."
73+
href="/docs/core_concepts/monitor_past_and_future_runs"
5974
/>
6075
<DocCard
6176
title="Schedules"
6277
description="Scheduling allows you to define schedules for Scripts and Flows, automatically running them at set frequencies."
6378
href="/docs/core_concepts/scheduling"
6479
/>
65-
<DocCard
66-
title="Monitor Past and Future Runs"
67-
description="Get an aggregated view of past and future runs on your workspace."
68-
href="/docs/core_concepts/monitor_past_and_future_runs"
69-
/>
7080
<DocCard
7181
title="Webhooks"
7282
description="Trigger scripts and flows from webhooks."
@@ -93,24 +103,14 @@ On top of its editors to build endpoints, flows and apps, Windmill comes with a
93103
href="/docs/core_concepts/worker_groups"
94104
/>
95105
<DocCard
96-
title="Caching"
97-
description="Caching is used to cache the results of a script, flow, flow step or app inline scripts for a specified number of seconds."
98-
href="/docs/core_concepts/caching"
99-
/>
100-
<DocCard
101-
title="Jobs"
102-
description="A job represents a past, present or future `task` or `work` to be executed by a worker."
103-
href="/docs/core_concepts/jobs"
104-
/>
105-
<DocCard
106106
title="Workspace Secret Encryption"
107107
description="When updating the encryption key of a workspace, all secrets will be re-encrypted with the new key and the previous key will be replaced by the new one."
108108
href="/docs/core_concepts/workspace_secret_encryption"
109109
/>
110110
<DocCard
111-
title="Draft and Deploy"
112-
description="Develop and cooperate in a structured way."
113-
href="/docs/core_concepts/draft_and_deploy"
111+
title="Caching"
112+
description="Caching is used to cache the results of a script, flow, flow step or app inline scripts for a specified number of seconds."
113+
href="/docs/core_concepts/caching"
114114
/>
115115
<DocCard
116116
title="Handling Files and Binary Data"
@@ -122,6 +122,21 @@ On top of its editors to build endpoints, flows and apps, Windmill comes with a
122122
description="The result renderer in Windmill supports rich display rendering, allowing you to customize the display format of your results."
123123
href="/docs/core_concepts/rich_display_rendering"
124124
/>
125+
<DocCard
126+
title="Jobs"
127+
description="A job represents a past, present or future `task` or `work` to be executed by a worker."
128+
href="/docs/core_concepts/jobs"
129+
/>
130+
<DocCard
131+
title="Collaboration in Windmill"
132+
description="Collaboration in Windmill is simplified through various features and workflows."
133+
href="/docs/core_concepts/collaboration"
134+
/>
135+
<DocCard
136+
title="Windmill AI"
137+
description="Have AI complete code on Windmill."
138+
href="/docs/core_concepts/ai_generation"
139+
/>
125140
</div>
126141

127142
## Windmill for Developers

docs/flows/1_flow_editor.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ In Windmill, each step is code with a main function in TypeScript, Python, Go, B
4040
/>
4141
</div>
4242

43-
<br />
43+
<br/>
44+
45+
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.
46+
47+
<div className="grid grid-cols-2 gap-6 mb-4">
48+
<DocCard
49+
title="Workflows as Code"
50+
description="Write a program that defines the jobs and their dependencies, and then execute that program within a script"
51+
href="/docs/core_concepts/workflows_as_code"
52+
/>
53+
</div>
4454

4555
The Flow Editor has the following features which are the subject of specific pages:
4656

0 commit comments

Comments
 (0)