# Conditional Logic

The conditional logic provides an additional layer of granular control over the combined conditions criteria that should be met for the execution of the Lit Action. The Lit Action execution can be tailored to respond to varying situations, such as when a certain threshold has been exceeded or a specific condition has been satisfied, and the conditions can be checked according to a specified time interval.

{% hint style="info" %}
The default condition logic is set with type `EVERY` and no interval (i.e. continuous monitoring).
{% endhint %}

{% hint style="warning" %}
Keep in mind, if you've configured a `WebhookCondition` or `ContractCondition` with a very low interval, there's a possibility that your requests will get rejected due to rate limiting constraints from your provider or the endpoint that you're calling.
{% endhint %}

{% code overflow="wrap" fullWidth="true" %}

```typescript
newCircuit.setConditionalLogic({
    type: "TARGET",
    targetCondition: "1",
    interval: 120000 // milliseconds, Circuit loop called every two minutes
})
```

{% endcode %}

**Conditional Logic Parameters:**

<pre class="language-typescript" data-overflow="wrap" data-full-width="true"><code class="lang-typescript"><strong>/* The type of the conditional logic. It can be "THRESHOLD", "TARGET", or "EVERY.*/
</strong><strong>type: "THRESHOLD" | "TARGET" | "EVERY".
</strong><strong>
</strong><strong>/* Used when the type is "THRESHOLD". It's the threshold number of conditions that 
</strong><strong>    must have passed in order for the Lit Action to run.*/
</strong><strong>value?: number;
</strong>
/* Used when the type is "TARGET". It's the specific Condition Id (In order of Conditions Added to Array starting from id "1") that must be met in order for the Lit Action to run.*/
targetCondition?: string;

/* Optional. It's the frequency of condition checks. If omitted, the condition is checked 
    every 30 minutes (1,800,000 ms). Resolves in milliseconds.*/
interval?: number;
</code></pre>
