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
31 changes: 16 additions & 15 deletions docs/core_concepts/22_job_debouncing/index.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# Job debouncing

Job debouncing prevents redundant job executions by canceling pending jobs with identical characteristics when new ones are submitted within a specified time window. This feature helps optimize resource usage and prevents unnecessary duplicate computations.
When job debouncing is enabled, started jobs are scheduled for a specified future time. If another job with the same debounce key is queued within this duration, it will "debounce" the previous job by canceling it.

Job debouncing is a [Cloud plans and Pro Enterprise Self-Hosted](/pricing) only.
Job debouncing is a [Cloud plans and Pro Enterprise Self-Hosted](/pricing) only feature.

Debouncing can be set from the Settings menu. When jobs with matching characteristics are submitted within the debounce window, pending jobs are automatically canceled in favor of the newest one.
It is available for scripts and flows and can be set from the Settings menu. It also operates globally and involves several configuration fields:

The Job debouncing operates globally and across flow runs. It involves two key parameters:
## Configuration fields

## Debounce delay in seconds
### Debounce delay in seconds

Set in seconds, the time window defines the period during which duplicate jobs are canceled. When a new job arrives within this window with matching characteristics, any pending jobs are canceled.
The time window in seconds for debouncing. If not set, the job will not debounce existing jobs and will not be cancelled by any other job.

## Custom debounce key
### Custom debounce key

This parameter is optional. Debounce keys are global, you can have them be workspace specific using the variable `$workspace`. You can also use an argument's value using `$args[name_of_arg]`.
Optional field to create debounce keys that are not bound to path and arguments. If not set, the default debounce key is used, which is composed of workspace ID, runnable path, and argument values passed to it.

## Dependency jobs
Debouncing keys are global, you can have them be workspace specific using the variable `$workspace`. You can also use an argument's value using `$args[name_of_arg]`.

For dependency jobs, debouncing is enabled by default. This prevents redundant dependency computations when multiple jobs require the same dependencies.
### Max total debouncing time

## Job debouncing in Script & Flows
How long (in seconds) a job can be debounced by the same key. If exceeded, new jobs with the same key will not debounce existing jobs and let them execute, while still scheduling themselves for future execution.

### Job debouncing of a script
### Max total debounces amount

[Job debouncing of a script](../../script_editor/settings.mdx#debouncing) can be set from the [Settings](../../script_editor/settings.mdx) menu. Pick "Runtime" and then "Debouncing" and define a time window and optionally a custom debounce key.
Same as previous one, but counts debounces instead of time.

### Job debouncing of a flow
### Debounce args to accumulate

This field allows you to consolidate arguments across debounced jobs. If one of your main function arguments takes an array of any type, you can specify this argument in this parameter. This will exclude it from the default debounce key and when the job executes, it will concatenate all values of the specified argument from previous jobs related to this debouncing period.

From the Flow Settings Advanced menu, pick "Debouncing" and define a time window and optionally a custom debounce key.
2 changes: 1 addition & 1 deletion docs/flows/1_flow_editor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The Flow editor has the following features which are the subject of specific pag
color="teal"
title="Job debouncing"
description="Job debouncing prevents redundant job executions by canceling pending jobs with identical characteristics."
href="/docs/flows/job_debouncing"
href="/docs/core_concepts/job_debouncing"
/>
<DocCard
color="teal"
Expand Down
30 changes: 0 additions & 30 deletions docs/flows/23_job_debouncing.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions docs/script_editor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ The Script editor is made of the following features:
description="The Concurrency limit feature allows you to define concurrency limits for scripts and inline scripts within flows."
href="/docs/script_editor/concurrency_limit"
/>
<DocCard
title="Job debouncing"
description="Job debouncing prevents redundant job executions by canceling pending jobs with identical characteristics."
href="/docs/core_concepts/job_debouncing"
/>
<DocCard
title="Running services with perpetual scripts"
description="Perpetual scripts restart upon ending unless canceled."
Expand Down
21 changes: 0 additions & 21 deletions docs/script_editor/job_debouncing.mdx

This file was deleted.

2 changes: 0 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ const sidebars = {
'script_editor/script_kinds',
'script_editor/customize_ui',
'script_editor/concurrency_limit',
'script_editor/job_debouncing',
'script_editor/perpetual_scripts',
'script_editor/custom_environment_variables',
'script_editor/multiplayer',
Expand Down Expand Up @@ -748,7 +747,6 @@ const sidebars = {
'flows/flow_trigger',
'flows/retries',
'flows/concurrency_limit',
'flows/job_debouncing',
'flows/custom_timeout',
'flows/priority',
'flows/lifetime',
Expand Down