Skip to main content

orbitra.flows.client

Functions

get_flows_client

Get an authenticated OrbitraFlowsClient for the Orbitra Flows (Prefect) API. Args:
  • environment: The environment to get the API URL from. Defaults to “prod”.
Returns:
  • An authenticated OrbitraFlowsClient instance.
Examples:

Classes

OrbitraFlowsClient

A wrapper around SyncPrefectClient for interacting with Orbitra Flows. Methods:

api_url

Get the API URL of the Orbitra Flows server.

get_flow_run_logs_by_id

Get the logs emitted by a flow run, ordered oldest to newest. Args:
  • 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).
Returns:
  • 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.
Examples:

run_deployment

Run a deployment by its decorated callable with type-safe parameters. Args:
  • deployment: The callable decorated with @orbitra_deployment.
  • **kwargs: Parameters forwarded to the flow run (type-checked against the flow signature).
Returns:
  • The ID of the created flow run.
Examples:

run_deployment_by_name

Run a Prefect deployment by name. Args:
  • 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.
Returns:
  • The ID of the created flow run.
Examples:

sync_prefect_client

The underlying SyncPrefectClient instance for direct Prefect API access.

wait_for_flow_run

Poll a flow run until it reaches a terminal state. Args:
  • 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 FlowRun instead. Defaults to True.
Returns:
  • The completed flow run object.
Raises:
  • FlowsError: If the flow run fails, crashes, or is cancelled (only when raise_on_flow_failure=True).
Examples: