Skip to main content

Interval Trigger

Overview​

The Interval Trigger starts workflow iterations at a fixed, recurring time interval (such as every 5 minutes, 30 seconds, or 1 hour). It operates as a background threaded trigger and can also be executed manually at any time using the canvas controls.

Unlike the Scheduler trigger—which uses calendar-based cron expressions (e.g. "every Monday at 8:00 AM")—the Interval Trigger uses elapsed duration increments (e.g. "every 10 minutes"), making it ideal for cadence-based polling, heartbeats, and frequent synchronization tasks.

Purpose​

Use the Interval Trigger when:

  • A workflow needs to run repeatedly based on a fixed elapsed duration rather than a specific calendar clock time.
  • You are polling APIs, databases, or file locations on a regular cadence (e.g., every 30 seconds or every 5 minutes).
  • You want an optional Initial Delay before the first execution begins when the workflow starts.
  • You want simple duration controls without writing cron expressions.

Interval Trigger vs. Scheduler​

FeatureInterval TriggerScheduler
Schedule DefinitionFixed duration (Days, Hours, Minutes, Seconds)6-field Spring cron expression
Best ForCadence polling, periodic intervals (e.g. every 5 minutes)Calendar milestones (e.g. weekdays at 8 AM, end of month)
Initial DelayConfigurable initial delay before the first executionNext execution determined strictly by cron rule
ComplexitySimple duration pickerRequires cron syntax knowledge

Configuration​

Double-click the Interval Trigger node on the canvas to open its configuration dialog:

FieldRequiredDefaultDescription
IntervalYesPT5M (5 min)The duration between consecutive scheduled iterations. Must be a positive duration (> 0). Configured using days, hours, minutes, and seconds.
Initial delayNoPT0S (0 sec)An optional waiting duration before the first scheduled iteration is fired after the trigger starts or restarts. Must be non-negative (>= 0).

[!NOTE] Durations are configured using intuitive numeric steppers for Days, Hours, Minutes, and Seconds. Alongside the pickers, B2Win Suite displays the standardized ISO-8601 duration format (e.g., PT5M for 5 minutes, PT30S for 30 seconds, PT1H30M for 1 hour 30 minutes, or P1D for 1 day).

Properties​

Each iteration dispatched by the Interval Trigger includes the following workflow runtime properties:

PropertyFlowDataTypeDescription
INTERVAL_TRIGGER_TIMEZonedDateTimeThe timestamp representing the scheduled due time (or current time for manual runs) for this iteration, formatted in the workflow's configured timezone and truncated to seconds.
INTERVAL_TRIGGER_MANUALLYBooleantrue if this iteration was triggered manually by a user; false if triggered automatically on the scheduled interval.

Downstream nodes can reference these properties dynamically using expressions (for example, ${INTERVAL_TRIGGER_TIME} or ${INTERVAL_TRIGGER_MANUALLY}).

Processing Logic​

1. Startup and Revision Tracking​

When workflow execution starts (or when changes to the trigger are saved and the workflow revision increments):

  • The trigger reads the workflow's configured timezone.
  • The configured interval and initialDelay are validated and truncated to whole seconds.
  • State is preserved across restarts via the node's internal value store (intervalLastRunRevision, intervalLastStoredRunTime, intervalNextScheduledRun).
  • First Run Calculation:
    • If Initial delay is greater than 0, the first iteration is scheduled at: $$\text{First Run} = \text{Current Time} + \text{Initial Delay}$$
    • If Initial delay is 0 (or empty), the first iteration is scheduled after one full interval: $$\text{First Run} = \text{Current Time} + \text{Interval}$$
  • The trigger registers its scheduled time with B2Win Suite's runtime (updateNextRun), enabling the live "Next run" countdown displayed in the canvas node and the bottom Triggers panel.

2. Recurring Execution Cadence​

A background thread continually checks the scheduled due time against current time:

  • When the due time arrives or passes, the trigger fires a new iteration.
  • It then calculates and stores the subsequent run time: $$\text{Next Run} = \text{Current Time} + \text{Interval}$$
  • The node updates its status and countdown timer for the next iteration.

3. Expiry Window in Production Mode​

In production mode, if an execution was paused or the server was temporarily unreachable, scheduled runs can fall behind real time.

  • If a due run is delayed past the configured expiry threshold (expireScheduledAfter, backend default of 30 minutes), the trigger skips that run to avoid queuing stale iterations.
  • A warning is recorded in the execution log (e.g. Skipped interval trigger run scheduled for <timestamp> (Delayed: <delay>)).
  • Development mode runs do not skip overdue triggers.

4. Manual Execution​

You can manually run an iteration from the canvas or trigger controls at any time:

  • Manual execution triggers immediately with INTERVAL_TRIGGER_MANUALLY = true and INTERVAL_TRIGGER_TIME set to the exact execution instant.
  • Manual triggers do not disrupt or reset the scheduled recurring interval timeline.

Common Examples​

Frequent API / Database Polling​

  • Interval: 0 Days, 0 Hours, 1 Minute, 0 Seconds (PT1M)
  • Initial delay: 0 Days, 0 Hours, 0 Minutes, 10 Seconds (PT10S)
  • Use Case: Give connected services 10 seconds to initialize on startup, then query an external endpoint every 60 seconds.

High-Frequency Ingestion​

  • Interval: 0 Days, 0 Hours, 0 Minutes, 30 Seconds (PT30S)
  • Initial delay: 0 Days, 0 Hours, 0 Minutes, 0 Seconds (PT0S)
  • Use Case: Poll an incoming message queue or event table every 30 seconds.

Hourly Sync​

  • Interval: 0 Days, 1 Hour, 0 Minutes, 0 Seconds (PT1H)
  • Initial delay: 0 Days, 0 Hours, 0 Minutes, 0 Seconds (PT0S)
  • Use Case: Synchronize records between systems every hour without needing cron syntax.

Notes & Limitations​

  • Output Data: The Interval Trigger outputs an EmptyData payload (no files or dataframes). Connect a Source node (such as Query, Read File, or Invoke OpenAPI) downstream to ingest data into the workflow.
  • On / Off Toggle: Like all B2Win Suite triggers, you can turn the trigger ON or OFF directly from the toggle switch on the canvas or from the Triggers tab in the bottom bar without altering the workflow structure.
  • Timezone: The trigger calculates due timestamps according to the timezone specified in the workflow's settings.
  • Single Iteration Concurrency: By default, the node runs with maxActiveIterations = 1, ensuring the previous iteration has finished before the next scheduled iteration begins if sequential execution is desired.
  • Checking Frequency: How often the trigger checks whether it is time to run is set by the trigger scheduler settings in the workflow's Execution Configuration. With Trigger scheduler backoff turned on, a run can start up to the Trigger scheduler max interval late. If the max interval is longer than the expiry window, a run can be skipped.