Skip to content

Commit 064b01f

Browse files
author
AWS
committed
AWS Step Functions Update: Add support for variables and JSONata in TestState, GetExecutionHistory, DescribeStateMachine, and DescribeStateMachineForExecution
1 parent cde3cb1 commit 064b01f

File tree

2 files changed

+124
-17
lines changed

2 files changed

+124
-17
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS Step Functions",
4+
"contributor": "",
5+
"description": "Add support for variables and JSONata in TestState, GetExecutionHistory, DescribeStateMachine, and DescribeStateMachineForExecution"
6+
}

services/sfn/src/main/resources/codegen-resources/service-2.json

Lines changed: 118 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
"errors":[
644644
{"shape":"ValidationException"}
645645
],
646-
"documentation":"<p>Validates the syntax of a state machine definition.</p> <p>You can validate that a state machine definition is correct without creating a state machine resource. Step Functions will implicitly perform the same syntax check when you invoke <code>CreateStateMachine</code> and <code>UpdateStateMachine</code>. State machine definitions are specified using a JSON-based, structured language. For more information on Amazon States Language see <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html\">Amazon States Language</a> (ASL). </p> <p>Suggested uses for <code>ValidateStateMachineDefinition</code>:</p> <ul> <li> <p>Integrate automated checks into your code review or Continuous Integration (CI) process to validate state machine definitions before starting deployments.</p> </li> <li> <p>Run the validation from a Git pre-commit hook to check your state machine definitions before committing them to your source repository.</p> </li> </ul> <note> <p>Errors found in the state machine definition will be returned in the response as a list of <b>diagnostic elements</b>, rather than raise an exception.</p> </note>"
646+
"documentation":"<p>Validates the syntax of a state machine definition specified in <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html\">Amazon States Language</a> (ASL), a JSON-based, structured language.</p> <p>You can validate that a state machine definition is correct without creating a state machine resource.</p> <p>Suggested uses for <code>ValidateStateMachineDefinition</code>:</p> <ul> <li> <p>Integrate automated checks into your code review or Continuous Integration (CI) process to check state machine definitions before starting deployments.</p> </li> <li> <p>Run validation from a Git pre-commit hook to verify the definition before committing to your source repository.</p> </li> </ul> <p>Validation will look for problems in your state machine definition and return a <b>result</b> and a list of <b>diagnostic elements</b>.</p> <p>The <b>result</b> value will be <code>OK</code> when your workflow definition can be successfully created or updated. Note the result can be <code>OK</code> even when diagnostic warnings are present in the response. The <b>result</b> value will be <code>FAIL</code> when the workflow definition contains errors that would prevent you from creating or updating your state machine. </p> <p>The list of <a href=\"https://docs.aws.amazon.com/step-functions/latest/apireference/API_ValidateStateMachineDefinitionDiagnostic.html\">ValidateStateMachineDefinitionDiagnostic</a> data elements can contain zero or more <b>WARNING</b> and/or <b>ERROR</b> elements.</p> <note> <p>The <b>ValidateStateMachineDefinition API</b> might add new diagnostics in the future, adjust diagnostic codes, or change the message wording. Your automated processes should only rely on the value of the <b>result</b> field value (OK, FAIL). Do <b>not</b> rely on the exact order, count, or wording of diagnostic messages.</p> </note>"
647647
}
648648
},
649649
"shapes":{
@@ -811,6 +811,21 @@
811811
"max":256,
812812
"min":1
813813
},
814+
"AssignedVariables":{
815+
"type":"map",
816+
"key":{"shape":"VariableName"},
817+
"value":{"shape":"VariableValue"}
818+
},
819+
"AssignedVariablesDetails":{
820+
"type":"structure",
821+
"members":{
822+
"truncated":{
823+
"shape":"truncated",
824+
"documentation":"<p>Indicates whether assigned variables were truncated in the response. Always <code>false</code> for API calls. In CloudWatch logs, the value will be true if the data is truncated due to size limits.</p>"
825+
}
826+
},
827+
"documentation":"<p>Provides details about assigned variables in an execution history event.</p>"
828+
},
814829
"BilledDuration":{
815830
"type":"long",
816831
"min":0
@@ -1401,6 +1416,10 @@
14011416
"encryptionConfiguration":{
14021417
"shape":"EncryptionConfiguration",
14031418
"documentation":"<p>Settings to configure server-side encryption. </p>"
1419+
},
1420+
"variableReferences":{
1421+
"shape":"VariableReferences",
1422+
"documentation":"<p>A map of <b>state name</b> to a list of variables referenced by that state. States that do not use variable references will not be shown in the response.</p>"
14041423
}
14051424
}
14061425
},
@@ -1477,6 +1496,10 @@
14771496
"encryptionConfiguration":{
14781497
"shape":"EncryptionConfiguration",
14791498
"documentation":"<p>Settings to configure server-side encryption. </p>"
1499+
},
1500+
"variableReferences":{
1501+
"shape":"VariableReferences",
1502+
"documentation":"<p>A map of <b>state name</b> to a list of variables referenced by that state. States that do not use variable references will not be shown in the response.</p>"
14801503
}
14811504
}
14821505
},
@@ -1509,6 +1532,35 @@
15091532
]
15101533
},
15111534
"ErrorMessage":{"type":"string"},
1535+
"EvaluationFailedEventDetails":{
1536+
"type":"structure",
1537+
"required":["state"],
1538+
"members":{
1539+
"error":{
1540+
"shape":"SensitiveError",
1541+
"documentation":"<p>The error code of the failure.</p>"
1542+
},
1543+
"cause":{
1544+
"shape":"SensitiveCause",
1545+
"documentation":"<p>A more detailed explanation of the cause of the failure.</p>"
1546+
},
1547+
"location":{
1548+
"shape":"EvaluationFailureLocation",
1549+
"documentation":"<p>The location of the field in the state in which the evaluation error occurred.</p>"
1550+
},
1551+
"state":{
1552+
"shape":"StateName",
1553+
"documentation":"<p>The name of the state in which the evaluation error occurred.</p>"
1554+
}
1555+
},
1556+
"documentation":"<p>Contains details about an evaluation failure that occurred while processing a state, for example, when a JSONata expression throws an error. This event will only be present in state machines that have <b> QueryLanguage</b> set to JSONata, or individual states set to JSONata.</p>"
1557+
},
1558+
"EvaluationFailureLocation":{
1559+
"type":"string",
1560+
"max":256,
1561+
"min":0,
1562+
"sensitive":true
1563+
},
15121564
"EventId":{"type":"long"},
15131565
"ExecutionAbortedEventDetails":{
15141566
"type":"structure",
@@ -1919,6 +1971,10 @@
19191971
"mapRunRedrivenEventDetails":{
19201972
"shape":"MapRunRedrivenEventDetails",
19211973
"documentation":"<p>Contains details about the redrive attempt of a Map Run.</p>"
1974+
},
1975+
"evaluationFailedEventDetails":{
1976+
"shape":"EvaluationFailedEventDetails",
1977+
"documentation":"<p>Contains details about an evaluation failure that occurred while processing a state.</p>"
19221978
}
19231979
},
19241980
"documentation":"<p>Contains details about the events of an execution.</p>"
@@ -1928,7 +1984,7 @@
19281984
"members":{
19291985
"truncated":{
19301986
"shape":"truncated",
1931-
"documentation":"<p>Indicates whether input or output was truncated in the response. Always <code>false</code> for API calls.</p>"
1987+
"documentation":"<p>Indicates whether input or output was truncated in the response. Always <code>false</code> for API calls. In CloudWatch logs, the value will be true if the data is truncated due to size limits.</p>"
19321988
}
19331989
},
19341990
"documentation":"<p>Provides details about input or output in an execution history event.</p>"
@@ -2001,7 +2057,8 @@
20012057
"MapRunStarted",
20022058
"MapRunSucceeded",
20032059
"ExecutionRedriven",
2004-
"MapRunRedriven"
2060+
"MapRunRedriven",
2061+
"EvaluationFailed"
20052062
]
20062063
},
20072064
"Identity":{
@@ -2027,25 +2084,29 @@
20272084
"shape":"SensitiveData",
20282085
"documentation":"<p>The raw state input.</p>"
20292086
},
2087+
"afterArguments":{
2088+
"shape":"SensitiveData",
2089+
"documentation":"<p>The input after Step Functions applies an Arguments filter. This event will only be present when QueryLanguage for the state machine or individual states is set to JSONata. For more info, see <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/data-transform.html\">Transforming data with Step Functions</a>.</p>"
2090+
},
20302091
"afterInputPath":{
20312092
"shape":"SensitiveData",
2032-
"documentation":"<p>The input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-inputpath\">InputPath</a> filter.</p>"
2093+
"documentation":"<p>The input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-inputpath\">InputPath</a> filter. Not populated when QueryLanguage is JSONata.</p>"
20332094
},
20342095
"afterParameters":{
20352096
"shape":"SensitiveData",
2036-
"documentation":"<p>The effective input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters\">Parameters</a> filter.</p>"
2097+
"documentation":"<p>The effective input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters\">Parameters</a> filter. Not populated when QueryLanguage is JSONata.</p>"
20372098
},
20382099
"result":{
20392100
"shape":"SensitiveData",
20402101
"documentation":"<p>The state's raw result.</p>"
20412102
},
20422103
"afterResultSelector":{
20432104
"shape":"SensitiveData",
2044-
"documentation":"<p>The effective result after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector\">ResultSelector</a> filter.</p>"
2105+
"documentation":"<p>The effective result after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector\">ResultSelector</a> filter. Not populated when QueryLanguage is JSONata.</p>"
20452106
},
20462107
"afterResultPath":{
20472108
"shape":"SensitiveData",
2048-
"documentation":"<p>The effective result combined with the raw state input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html\">ResultPath</a> filter.</p>"
2109+
"documentation":"<p>The effective result combined with the raw state input after Step Functions applies the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html\">ResultPath</a> filter. Not populated when QueryLanguage is JSONata.</p>"
20492110
},
20502111
"request":{
20512112
"shape":"InspectionDataRequest",
@@ -2054,6 +2115,10 @@
20542115
"response":{
20552116
"shape":"InspectionDataResponse",
20562117
"documentation":"<p>The raw HTTP response that is returned when you test an HTTP Task.</p>"
2118+
},
2119+
"variables":{
2120+
"shape":"SensitiveData",
2121+
"documentation":"<p>JSON string that contains the set of workflow variables after execution of the state. The set will include variables assigned in the state and variables set up as test state input.</p>"
20572122
}
20582123
},
20592124
"documentation":"<p>Contains additional details about the state's execution, including its input and output data processing flow, and HTTP request and response information.</p>",
@@ -3197,6 +3262,14 @@
31973262
"outputDetails":{
31983263
"shape":"HistoryEventExecutionDataDetails",
31993264
"documentation":"<p>Contains details about the output of an execution history event.</p>"
3265+
},
3266+
"assignedVariables":{
3267+
"shape":"AssignedVariables",
3268+
"documentation":"<p>Map of variable name and value as a serialized JSON representation.</p>"
3269+
},
3270+
"assignedVariablesDetails":{
3271+
"shape":"AssignedVariablesDetails",
3272+
"documentation":"<p>Provides details about input or output in an execution history event.</p>"
32003273
}
32013274
},
32023275
"documentation":"<p>Contains details about an exit from a state during an execution.</p>"
@@ -3684,10 +3757,7 @@
36843757
},
36853758
"TestStateInput":{
36863759
"type":"structure",
3687-
"required":[
3688-
"definition",
3689-
"roleArn"
3690-
],
3760+
"required":["definition"],
36913761
"members":{
36923762
"definition":{
36933763
"shape":"Definition",
@@ -3708,6 +3778,10 @@
37083778
"revealSecrets":{
37093779
"shape":"RevealSecrets",
37103780
"documentation":"<p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p> <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions\">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p> <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>"
3781+
},
3782+
"variables":{
3783+
"shape":"SensitiveData",
3784+
"documentation":"<p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>"
37113785
}
37123786
}
37133787
},
@@ -3921,7 +3995,10 @@
39213995
}
39223996
}
39233997
},
3924-
"ValidateStateMachineDefinitionCode":{"type":"string"},
3998+
"ValidateStateMachineDefinitionCode":{
3999+
"type":"string",
4000+
"sensitive":true
4001+
},
39254002
"ValidateStateMachineDefinitionDiagnostic":{
39264003
"type":"structure",
39274004
"required":[
@@ -3932,7 +4009,7 @@
39324009
"members":{
39334010
"severity":{
39344011
"shape":"ValidateStateMachineDefinitionSeverity",
3935-
"documentation":"<p>A value of <code>ERROR</code> means that you cannot create or update a state machine with this definition.</p>"
4012+
"documentation":"<p>A value of <code>ERROR</code> means that you cannot create or update a state machine with this definition.</p> <p> <code>WARNING</code> level diagnostics alert you to potential issues, but they will not prevent you from creating or updating your state machine.</p>"
39364013
},
39374014
"code":{
39384015
"shape":"ValidateStateMachineDefinitionCode",
@@ -3947,7 +4024,7 @@
39474024
"documentation":"<p>Location of the issue in the state machine, if available.</p> <p>For errors specific to a field, the location could be in the format: <code>/States/&lt;StateName&gt;/&lt;FieldName&gt;</code>, for example: <code>/States/FailState/ErrorPath</code>.</p>"
39484025
}
39494026
},
3950-
"documentation":"<p>Describes an error found during validation. Validation errors found in the definition return in the response as <b>diagnostic elements</b>, rather than raise an exception.</p>"
4027+
"documentation":"<p>Describes potential issues found during state machine validation. Rather than raise an exception, validation will return a list of <b>diagnostic elements</b> containing diagnostic information. </p> <note> <p>The <a href=\"https://docs.aws.amazon.com/step-functions/latest/apireference/API_ValidateStateMachineDefinition.html\">ValidateStateMachineDefinitionlAPI</a> might add new diagnostics in the future, adjust diagnostic codes, or change the message wording. Your automated processes should only rely on the value of the <b>result</b> field value (OK, FAIL). Do <b>not</b> rely on the exact order, count, or wording of diagnostic messages.</p> </note> <p> <b>List of warning codes</b> </p> <dl> <dt>NO_DOLLAR</dt> <dd> <p>No <code>.$</code> on a field that appears to be a JSONPath or Intrinsic Function.</p> </dd> <dt>NO_PATH</dt> <dd> <p>Field value looks like a path, but field name does not end with 'Path'.</p> </dd> <dt>PASS_RESULT_IS_STATIC</dt> <dd> <p>Attempt to use a path in the result of a pass state.</p> </dd> </dl> <p> <b>List of error codes</b> </p> <dl> <dt>INVALID_JSON_DESCRIPTION</dt> <dd> <p>JSON syntax problem found.</p> </dd> <dt>MISSING_DESCRIPTION</dt> <dd> <p>Received a null or empty workflow input.</p> </dd> <dt>SCHEMA_VALIDATION_FAILED</dt> <dd> <p>Schema validation reported errors.</p> </dd> <dt>INVALID_RESOURCE</dt> <dd> <p>The value of a Task-state resource field is invalid.</p> </dd> <dt>MISSING_END_STATE</dt> <dd> <p>The workflow does not have a terminal state.</p> </dd> <dt>DUPLICATE_STATE_NAME</dt> <dd> <p>The same state name appears more than once.</p> </dd> <dt>INVALID_STATE_NAME</dt> <dd> <p>The state name does not follow the naming convention.</p> </dd> <dt>STATE_MACHINE_NAME_EMPTY</dt> <dd> <p>The state machine name has not been specified.</p> </dd> <dt>STATE_MACHINE_NAME_INVALID</dt> <dd> <p>The state machine name does not follow the naming convention.</p> </dd> <dt>STATE_MACHINE_NAME_TOO_LONG</dt> <dd> <p>The state name exceeds the allowed length.</p> </dd> <dt>STATE_MACHINE_NAME_ALREADY_EXISTS</dt> <dd> <p>The state name already exists.</p> </dd> <dt>DUPLICATE_LABEL_NAME</dt> <dd> <p>A label name appears more than once.</p> </dd> <dt>INVALID_LABEL_NAME</dt> <dd> <p>You have provided an invalid label name.</p> </dd> <dt>MISSING_TRANSITION_TARGET</dt> <dd> <p>The value of \"Next\" field doesn't match a known state name.</p> </dd> <dt>TOO_DEEPLY_NESTED</dt> <dd> <p>The states are too deeply nested.</p> </dd> </dl>"
39514028
},
39524029
"ValidateStateMachineDefinitionDiagnosticList":{
39534030
"type":"list",
@@ -3975,13 +4052,19 @@
39754052
}
39764053
}
39774054
},
3978-
"ValidateStateMachineDefinitionLocation":{"type":"string"},
4055+
"ValidateStateMachineDefinitionLocation":{
4056+
"type":"string",
4057+
"sensitive":true
4058+
},
39794059
"ValidateStateMachineDefinitionMaxResult":{
39804060
"type":"integer",
39814061
"max":100,
39824062
"min":0
39834063
},
3984-
"ValidateStateMachineDefinitionMessage":{"type":"string"},
4064+
"ValidateStateMachineDefinitionMessage":{
4065+
"type":"string",
4066+
"sensitive":true
4067+
},
39854068
"ValidateStateMachineDefinitionOutput":{
39864069
"type":"structure",
39874070
"required":[
@@ -3995,7 +4078,7 @@
39954078
},
39964079
"diagnostics":{
39974080
"shape":"ValidateStateMachineDefinitionDiagnosticList",
3998-
"documentation":"<p>If the result is <code>OK</code>, this field will be empty. When there are errors, this field will contain an array of <b>Diagnostic</b> objects to help you troubleshoot.</p>"
4081+
"documentation":"<p>An array of diagnostic errors and warnings found during validation of the state machine definition. Since <b>warnings</b> do not prevent deploying your workflow definition, the <b>result</b> value could be <code>OK</code> even when warning diagnostics are present in the response.</p>"
39994082
},
40004083
"truncated":{
40014084
"shape":"ValidateStateMachineDefinitionTruncated",
@@ -4042,6 +4125,24 @@
40424125
"INVALID_ROUTING_CONFIGURATION"
40434126
]
40444127
},
4128+
"VariableName":{
4129+
"type":"string",
4130+
"sensitive":true
4131+
},
4132+
"VariableNameList":{
4133+
"type":"list",
4134+
"member":{"shape":"VariableName"}
4135+
},
4136+
"VariableReferences":{
4137+
"type":"map",
4138+
"key":{"shape":"StateName"},
4139+
"value":{"shape":"VariableNameList"},
4140+
"sensitive":true
4141+
},
4142+
"VariableValue":{
4143+
"type":"string",
4144+
"sensitive":true
4145+
},
40454146
"VersionDescription":{
40464147
"type":"string",
40474148
"max":256,

0 commit comments

Comments
 (0)