Flows Manager

Below is the class Gladier uses to track local changes to flows.

class gladier.FlowsManager(flow_id: ~typing.Optional[str] = None, flow_definition: ~typing.Optional[dict] = None, flow_schema: ~typing.Optional[dict] = None, flow_title: ~typing.Optional[str] = None, globus_group: ~typing.Optional[str] = None, subscription_id: ~typing.Optional[str] = None, on_change: ~typing.Callable = <function ensure_flow_registered>, redeploy_on_404: bool = True, **kwargs)

Bases: ServiceManager

The flows manager tracks an externally defined flow_definition and ensures it stays up-to-date with a deployment in the flows service. It can be run without a flow_id in which case it will deploy its own flow if a stored flow_id does not exist.

The flow checksum is evaluated inside run_flow(), and any updates to the flow will take place before the flow is started. The registration behavior can be customized by passing in a function for on_change. Default behavior will call register_flow(), None will disable changing the flow before starting it. The on_change signature is below:

def on_change_callback(flows_manager_instance: FlowsManager,
                       exc: gladier.exc.RegistrationException) -> None:
  • flow_id – Explicit flow id to use. None will result in deploying a new flow

  • flow_definition – Flow definiton that should be used. Usually set dynamically at runtime when used with a Gladier Client

  • flow_schema – The schema to be used alongside the flow definition

  • flow_title – The title for the Globus Flow

  • globus_group – A Globus Group UUID. Used to grant all flow and run permissions

  • subscription_id – (deprecated) Subscription ID has no effect and will be removed in a future version.

  • on_change – callback on checksum mismatch or missing flow id. Default registers/deploys flow, None takes no action and attempts to run “obselete” flows.

  • redeploy_on_404 – Deploy a new flow if attempting to run the current flow ID results in 404. Behavior is disabled if an explicit flow_id is specified.

When used with a Gladier Client, following items will be auto-configured and should not be set explicitly in the constructor:

  • flow_definition

  • flow_schema


The FlowsManager class cannot be used to run flows outside of Gladier Clients due to internal class storage requirements. Doing so will result in an exception.