Skip to content

CLI: schedules commands never run workflow discovery — schedules create always fails 'not found in registry' #555

Description

@LivinTribunal

Severity: P2 — schedules create is unusable from the CLI: the workflow registry is never populated.

Root cause

The schedules command group never runs workflow discovery: cli/commands/schedules.py contains no discover call, and the group callback (cli/__init__.py:55-111) doesn't discover either. Only worker, scheduler, and workflows commands do (e.g. workflows.py:919). create_schedule then hits its registry existence check (primitives/schedule.py:~101-104) with an empty registry and always aborts.

Executed evidence (v0.3.8)

Module myworkflows.py defining a trivial @workflow my_wf:

$ pyworkflow --module myworkflows schedules create my_wf --cron '*/5 * * * *'
✗ Workflow 'my_wf' not found in registry     (exit 1)

$ pyworkflow --module myworkflows workflows list
my_wf                                        (exit 0)

Same --module, same process env — workflows list sees the workflow, schedules create never can.

Suggested fix

Call discover_workflows in the schedules group (or in the shared group callback) the same way workflows/worker/scheduler do.

Side effect worth noting: because the registry check fires first, CLI users can never even reach cron validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions