Skip to content

Commit 233c18e

Browse files
authored
Approval steps refresh + Hub examples (#1051)
1 parent fe544d9 commit 233c18e

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed
298 KB
Loading

docs/flows/11_flow_approval.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@ import TabItem from '@theme/TabItem';
77
Flows can be suspended until resumed or canceled event(s) are received. This
88
feature is most useful for implementing approval steps.
99

10-
<video
11-
className="border-2 rounded-lg object-cover w-full h-full dark:border-gray-800"
12-
autoPlay
13-
controls
14-
id="main-video"
15-
src="/videos/flow-approval.mp4"
16-
/>
10+
![Approval step diagram](../assets/flows/approval_diagram.png 'Approval step diagram')
1711

18-
<br />
19-
20-
An approval step will suspend the execution of a flow until it has been approved
21-
through the resume endpoints or the approval page by and solely by the recipients of
22-
the secret urls.
12+
An approval step is a normal script with the **Suspend** option enabled in the step's advanced settings. This will suspend the execution of a flow until it has been approved through the resume endpoints or the approval page by and solely by the recipients of the secret URLs.
2313

2414
:::info Suspending a flow in Windmill
2515

@@ -37,7 +27,7 @@ An event can be:
3727
- a cancel
3828
- a pre-set number of approval that is met.
3929

40-
The approval steps are received in the form of an HTTP request. For each event, a single URL is generated. It is not unique to each user to whom it is sent.
30+
The approval step generates a unique URL for each required approval using `wmill.getResumeUrls()` (or `wmill.get_resume_urls()` in [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx)). The approval step works like a webhook mechanism - the flow remains suspended until the required number of approval events are received via HTTP requests to these generated URLs. Each approval event is an HTTP request to one of these URLs, which then resumes or cancels the flow execution.
4131

4232
<div className="grid grid-cols-2 gap-6 mb-4">
4333
<DocCard
@@ -48,6 +38,16 @@ The approval steps are received in the form of an HTTP request. For each event,
4838
/>
4939
</div>
5040

41+
<video
42+
className="border-2 rounded-lg object-cover w-full h-full dark:border-gray-800"
43+
autoPlay
44+
controls
45+
id="main-video"
46+
src="/videos/flow-approval.mp4"
47+
/>
48+
49+
<br />
50+
5151
## Add approval script
5252

5353
You can think of a scenario where only specific people can resume or cancel a
@@ -67,6 +67,8 @@ Use `wmill.getResumeUrls()` in [TypeScript](../getting_started/0_scripts_quickst
6767
The number of required approvals can be customized.
6868
This allows flexibility and security for cases where you either require approvals from all authorized people or only from one.
6969

70+
**Important**: The flow will remain suspended and will not proceed to the next step until the exact number of required approval events is received. If fewer approvals than required are received, the flow stays suspended indefinitely (unless a timeout is configured).
71+
7072
![Required approvals](../assets/flows/flow-number-of-approvals.png 'Required approvals')
7173

7274
Note that approval steps can be applied the same configurations as regular steps ([Retries](./14_retries.md), [Early stop/Break](./2_early_stop.md) or [Suspend](./15_sleep.md)).

docs/getting_started/6_flows_quickstart/index.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,7 @@ At each step you can add [Approval scripts](../../flows/11_flow_approval.mdx) to
220220

221221
Request approvals can be sent by email, Slack, anything. Then you can automatically resume workflows with secret webhooks after the approval steps.
222222

223-
<video
224-
className="border-2 rounded-lg object-cover w-full h-full dark:border-gray-800"
225-
autoPlay
226-
controls
227-
src="/videos/flow-approval.mp4"
228-
/>
223+
![Approval step diagram](../../assets/flows/approval_diagram.png 'Approval step diagram')
229224

230225
<br />
231226

src/pages/flows.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const hubExamples = [
3333
</div>
3434
),
3535

36-
link: 'https://hub.windmill.dev/scripts/github/768/create-issue-github'
36+
link: 'https://hub.windmill.dev/flows/70/when-new-expenses-are-uploaded-to-google-drive%2C-extract-text-using-tesseract-and-notify-on-slack'
3737
},
3838
{
3939
title: (
@@ -46,7 +46,7 @@ const hubExamples = [
4646
<span className="px-2 py-0.5 rounded-md bg-green-800 text-white">Airtable</span> database.
4747
</div>
4848
),
49-
link: 'https://hub.windmill.dev/flows/47/insert-zendesk-articles-into-supabase-with-openaiembedings'
49+
link: 'https://hub.windmill.dev/flows/71/retrieve-articles-from-google-drive-%2C-use-a-for-loop-to-translate-each-one-with-openai-and-store-the-embeddings-in-a-airtable-database'
5050
}
5151
];
5252

0 commit comments

Comments
 (0)