Runtime Execution — From Workflow to Run

The Run button creates/updates a runtime snapshot derived from the workflow, which your backend uses to perform scraping.

Derivation flow

  1. UI reads current workflow via SettingsStore
  2. getRuntimeDataFromWorkflow() extracts runtime fields and deep-copies aiConfig
  3. UI validates subreddits/flairs are selected
  4. Snapshot is written to users/{uid}/workflows/{workflowId}/runtime/current

Runtime document

Contains the effective runtime config:

  • Subreddits and selected flairs
  • Window and cadence fields
  • Comment collection config
  • AI configuration snapshot

The runtime doc is the single source of truth for an individual run; it’s intentionally duplicated from the workflow.

Error handling

  • UI blocks run when no subreddits/flairs are selected
  • Errors are surfaced with friendly messages and enhanced context

Next steps

  • Use the runtime doc to kick off the scraping loop
  • Optionally log results with Node Focus to analyze thresholds and model usage