Globus Flows¶
- class globus_sdk.FlowsClient(*, environment: Optional[str] = None, base_url: Optional[str] = None, authorizer: Optional[globus_sdk.authorizers.base.GlobusAuthorizer] = None, app_name: Optional[str] = None, transport_params: Optional[Dict[str, Any]] = None)[source]¶
Bases:
globus_sdk.client.BaseClient
Client for the Globus Flows API.
Methods
list_flows()
,paginated.list_flows()
- create_flow(title: str, definition: Dict[str, Any], input_schema: Dict[str, Any], subtitle: Optional[str] = None, description: Optional[str] = None, flow_viewers: Optional[List[str]] = None, flow_starters: Optional[List[str]] = None, flow_administrators: Optional[List[str]] = None, keywords: Optional[List[str]] = None, additional_fields: Optional[Dict[str, Any]] = None) globus_sdk.response.GlobusHTTPResponse [source]¶
Create a Flow
Example Usage:
from globus_sdk import FlowsClient ... flows = FlowsClient(...) flows.create_flow( title="my-cool-flow", definition={ "StartAt": "the-one-true-state", "States": {"the-one-true-state": {"Type": "Pass", "End": True}}, }, input_schema={ "type": "object", "properties": { "input-a": {"type": "string"}, "input-b": {"type": "number"}, "input-c": {"type": "boolean"}, }, }, )
- Parameters
title (str (1 - 128 characters)) – A non-unique, human-friendly name used for displaying the flow to end users.
definition (dict) – JSON object specifying flows states and execution order. For a more detailed explanation of the flow definition, see Authoring Flows
input_schema (dict) – A JSON Schema to which Flow Invocation input must conform
subtitle (str (0 - 128 characters), optional) – A concise summary of the flow’s purpose.
description (str (0 - 4096 characters), optional) – A detailed description of the flow’s purpose for end user display.
flow_viewers (list[str], optional) –
A set of Principal URN values, or the value “public” indicating entities who can view the flow
Examples:
[ "public" ]
[ "urn:globus:auth:identity:b44bddda-d274-11e5-978a-9f15789a8150", "urn:globus:groups:id:c1dcd951-3f35-4ea3-9f28-a7cdeaf8b68f" ]
flow_starters (list[str], optional) –
A set of Principal URN values, or the value “all_authenticated_users” indicating entities who can initiate a Run of the flow
Examples:
[ "all_authenticated_users" ]
[ "urn:globus:auth:identity:b44bddda-d274-11e5-978a-9f15789a8150", "urn:globus:groups:id:c1dcd951-3f35-4ea3-9f28-a7cdeaf8b68f" ]
flow_administrators (list[str], optional) –
A set of Principal URN values indicating entities who can perform administrative operations on the flow (create, delete, update)
Example:
[ "urn:globus:auth:identity:b44bddda-d274-11e5-978a-9f15789a8150", "urn:globus:groups:id:c1dcd951-3f35-4ea3-9f28-a7cdeaf8b68f" ]
keywords (list[str] (0 - 1024 items), optional) – A set of terms used to categorize the flow used in query and discovery operations
additional_fields (dict or str -> any, optional) – Additional Key/Value pairs sent to the create API
External Documentation
See Create Flow in the API documentation for details.
- get_flow(flow_id: Union[uuid.UUID, str], *, query_params: Optional[Dict[str, Any]] = None) globus_sdk.response.GlobusHTTPResponse [source]¶
Retrieve a Flow by ID
- Parameters
External Documentation
See Get Flow in the API documentation for details.
- list_flows(*, filter_role: Optional[str] = None, filter_fulltext: Optional[str] = None, orderby: Optional[str] = None, marker: Optional[str] = None, query_params: Optional[Dict[str, Any]] = None) globus_sdk.services.flows.response.IterableFlowsResponse [source]¶
List deployed Flows
- Parameters
filter_role (str, optional) – A role name specifying the minimum permissions required for a Flow to be included in the response.
filter_fulltext (str, optional) – A string to use in a full-text search to filter results
orderby (str, optional) – A criterion for ordering flows in the listing
marker (str, optional) – A marker for pagination
query_params (dict, optional) – Any additional parameters to be passed through as query params.
Role Values
The valid values for
role
are, in order of precedence forfilter_role
:flow_viewer
flow_starter
flow_administrator
flow_owner
For example, if
flow_starter
is specified then flows for which the user has theflow_starter
,flow_administrator
orflow_owner
roles will be returned.OrderBy Values
Values for
orderby
consist of a field name, a space, and an ordering mode –ASC
for “ascending” andDESC
for “descending”.Supported field names are
id
scope_string
flow_owners
flow_administrators
title
created_at
updated_at
For example,
orderby="updated_at DESC"
requests a descending sort on update times, getting the most recently updated flow first.Paginated Usage
This method supports paginated access. To use the paginated variant, give the same arguments as normal, but prefix the method name with
paginated
, as in>>> client.paginated.list_flows(...)
For more information, see how to make paginated calls.
External Documentation
See List Flows in the API documentation for details.
- class globus_sdk.SpecificFlowClient(flow_id: Union[uuid.UUID, str], *, environment: Optional[str] = None, authorizer: Optional[globus_sdk.authorizers.base.GlobusAuthorizer] = None, app_name: Optional[str] = None, transport_params: Optional[Dict[str, Any]] = None)[source]¶
Bases:
globus_sdk.client.BaseClient
Client for interacting with a specific Globus Flow through the Flows API.
- Unlike other client types, this must be provided with a specific flow id. All other
arguments are the same as those for ~globus_sdk.BaseClient.
- Parameters
flow_id (str or uuid) – The generated UUID associated with a flow
Methods
- run_flow(body: Dict[str, Any], *, label: Optional[str] = None, tags: Optional[List[str]] = None, run_monitors: Optional[List[str]] = None, run_managers: Optional[List[str]] = None, additional_fields: Optional[Dict[str, Any]] = None) globus_sdk.response.GlobusHTTPResponse [source]¶
- Parameters
body (json dict) – The input json object handed to the first flow state. The flows service will validate this object against the flow’s supplied input schema.
label (Optional string (0 - 64 chars)) – A short human-readable title
tags (Optional list of strings) – A collection of searchable tags associated with the run. Tags are normalized by stripping leading and trailing whitespace, and replacing all whitespace with a single space.
run_monitors (Optional list of strings) – A list of authenticated entities (identified by URN) authorized to view this run in addition to the run owner
run_managers (Optional list of strings) – A list of authenticated entities (identified by URN) authorized to view & cancel this run in addition to the run owner
additional_fields (Optional dictionary) – Additional Key/Value pairs sent to the run API (this parameter is used to bypass local sdk key validation helping)
External Documentation
See Run Flow in the API documentation for details.
Client Errors¶
When an error occurs, a FlowsClient
will raise a FlowsAPIError.
- class globus_sdk.FlowsAPIError(r: requests.models.Response, *args: Any, **kwargs: Any)[source]¶
Bases:
globus_sdk.exc.api.GlobusAPIError
Error class to represent error responses from Flows.