Skip to main content
Metaflow flows can be started by a time-based schedule or by an event published from another flow. The decorators below are project-aware variants that register the schedule or trigger under the current project and branch. Apply different schedules depending on which branch the flow is deployed to. If the branch doesn’t match any pattern, no schedule is applied (the decorator is a no-op). This wraps Metaflow’s @schedule with branch-aware routing: production can run on a tight cron while staging runs daily and feature branches get no schedule at all.
Each schedule spec is a dict with keys matching Metaflow’s @schedule parameters:

Behavior

  • Patterns are matched using fnmatch glob syntax (e.g., release/* matches release/v2)
  • First matching pattern wins (dict insertion order), so place more specific patterns first
  • If no pattern matches the deployed branch, no schedule is created
  • Cannot be combined with an explicit @schedule decorator on the same flow
Subscribe a flow to project events published by other flows via prj.publish_event():
The decorator resolves the full event name (prj.{project}.{branch}.{event}) from project config, so triggers are automatically scoped to the same branch.