Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,8 @@
"pages": [
"workflow/features/flow-control",
"workflow/features/flow-control/rate-period",
"workflow/features/flow-control/parallelism"
"workflow/features/flow-control/parallelism",
"workflow/features/flow-control/monitor"
]
},
{
Expand Down
Binary file added img/qstash/flowcontrol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion qstash/api/flow-control/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authMethod: "bearer"
</ResponseField>

<ResponseField name="waitListSize" type="integer">
The number of messages in the wait list that waits for `parallelism` set in the flow control.
The number of messages in the wait list that waits for `parallelism`/`rate` set in the flow control.
</ResponseField>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion qstash/api/flow-control/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authMethod: "bearer"
</ResponseField>

<ResponseField name="waitListSize" type="integer">
The number of messages in the wait list that waits for `parallelism` set in the flow control.
The number of messages in the wait list that waits for `parallelism`/`rate` set in the flow control.
</ResponseField>
</Expandable>
</ResponseField>
Expand Down
16 changes: 14 additions & 2 deletions qstash/features/flowcontrol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ curl -XPOST -H 'Authorization: Bearer XXX' \
You can also use the Rest API to get information how many messages waiting for parallelism limit.
See the [API documentation](/qstash/api/flow-control/get) for more details.

### Rate, Parallelism, and Period Together
## Rate, Parallelism, and Period Together

All three parameters can be combined. For example, with a rate of 10 per minute, parallelism of 20, and a period of 1 minute, QStash will trigger 10 calls in the first minute and another 10 in the next. Since none of them will have finished, the system will wait until one completes before triggering another.

Expand All @@ -99,4 +99,16 @@ curl -XPOST -H 'Authorization: Bearer XXX' \
'https://qstash.upstash.io/v2/publish/https://example.com' \
-d '{"message":"Hello, World!"}'
```
</CodeGroup>
</CodeGroup>

## Monitor

You can monitor wait list size of your flow control key's from the console `FlowControl` tab.

<Frame>
<img src="/img/qstash/flowcontrol.png" />
</Frame>

Also you can get the same info using the REST API.
- [List All Flow Control Keys](/qstash/api/flow-control/list).
- [Single Flow Control Key](/qstash/api/flow-control/get).
14 changes: 14 additions & 0 deletions workflow/features/flow-control/monitor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Monitoring"
---

You can monitor wait list size of your flow control key's from the console `FlowControl` tab.

<Frame>
<img src="/img/qstash/flowcontrol.png" />
</Frame>

Also you can get the same info using the REST API.
- [List All Flow Control Keys](/workflow/rest/flow-control/list).
- [Single Flow Control Key](/workflow/rest/flow-control/get).

31 changes: 0 additions & 31 deletions workflow/features/flow-control/parallelism.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,3 @@ The step in the waitlist will wait for a step to complete and hand off it's toke
<Frame caption="A failing step is automatically retried three times">
<img src="/img/workflow/parallelism_3.png" />
</Frame>

## Monitoring

You can monitor wait list size of your flow control key's using the REST API.

<CodeGroup>

```bash Single Flow Control Key
curl -X GET https://qstash.upstash.io/v2/flowControl/YOUR_FLOW_CONTROL_KEY \
-H "Authorization: Bearer <token>"
```

```bash List All Flow Control Keys
curl -X GET https://qstash.upstash.io/v2/flowControl/ \
-H "Authorization: Bearer <token>"
```
</CodeGroup>

It will return the wait list size. In case you request all flow-control keys, it is an array response.

<ResponseField name="flowControlKey" type="string">
The identifier for your flow control configuration
</ResponseField>

<ResponseField name="waitListSize" type="number">
Number of steps waiting to be executed due to parallelism limits
</ResponseField>

<Info>
Adding a dashboard to list and manage flow control key's is on our roadmap.
</Info>
2 changes: 1 addition & 1 deletion workflow/rest/flow-control/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authMethod: "bearer"
</ResponseField>

<ResponseField name="waitListSize" type="integer">
The number of messages in the wait list that waits for `parallelism` set in the flow control.
The number of messages in the wait list that waits for `parallelism`/`rate` set in the flow control.
</ResponseField>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion workflow/rest/flow-control/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authMethod: "bearer"
</ResponseField>

<ResponseField name="waitListSize" type="integer">
The number of messages in the wait list that waits for `parallelism` set in the flow control.
The number of messages in the wait list that waits for `parallelism`/`rate` set in the flow control.
</ResponseField>
</Expandable>
</ResponseField>
Expand Down