aws-cdk-lib.aws_stepfunctions.State

class State

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.State
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#State
Javasoftware.amazon.awscdk.services.stepfunctions.State
Pythonaws_cdk.aws_stepfunctions.State
TypeScript (source)aws-cdk-lib » aws_stepfunctions » State

Implements IConstruct, IDependable, IChainable

Extends Construct

Implemented by Choice, CustomState, Fail, Map, Parallel, Pass, Succeed, Wait, AthenaGetQueryExecution, AthenaGetQueryResults, AthenaStartQueryExecution, AthenaStopQueryExecution, BatchSubmitJob, CallApiGatewayHttpApiEndpoint, CallApiGatewayRestApiEndpoint, CallAwsService, CodeBuildStartBuild, DynamoDeleteItem, DynamoGetItem, DynamoPutItem, DynamoUpdateItem, EcsRunTask, EksCall, EmrAddStep, EmrCancelStep, EmrContainersCreateVirtualCluster, EmrContainersDeleteVirtualCluster, EmrContainersStartJobRun, EmrCreateCluster, EmrModifyInstanceFleetByName, EmrModifyInstanceGroupByName, EmrSetClusterTerminationProtection, EmrTerminateCluster, EvaluateExpression, EventBridgePutEvents, GlueDataBrewStartJobRun, GlueStartJobRun, LambdaInvoke, SageMakerCreateEndpoint, SageMakerCreateEndpointConfig, SageMakerCreateModel, SageMakerCreateTrainingJob, SageMakerCreateTransformJob, SageMakerUpdateEndpoint, SnsPublish, SqsSendMessage, StepFunctionsInvokeActivity, StepFunctionsStartExecution

Base class for all other state classes.

Initializer

new State(scope: Construct, id: string, props: StateProps)

Parameters

  • scope Construct
  • id string — Descriptive identifier for this chainable.
  • props StateProps

Properties

NameTypeDescription
branchesStateGraph[]
endStatesINextable[]Continuable states of this Chainable.
idstringDescriptive identifier for this chainable.
nodeNodeThe tree node.
startStateStateFirst state of this Chainable.
stateIdstringTokenized string that evaluates to the state's ID.
comment?string
defaultChoice?State
inputPath?string
iteration?StateGraph
outputPath?string
parameters?json
resultPath?string
resultSelector?json

branches

Type: StateGraph[]


endStates

Type: INextable[]

Continuable states of this Chainable.


id

Type: string

Descriptive identifier for this chainable.


node

Type: Node

The tree node.


startState

Type: State

First state of this Chainable.


stateId

Type: string

Tokenized string that evaluates to the state's ID.


comment?

Type: string (optional)


defaultChoice?

Type: State (optional)


inputPath?

Type: string (optional)


iteration?

Type: StateGraph (optional)


outputPath?

Type: string (optional)


parameters?

Type: json (optional)


resultPath?

Type: string (optional)


resultSelector?

Type: json (optional)

Methods

NameDescription
addPrefix(x)Add a prefix to the stateId of this state.
bindToGraph(graph)Register this state as part of the given graph.
toStateJson()Render the state as JSON.
toString()Returns a string representation of this construct.
protected addBranch(branch)Add a paralle branch to this state.
protected addChoice(condition, next)Add a choice branch to this state.
protected addIterator(iteration)Add a map iterator to this state.
protected makeDefault(def)Make the indicated state the default choice transition of this state.
protected makeNext(next)Make the indicated state the default transition of this state.
protected renderBranches()Render parallel branches in ASL JSON format.
protected renderChoices()Render the choices in ASL JSON format.
protected renderInputOutput()Render InputPath/Parameters/OutputPath in ASL JSON format.
protected renderIterator()Render map iterator in ASL JSON format.
protected renderNextEnd()Render the default next state in ASL JSON format.
protected renderResultSelector()Render ResultSelector in ASL JSON format.
protected renderRetryCatch()Render error recovery options in ASL JSON format.
protected validateState()Allows the state to validate itself.
protected whenBoundToGraph(graph)Called whenever this state is bound to a graph.
static filterNextables(states)Return only the states that allow chaining from an array of states.
static findReachableEndStates(start, options?)Find the set of end states states reachable through transitions from the given start state.
static findReachableStates(start, options?)Find the set of states reachable through transitions from the given start state.
static prefixStates(root, prefix)Add a prefix to the stateId of all States found in a construct tree.

addPrefix(x)

public addPrefix(x: string): void

Parameters

  • x string

Add a prefix to the stateId of this state.


bindToGraph(graph)

public bindToGraph(graph: StateGraph): void

Parameters

  • graph StateGraph

Register this state as part of the given graph.

Don't call this. It will be called automatically when you work with states normally.


toStateJson()

public toStateJson(): json

Returns

  • json

Render the state as JSON.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected addBranch(branch)

protected addBranch(branch: StateGraph): void

Parameters

  • branch StateGraph

Add a paralle branch to this state.


protected addChoice(condition, next)

protected addChoice(condition: Condition, next: State): void

Parameters

  • condition Condition
  • next State

Add a choice branch to this state.


protected addIterator(iteration)

protected addIterator(iteration: StateGraph): void

Parameters

  • iteration StateGraph

Add a map iterator to this state.


protected makeDefault(def)

protected makeDefault(def: State): void

Parameters

  • def State

Make the indicated state the default choice transition of this state.


protected makeNext(next)

protected makeNext(next: State): void

Parameters

  • next State

Make the indicated state the default transition of this state.


protected renderBranches()

protected renderBranches(): any

Returns

  • any

Render parallel branches in ASL JSON format.


protected renderChoices()

protected renderChoices(): any

Returns

  • any

Render the choices in ASL JSON format.


protected renderInputOutput()

protected renderInputOutput(): any

Returns

  • any

Render InputPath/Parameters/OutputPath in ASL JSON format.


protected renderIterator()

protected renderIterator(): any

Returns

  • any

Render map iterator in ASL JSON format.


protected renderNextEnd()

protected renderNextEnd(): any

Returns

  • any

Render the default next state in ASL JSON format.


protected renderResultSelector()

protected renderResultSelector(): any

Returns

  • any

Render ResultSelector in ASL JSON format.


protected renderRetryCatch()

protected renderRetryCatch(): any

Returns

  • any

Render error recovery options in ASL JSON format.


protected validateState()

protected validateState(): string[]

Returns

  • string[]

Allows the state to validate itself.


protected whenBoundToGraph(graph)

protected whenBoundToGraph(graph: StateGraph): void

Parameters

  • graph StateGraph

Called whenever this state is bound to a graph.

Can be overridden by subclasses.


static filterNextables(states)

public static filterNextables(states: State[]): INextable[]

Parameters

  • states State[]

Returns

  • INextable[]

Return only the states that allow chaining from an array of states.


static findReachableEndStates(start, options?)

public static findReachableEndStates(start: State, options?: FindStateOptions): State[]

Parameters

  • start State
  • options FindStateOptions

Returns

  • State[]

Find the set of end states states reachable through transitions from the given start state.


static findReachableStates(start, options?)

public static findReachableStates(start: State, options?: FindStateOptions): State[]

Parameters

  • start State
  • options FindStateOptions

Returns

  • State[]

Find the set of states reachable through transitions from the given start state.

This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch.


static prefixStates(root, prefix)

public static prefixStates(root: IConstruct, prefix: string): void

Parameters

  • root IConstruct
  • prefix string

Add a prefix to the stateId of all States found in a construct tree.