Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

[Design] Task scheduling system — internal scheduler vs external scheduler gateway #14

Closed

Description

@tercel

Context

In v0.14.0, we added a complete task scheduling system with six schedule types (once, interval, cron, daily, weekly, monthly). A key design decision was supporting both internal and external schedulers.

Dual-Mode Design

Internal Scheduler (InternalScheduler)

  • Built-in asyncio-based scheduler for standalone deployments
  • Configurable poll interval, max concurrent tasks, task timeout, user filtering
  • Lifecycle management: start, stop, pause, resume
  • Auto-generates admin JWT for API access
  • Best for: single-node deployments, development, simple production setups
  • CLI: apflow scheduler start/stop/status/trigger

External Scheduler Gateway (WebhookGateway)

  • HTTP webhook integration for enterprise schedulers
  • HMAC signature validation, IP filtering, rate limiting
  • Helper functions for generating cron entries and Kubernetes CronJob manifests
  • Best for: Kubernetes deployments, existing scheduler infrastructure (cron, Temporal, APScheduler)
  • REST endpoint: POST /webhook/trigger/{task_id}
  • JSON-RPC: tasks.webhook.trigger

Calendar Integration (ICalExporter)

  • Export scheduled tasks as iCalendar format
  • RRULE support for recurring events
  • Subscribe in Google Calendar, Outlook, etc.
  • API: tasks.scheduled.export-ical
  • CLI: apflow scheduler export-ical

Why Both?

Small teams want zero-config scheduling (internal). Enterprise teams already have Kubernetes CronJobs or Temporal (external gateway). Supporting both means apflow fits into any deployment model without forcing infrastructure decisions.

Activity

  1. added
    documentation
    architecture
    on Feb 20, 2026
  2. tercel commented on Feb 20, 2026

    @tercel
    ContributorAuthor

    Archived: This issue documents a past design decision for reference.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    architecturedocumentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions