orbitra.flows.client
Functions
get_flows_client
environment: The environment to get the API URL from. Defaults to None, which resolves it from the Orbitra settings sources.
- An authenticated OrbitraFlowsClient instance.
Classes
OrbitraFlowsClient
A wrapper around SyncPrefectClient for interacting with Orbitra Flows.
Methods:
api_url
get_deployment_runs
run_deployment.
Args:
deployment: The callable decorated with @orbitra_deployment.orbitra_flows_name_suffix: Suffix appended to the flow name. When omitted, reads from ClientSettings.orbitra_flows_name_suffix, and falls back to no suffix when that is unset too.orbitra_flows_deployment_suffix: Suffix appended to the deployment name. When omitted, reads from ClientSettings.orbitra_flows_deployment_suffix, and falls back to no suffix when that is unset too.limit: Maximum number of flow runs to return, from 1 to 100. Defaults to 10.offset: Number of flow runs to skip, for pagination. Defaults to 0.state_types: Only return runs in one of these states. Defaults to None (any state).start_time: Only return runs that started at or after this time. A naive datetime is read as UTC. Defaults to None (no lower bound).end_time: Only return runs that started at or before this time, so a run still going counts by when it started. A naive datetime is read as UTC. Defaults to None (no upper bound).sort: The order of the returned runs. Defaults to FlowRunSort.START_TIME_DESC (most recent first).
- list[FlowRunInfo]: The deployment’s flow runs. Empty if it has none.
ValueError: Iflimitis outside 1..100 oroffsetis negative.FlowsError: If the deployment does not exist.
get_deployment_runs_by_name
deployment_name: The name of the deployment in the format <FLOW_NAME>/<DEPLOYMENT_NAME>.limit: Maximum number of flow runs to return, from 1 to 100. Defaults to 10.offset: Number of flow runs to skip, for pagination. Defaults to 0.state_types: Only return runs in one of these states. Defaults to None (any state).start_time: Only return runs that started at or after this time. A naive datetime is read as UTC. Defaults to None (no lower bound).end_time: Only return runs that started at or before this time, so a run still going counts by when it started. A naive datetime is read as UTC. Defaults to None (no upper bound).sort: The order of the returned runs. Defaults to FlowRunSort.START_TIME_DESC (most recent first).
- list[FlowRunInfo]: The deployment’s flow runs. Empty if it has none.
ValueError: Iflimitis outside 1..100 oroffsetis negative.FlowsError: If the deployment does not exist.
get_flow_run_logs_by_id
flow_run_id: The ID of the flow run to get logs for.limit: Maximum number of log records to return. Defaults to None (no limit).
- list[Log]: The flow run’s logs sorted by timestamp ascending. Empty if the run has no logs or if no run exists with the given ID.
list_deployments
name_like: Case-insensitive partial match on the deployment name. Defaults to None (all deployments).sort: The order of the returned deployments. Defaults to DeploymentSort.NAME_ASC.
- list[DeploymentInfo]: The matching deployments. Empty if none match.
run_deployment
deployment is positional; everything else must be passed by
keyword, so a flow parameter can never be mistaken for a suffix.
Args:
deployment: The callable decorated with @orbitra_deployment.orbitra_flows_name_suffix: Suffix appended to the flow name. When omitted, reads from ClientSettings.orbitra_flows_name_suffix, and falls back to no suffix when that is unset too.orbitra_flows_deployment_suffix: Suffix appended to the deployment name. When omitted, reads from ClientSettings.orbitra_flows_deployment_suffix, and falls back to no suffix when that is unset too.**kwargs: Parameters forwarded to the flow run.
- The ID of the created flow run.
run_deployment_by_name
deployment_name: The name of the deployment to run in the format <FLOW_NAME>/<DEPLOYMENT_NAME>.parameters: Parameters to pass to the flow run. Defaults to None.
- The ID of the created flow run.
sync_prefect_client
wait_for_flow_run
flow_run_id: The ID of the flow run to wait for.poll_interval: Seconds between polling attempts. Defaults to 5.0.timeout: Maximum seconds to wait before raising an error. Defaults to None (wait forever).raise_on_flow_failure: If True, raise FlowsError on flow failure. If False, return the flow run instead. Defaults to True.
- The flow run in its terminal state.
FlowsError: If the flow run fails, crashes, or is cancelled (only when raise_on_flow_failure=True).