Skip to content

feat: RequeueAtSignal #587

Description

@NiveditJain

For many workflows which are time sensitive, requesting functionality to specify an absolute RequeueAt time instead of only relative delays.

Motivation

  1. Time-sensitive workflows – Many workflows need to execute at specific absolute times (e.g., "run at 3:00 PM EST", "execute at market open", "process at end of business day").
  2. Scheduled operations – Relative delays (ReQueueAfterSignal) are insufficient when the exact execution time matters, especially across time zones or when workflows are created hours/days in advance.
  3. Precision scheduling – Absolute timestamps eliminate drift from relative delay calculations and ensure consistent execution times.

Current State

What Exists

Component Location Purpose
ReQueueAfterSignal python-sdk/exospherehost/signals.py Relative delay requeue (timedelta)
re_queue_after_signal state-manager/app/controller/re_queue_after_signal.py Backend handler for relative delays
enqueue_after field state-manager/app/models/db/state.py Timestamp (ms) when state should be enqueued

Current Limitations

  • ReQueueAfterSignal only accepts timedelta (relative delay)
  • Must calculate relative delay from current time to target time
  • Prone to timing errors if calculation happens at wrong moment
  • No direct way to specify "requeue at 2025-01-15 14:30:00 UTC"

Proposed Solution

New Signal: RequeueAtSignal

Add a new signal class that accepts an absolute timestamp (datetime) instead of a relative delay.

from exospherehost import RequeueAtSignal
from datetime import datetime, timezone

# Requeue at a specific absolute time
target_time = datetime(2025, 1, 15, 14, 30, 0, tzinfo=timezone.utc)
raise RequeueAtSignal(target_time)

Key Features

  1. Absolute timestamp support – Accept datetime objects with timezone awareness
  2. Backward compatibility – Keep ReQueueAfterSignal unchanged
  3. Validation – Ensure timestamp is in the future
  4. Timezone handling – Support timezone-aware datetimes, convert to UTC internally

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions