Skip to content

qruise flow serve

Serve a flow from the current Python environment.

Syntax

qruise flow serve [OPTIONS]

Description

The qruise flow serve command builds a Prefect deployment and keeps a local serving process running for it. This is useful when you want scheduled or dashboard-triggered runs to execute in the current environment, for example while developing a flow or testing dependencies that are not yet part of a deployed image.

The served deployment is registered in QruiseOS and appears on the dashboard deployment pages. The process must stay running for scheduled and manually triggered runs to execute. If the terminal process or Jupyter container stops, the served deployment stops accepting work until you run qruise flow serve again.

For production deployments that should run on the QruiseOS infrastructure without a local serving process, use qruise flow deploy.

Options

Option

Description

-f, --flow-file

Path of the flow definition file to serve.

Default: qruise-flow.yaml.

-b, --branch

The knowledge base branch to be used by served flow runs. Can also be set using the QRUISE_FLOW_DEFAULT_INTEGRATION_BRANCH env variable.

-m, --no-merge

If specified, served flow run results will not be merged to the integration branch.

-q, --qubits

Limit served runs to only specified qubits. Must have the list format.

--flags

Specify default flags to be used in served flow runs. Must have the list format.

-p, --profile

Qruise profile to use for served flow runs.

-s, --start

Execute only notebooks with ordinal numbers greater than or equal to the number specified.

-e, --end

Execute only notebooks with ordinal numbers less than or equal to the number specified.

-c, --concurrency

Specify maximum number of tasks executing in parallel.

Default: 4.

-i, --interval

Interval at which the served flow should run. Cannot be specified at the same time as --schedule.

--schedule

Schedule on which the served flow should run, in a cron-like format. Cannot be specified at the same time as --interval.

-z, --time-zone

Specify time zone for the cron schedule. If specified, --schedule must also be provided.

Default: UTC

--prepare

Prepare the served flow but do not start serving it. Use for testing.

--no-clean-up

Keep the generated build directory after the command finishes.

-x, --inplace

Prepare the flow in the same directory and do not copy it. Cannot be specified at the same time as --output-dir.

-o, --output-dir

Path of the build directory where qruise prepares the served flow. Cannot be specified at the same time as --inplace.

Default: .qruise/build/<DATE_TIME>.

--help

Show a help message and exit.

Environment variables

Variable Description
QRUISE_FLOW_DEFAULT_INTEGRATION_BRANCH Default knowledge base branch to be used by the flow. See --branch.
QRUISE_FLOW_SKIP_MERGE If set to True, results will not be merged by default. See --no-merge.
QRUISE_FLOW_CRON_SCHEDULE Default cron schedule. Cannot be set together with QRUISE_FLOW_INTERVAL_SCHEDULE.
QRUISE_FLOW_INTERVAL_SCHEDULE Default interval schedule. Cannot be set together with QRUISE_FLOW_CRON_SCHEDULE.

Examples

Serve a flow for manual dashboard runs

qruise flow serve --flow-file $HOME/flows/my-flow.yaml

This registers a served deployment in QruiseOS and waits for run requests. You can trigger the deployment from the dashboard or with qruise flow deployment run.

Serve a scheduled flow

qruise flow serve --flow-file $HOME/flows/my-flow.yaml --schedule "0 1 * * *" --time-zone Europe/Berlin

This keeps a local serving process active and runs the flow every day at 1:00 in the Europe/Berlin time zone while the process remains running.

Override served run defaults

qruise flow serve --flow-file ./my-flow.yaml --qubits Q1,Q4 --start 15 --end 75

The deployment uses these values as defaults. Manual runs can still override supported parameters when triggered from the CLI or dashboard.