Widgets/Logic

Skip Events Widget

Skip Events Widget

A "Logic" type widget. Skip Events Widget controls the flow of data by allowing events to pass through intermittently.
It works as a configurable event filtering mechanism that can skip a specified number of events before letting one through, making it perfect for creating patterns or reducing the frequency of events in your workflow.

 

Inputs

  • in (DataType: Anything) The main input port that receives events. The Skip Events widget will count these events and only let them pass through based on the configured skip count.

  • reset (DataType: Anything) Resets the internal event counter to zero. Any data type can trigger the reset.


Outputs

  • out (DataType: Same as input) Outputs the event data when the skip count condition is met. The output maintains the same data type as the input.

  • skipped (DataType: Dynamically inferred) Outputs the event data when the event is being skipped (before the skip count condition is met). The data type is dynamically inferred from the actual data being processed, providing better type safety.


Custom Settings

  • Skip Count — Configure how many events to skip before letting one through. For example, if set to 1 (default), every second event will pass through.

Skip Count Setting

 

📌 Important Notes

  • The skip count starts from 0, so a skip count of 1 means every second event passes through
  • Setting skip count to 0 allows all events to pass through (no events will be sent to the "skipped" port)

 

Examples

Basic Toggle Pattern

This example shows how to use the Skip Events Widget to create an alternating pattern


Drag the example onto the workspace to explore and experiment!



In this example

  1. The Clock widget sends events every second
  2. The Skip Events widget is configured to skip 1 event (default)
  3. The Counter widget increases its count when events pass through
  4. Result: The counter updates every other second

 

Skip Text Event

This example demonstrates how to control text message flow using skip events:


Drag the example onto the workspace to explore and experiment!



In this example

  1. The Button widget triggers events with a text message
  2. The Skip Events widget is configured to skip 2 events
  3. The Text widget displays "Button clicked!" every third click
  4. Result: The message appears only after every third button click

 

Handling Skipped Events

This example shows how to use the new "skipped" output port to handle events that are being filtered out:


Drag the example onto the workspace to explore and experiment!



In this example

  1. The Clock widget generates events every second
  2. The Skip Events widget is configured with a skip count of 2, meaning every third event passes through
  3. Events that pass through are routed to the "out" port, connected to the first Counter widget
  4. Events that are filtered out are routed to the "skipped" port, connected to the second Counter widget
  5. Result: The first counter increments every third second, while the second counter increments twice for each passed event

 

📌 Additional Notes

  • The Skip Events widget preserves the data type of the input when passing it to both outputs
  • The "skipped" port provides dynamic type inference based on the actual data being processed
  • The reset input can be used at any time to restart the skip count
  • The Skip Events widget maintains its skip count until explicitly reset or the recipe is reloaded
  • Both "out" and "skipped" ports forward the complete event data, maintaining all properties including timestamps

 

Glossary

  • Skip Count

    The number of events to skip before allowing one event to pass through. A skip count of 1 means every second event passes through, a skip count of 2 means every third event passes through, and so on.

  • Dynamic Type Inference

    The automatic detection and preservation of data types as they flow through the widget. The Skip Events widget maintains the same data type for both the "out" and "skipped" ports based on the actual data being processed.

  • Event Filtering

    The process of selectively allowing or blocking events based on configurable criteria. The Skip Events widget filters events by counting them and only allowing passage when the skip count condition is met.