Action Provider: Expression Evaluation
Expression evaluation has been integrated with Action
state definitions directly
(see the documentation for Expressions).
For most use cases, the Expression Evaluation action provider described here is not needed and expressions defined on Action definitions within a Flow are preferred.
URL: https://actions.globus.org/expression_eval
Scope: https://auth.globus.org/scopes/5fac2e64-c734-4e6b-90ea-ff12ddbf9653/expression
Synchronous / Asynchronous: Synchronous
A single invocation of the action provider may evaluate one or more expressions. An Expression request consists of up to three parts:
-
An
expression
(required) which is a basic "arithmetic" type expression. This includes string type operations, so an expression like'foo' + 'bar'
is permitted and performs string concatenation as is common in many programming and scripting languages. -
A set of
arguments
(optional) in a JSON object format. These arguments may be referenced in an expression. So, if there’s an expression such as "x + 1" and the arguments contain{"x": 2}
the result will be3
. -
A
result_path
(optional) which is a path where the result will be stored. It may be in "Reference Path" format as defined in the AWS Step Functions State Machine Language specification, or it may simply be a dot separated string of the path elements. In either case, the path indicates where in thedetails
of the returned action status the value for the evaluated expression should be placed. Ifresult_path
is not present, the result will be stored in thedetails
under the keyresult
.
A single request may specify multiple expressions to be evaluated
by providing an array named expressions
as in {"expressions": [{ expression1 }, ...]}
where each expression contains the three fields defined for an expression.
These will be evaluated in order, and expressions using the same result_path
will result in previous results being over-written.
{
"expression": "x + 5",
"arguments": {
"x": 6
},
"result_path": "$.sum_value.should_be_11"
}
{
"expressions": [
{
"expression": "x + 5",
"arguments": {
"x": 6
},
"result_path": "$.sum_value.should_be_11"
},
{
"expression": "'foo' + bar",
"arguments": {
"bar": "bar"
},
"result_path": "$.sum_value.should_be_foobar"
},
{
"expression": "[1, 2] + [3, 4]",
"result_path": "$.sum_value.should_be_1234_list"
}
]
}