Skip to content

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.

You can safely modify these runtime options without creating a new flow version:

OptionDescriptionDefaultScope
opt_max_attemptsMax retry attempts3Flow & Steps
opt_base_delayBase retry delay (seconds)1Flow only
opt_timeoutMax execution time (seconds)60Flow & Steps

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

Since the compiler doesn’t support updating existing flows, you must manually update options in the database:

UPDATE pgflow.flows
SET opt_max_attempts = 5, opt_timeout = 10, opt_base_delay = 2
WHERE flow_slug = 'your_flow_slug';
UPDATE pgflow.steps
SET opt_max_attempts = 3, opt_timeout = 30
WHERE flow_slug = 'your_flow_slug' AND step_slug = 'your_step_slug';
-- Check current settings
SELECT step_slug, opt_max_attempts FROM pgflow.steps WHERE flow_slug = 'analyze_website';
-- Update API call step to retry more
UPDATE pgflow.steps SET opt_max_attempts = 5
WHERE flow_slug = 'analyze_website' AND step_slug = 'website';