Update Flow Options
Flow definitions in pgflow are fundamentally immutable in structure. For structural changes like adding steps or changing dependencies, create a new flow version instead (see Version Your Flows). This guide focuses only on runtime configuration options you can safely update.
Updatable Options
Section titled “Updatable Options”You can safely modify these runtime options without creating a new flow version:
Option | Description | Default | Scope |
---|---|---|---|
opt_max_attempts | Max retry attempts | 3 | Flow & Steps |
opt_base_delay | Base retry delay (seconds) | 1 | Flow only |
opt_timeout | Max execution time (seconds) | 60 | Flow & Steps |
Configuration System
Section titled “Configuration System”pgflow uses a two-level configuration approach:
- Flow-level options: Set defaults for all steps in the flow
- Step-level options: Override flow defaults for specific steps
Updating Options Manually
Section titled “Updating Options Manually”Since the compiler doesn’t support updating existing flows, you must manually update options in the database:
Flow Level (Affects All Steps)
Section titled “Flow Level (Affects All Steps)”UPDATE pgflow.flowsSET opt_max_attempts = 5, opt_timeout = 10, opt_base_delay = 2WHERE flow_slug = 'your_flow_slug';
Step Level (Overrides Flow Defaults)
Section titled “Step Level (Overrides Flow Defaults)”UPDATE pgflow.stepsSET opt_max_attempts = 3, opt_timeout = 30WHERE flow_slug = 'your_flow_slug' AND step_slug = 'your_step_slug';
Example: Increasing Retries for API Calls
Section titled “Example: Increasing Retries for API Calls”-- Check current settingsSELECT step_slug, opt_max_attempts FROM pgflow.steps WHERE flow_slug = 'analyze_website';
-- Update API call step to retry moreUPDATE pgflow.steps SET opt_max_attempts = 5WHERE flow_slug = 'analyze_website' AND step_slug = 'website';