Reddit Loop Configuration — Workflows

Configure how your workflow scrapes Reddit: loop type, cadence, windows, and limits.

These fields live in the workflow document and are surfaced in workflow.html via WorkflowUI with real-time sync through SettingsStore.

Core fields

  • runtimeType: finite or infinite
  • finiteDuration: Minutes to run when runtimeType = finite
  • secondsBetweenScrapes: Delay between iterations
  • postAgeWindow: Maximum post age to consider (hours)
  • postQuantity: Upper bound of posts to collect per loop

Subreddits scope

  • Configure subreddits under subreddits.{name}.selected
  • Configure flairs under subreddits.{name}.flairs.{flairName} with:
    • selected: include in scraping
    • analysis: include in AI analysis

Change detection and saving

The UI uses a unified change detection pipeline:

  • WorkflowUI.extractFormData() collects the current form state
  • SettingsStore.detectChanges(currentFormData) computes a diff
  • Only changed dot-paths are sent to Firestore via updateDoc

Subreddit and flair changes are mapped to dot paths (e.g., subreddits.technology.flairs.Discussion.selected).

Running a loop

  1. Configure runtime fields and subreddits/flairs
  2. Click Run Workflow
  3. The UI writes a runtime snapshot (runtime/current) derived from the workflow

Runtime snapshot (derived)

The runtime document contains:

  • subreddits (selected subset)
  • postAgeWindow, postQuantity, runtimeType, secondsBetweenScrapes, finiteDuration
  • comments (include settings)
  • aiConfig (deep-copied)

Best practices

  • Use finite for test runs and validation
  • Tune secondsBetweenScrapes to balance freshness vs API limits
  • Start narrow (few subreddits/flairs) and expand after validation