# throttle

`throttle` controls the *rate* of execution of actions based on a time, the frequency of invocation does not affect how frequent It makes the actions wait until nothing is happening.

This action is based on <https://lodash.com/docs/4.17.15#throttle>

Actions that follow the throttle action will be queued until the wait time expires and there is no namedAction key.

| Key                 | Type         | Description                                                                                              |
| ------------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| action              | `"throttle"` | Action Name                                                                                              |
| options.name        | *string*     | { optional } This key is needed when you have multiple debounce or throttle actions in your application. |
| options.wait        | *number*     | time in mS to wait                                                                                       |
| options.leading     | boolean      | { optional } default to false, if true, the first invocation of the action will cause it to fire.        |
| options.trailing    | *boolean*    | { optional } defaults to true, if true the action will be invoked when the time out period has expired.  |
| options.namedAction | *string*     | { optional } If supplied the named Action that is passed with be executed when the action triggers.      |

```yaml
// example throttle action object
{
  "action": "throttle",
  "options": {
    "name": "myThrottle1",
    "leading": true,
    "trailing": false,
    "wait": 10000
  }
},{ 
   ... more actions
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/reference/actions-processor/actions_overview/throttle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
