Pass
Define a Pass in the state machine.
A Pass state can be used to transform the current execution's state.
Example
const stateMachine = new stepfunctions.StateMachine(this, 'MyStateMachine', {
stateMachineType: stepfunctions.StateMachineType.EXPRESS,
definition: stepfunctions.Chain.start(new stepfunctions.Pass(this, 'Pass')),
});
const api = new apigateway.RestApi(this, 'Api', {
restApiName: 'MyApi',
});
api.root.addMethod('GET', apigateway.StepFunctionsIntegration.startExecution(stateMachine));
state_machine = stepfunctions.StateMachine(self, "MyStateMachine",
state_machine_type=stepfunctions.StateMachineType.EXPRESS,
definition=stepfunctions.Chain.start(stepfunctions.Pass(self, "Pass"))
)
api = apigateway.RestApi(self, "Api",
rest_api_name="MyApi"
)
api.root.add_method("GET", apigateway.StepFunctionsIntegration.start_execution(state_machine))
StateMachine stateMachine = StateMachine.Builder.create(this, "MyStateMachine")
.stateMachineType(StateMachineType.EXPRESS)
.definition(Chain.start(new Pass(this, "Pass")))
.build();
RestApi api = RestApi.Builder.create(this, "Api")
.restApiName("MyApi")
.build();
api.root.addMethod("GET", StepFunctionsIntegration.startExecution(stateMachine));
// Install: dotnet add package Amazon.CDK.Lib
var stateMachine = new StateMachine(this, "MyStateMachine", new StateMachineProps {
StateMachineType = StateMachineType.EXPRESS,
Definition = Chain.Start(new Pass(this, "Pass"))
});
var api = new RestApi(this, "Api", new RestApiProps {
RestApiName = "MyApi"
});
api.Root.AddMethod("GET", StepFunctionsIntegration.StartExecution(stateMachine));
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
stateMachine := stepfunctions.NewStateMachine(this, jsii.String("MyStateMachine"), &StateMachineProps{
StateMachineType: stepfunctions.StateMachineType_EXPRESS,
Definition: stepfunctions.Chain_Start(stepfunctions.NewPass(this, jsii.String("Pass"))),
})
api := apigateway.NewRestApi(this, jsii.String("Api"), &RestApiProps{
RestApiName: jsii.String("MyApi"),
})
api.Root.AddMethod(jsii.String("GET"), apigateway.StepFunctionsIntegration_StartExecution(stateMachine))
Initializer
Construct Props
assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{}#Default: Not assign variables
Using workflow variables, you can store data in a step and retrieve that data in future steps.
commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string#Default: No comment
inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{}#Default: $states.result or $states.errorOutput
notes
When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.
parametersoptional{ [key: string]: any }parametersoptionaltyping.Mapping[str, Any]parametersoptionalMap<String, Object>ParametersoptionalIDictionary<string, object>Parametersoptional*map[string]interface{}#Default: No parameters
queryLanguageoptionalQueryLanguagequery_languageoptionalQueryLanguagequeryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguage= JSONPath#If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
resultoptionalResultresultoptionalResultresultoptionalResultResultoptionalResultResultoptionalResult#Default: No injected result
Can be used to inject or replace the current execution state.
resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string#Default: The construct ID will be used as state name
Properties
Methods
addPrefix(x: string): voiddef add_prefix(self, x: str) -> Nonepublic void addPrefix(String x)public void AddPrefix(string x)func AddPrefix(X *string)#bindToGraph(graph: StateGraph): voiddef bind_to_graph(self, graph: StateGraph) -> Nonepublic void bindToGraph(StateGraph graph)public void BindToGraph(StateGraph graph)func BindToGraph(Graph StateGraph)#Don't call this. It will be called automatically when you work with states normally.
filterNextables(states: State[]): INextable[]@staticmethod def filter_nextables(states: typing.List[State]) -> typing.List[INextable]public static List<INextable> filterNextables(List<State> states)public static INextable[] FilterNextables(State[] states)func FilterNextables(States *[]State) *[]INextablestatic#findReachableEndStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_end_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableEndStates(State start, FindStateOptions options)public static State[] FindReachableEndStates(State start, FindStateOptions? options = null)func FindReachableEndStates(Start State, Options FindStateOptions) *[]Statestatic#findReachableStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableStates(State start, FindStateOptions options)public static State[] FindReachableStates(State start, FindStateOptions? options = null)func FindReachableStates(Start State, Options FindStateOptions) *[]Statestatic#This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
jsonata(scope: Construct, id: string, props?: PassJsonataProps): Pass // chainable@staticmethod def jsonata(scope: Construct, id: str, props: typing.Optional[PassJsonataProps] = None) -> Passpublic static Pass jsonata(Construct scope, String id, PassJsonataProps props)public static Pass Jsonata(Construct scope, string id, PassJsonataProps? props = null)func Jsonata(Scope Construct, Id *string, Props PassJsonataProps) Passstatic#A Pass state can be used to transform the current execution's state.
jsonPath(scope: Construct, id: string, props?: PassJsonPathProps): Pass // chainable@staticmethod def json_path(scope: Construct, id: str, props: typing.Optional[PassJsonPathProps] = None) -> Passpublic static Pass jsonPath(Construct scope, String id, PassJsonPathProps props)public static Pass JsonPath(Construct scope, string id, PassJsonPathProps? props = null)func JsonPath(Scope Construct, Id *string, Props PassJsonPathProps) Passstatic#A Pass state can be used to transform the current execution's state.
next(next: IChainable): Chaindef next(self, next: IChainable) -> Chainpublic Chain next(IChainable next)public Chain Next(IChainable next)func Next(Next IChainable) Chain#prefixStates(root: IConstruct, prefix: string): void@staticmethod def prefix_states(root: IConstruct, prefix: str) -> Nonepublic static void prefixStates(IConstruct root, String prefix)public static void PrefixStates(IConstruct root, string prefix)func PrefixStates(Root IConstruct, Prefix *string)static#toStateJson(topLevelQueryLanguage?: QueryLanguage): jsondef to_state_json(self, top_level_query_language: typing.Optional[QueryLanguage] = None) -> Anypublic Object toStateJson(QueryLanguage topLevelQueryLanguage)public object ToStateJson(QueryLanguage? topLevelQueryLanguage = null)func ToStateJson(TopLevelQueryLanguage QueryLanguage) interface{}#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.
1 parameter · returns
Parameters
mixinsmixinsmixinsmixinsMixins— The mixins to apply.
Returns: This construct for chaining