Builtins
Action State
- class gladier.tools.ActionState(*args, state_type: str = 'Action', state_name: str | None = None, comment: str | None = None, result_path: str | None = None, parameters: Dict[str, Any] | None = None, input_path: str | None = None, set_parameters_from_properties: bool = True, non_parameter_properties: Set[str] = {'_flow_definition', 'action_scope', 'action_url', 'comment', 'exception_handlers', 'exception_on_action_failure', 'input_path', 'next_state', 'non_parameter_properties', 'parameters', 'result_path', 'run_as', 'set_parameters_from_properties', 'state_name', 'state_type', 'wait_time'}, action_url: str, action_scope: str | None = None, wait_time: int = 600, exception_on_action_failure: bool = False, run_as: str | None = None, **kwargs)
Bases:
StateWithNextOrEnd
,StateWithParametersOrInputPath
,StateWithResultPath
The Action State defines the base class for all Globus Action Providers.
And Rule (for Choice)
- class gladier.tools.AndRule(rules: t.List[ChoiceRule], *args, __root__: List[ChoiceRule])
Bases:
ChoiceRule
Choice Option
- class gladier.tools.ChoiceOption(*, rule: ChoiceRule, next: BaseState)
Bases:
BaseModel
Choice Rule
- class gladier.tools.ChoiceRule
Bases:
BaseModel
Choice State
- class gladier.tools.ChoiceState(*args, state_type: str = 'Choice', state_name: str | None = None, comment: str | None = None, rules: List[ChoiceRule] = [], default: BaseState | None = None, **kwargs)
Bases:
BaseState
The Choice state allows for branching logic depending on a set of conditions.
An example is below:
from gladier.tools import ChoiceState, ChoiceOption, ComparisonRule, FailState, PassState from gladier import GladierClient choice_state = ( ChoiceState() .choice( ChoiceOption( rule=ComparisonRule( Variable="$.input.myvar", NumericEquals=0.0 ), next=FailState( cause="Random value 0 selected", error="Unluck 0 selected, simulated error", ), ) )) choice_state.set_default(PassState(state_name="SuccessfulCompletion")) gc = GladierClient(choice_state.get_flow_definition()) gc.run_flow(flow_input={'input': {'myvar': 1}})
See the full list of Comparison Rules above, and operations.
Expression Eval State
- class gladier.tools.ExpressionEvalState(*args, state_type: str = 'ExpressionEval', state_name: str | None = None, comment: str | None = None, result_path: str | None = None, parameters: Dict[str, Any] | None = None, input_path: str | None = None, set_parameters_from_properties: bool = True, non_parameter_properties: Set[str] = {'_flow_definition', 'action_scope', 'action_url', 'comment', 'exception_handlers', 'exception_on_action_failure', 'input_path', 'next_state', 'non_parameter_properties', 'parameters', 'result_path', 'run_as', 'set_parameters_from_properties', 'state_name', 'state_type', 'wait_time'}, **kwargs)
Bases:
StateWithParametersOrInputPath
,StateWithResultPath
,StateWithNextOrEnd
A special Globus Flows state for evaluating expressions within a flow. Examples:
{ "expression": "x + 5", "arguments": { "x": 6 }, "result_path": "$.sum_value.should_be_11" }
See more documentation below https://docs.globus.org/api/flows/hosted-action-providers/ap-expression-eval/
Fail State
Not Rule (for Choice)
- class gladier.tools.NotRule(rule: ChoiceRule, *args, __root__: ChoiceRule)
Bases:
ChoiceRule
Or Rule (for Choice)
- class gladier.tools.OrRule(rules: t.List[ChoiceRule], *args, __root__: List[ChoiceRule])
Bases:
ChoiceRule
Pass State
- class gladier.tools.PassState(*args, state_type: str = 'Pass', state_name: str | None = None, comment: str | None = None, result_path: str | None = None, parameters: Dict[str, Any] | None = None, input_path: str | None = None, set_parameters_from_properties: bool = True, non_parameter_properties: Set[str] = {'_flow_definition', 'action_scope', 'action_url', 'comment', 'exception_handlers', 'exception_on_action_failure', 'input_path', 'next_state', 'non_parameter_properties', 'parameters', 'result_path', 'run_as', 'set_parameters_from_properties', 'state_name', 'state_type', 'wait_time'}, **kwargs)
Bases:
StateWithParametersOrInputPath
,StateWithNextOrEnd
,StateWithResultPath
Pass states contain no operations and are typically used to signify different transitional states between operational logic in a flow. For instance, if there was optional logic that the user may want to skip as part of a flow, a pass state could define the location where the optional logic ends and flow execution should pick back up (Likely chosen by a Choice state)
Wait State
- class gladier.tools.WaitState(*args, state_type: str = 'Wait', state_name: str | None = None, comment: str | None = None, seconds: int | None = None, timestamp: datetime | None = None, seconds_path: str | None = None, timestamp_path: str | None = None, **kwargs)
Bases:
StateWithNextOrEnd
The wait state will pause the execution of a flow for a determined amonut of time below.