StateMachineFragment

class aws_cdk.aws_stepfunctions.StateMachineFragment(scope, id)

Bases: aws_cdk.core.Construct

Base class for reusable state machine fragments.

Parameters
  • scope (Construct) –

  • id (str) –

Methods

next(next)

Continue normal execution with the given state.

Parameters

next (IChainable) –

Return type

Chain

prefix_states(prefix=None)

Prefix the IDs of all states in this state machine fragment.

Use this to avoid multiple copies of the state machine all having the same state IDs.

Parameters

prefix (Optional[str]) – The prefix to add. Will use construct ID by default.

Return type

StateMachineFragment

to_single_state(*, prefix_states=None, state_id=None, comment=None, input_path=None, output_path=None, result_path=None)

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state machine fragment.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change ‘outputPath’ to ‘$[0]’.

Parameters
  • prefix_states (Optional[str]) – String to prefix all stateIds in the state machine with. Default: stateId

  • state_id (Optional[str]) – ID of newly created containing state. Default: Construct ID of the StateMachineFragment

  • comment (Optional[str]) – An optional description for this state. Default: No comment

  • input_path (Optional[str]) – JSONPath expression to select part of the state to be the input to this state. May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}. Default: $

  • output_path (Optional[str]) – JSONPath expression to select part of the state to be the output to this state. May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}. Default: $

  • result_path (Optional[str]) – JSONPath expression to indicate where to inject the state’s output. May also be the special value JsonPath.DISCARD, which will cause the state’s input to become its output. Default: $

Return type

Parallel

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

end_states

The states to chain onto if this fragment is used.

Return type

List[INextable]

id

Descriptive identifier for this chainable.

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

start_state

The start state of this state machine fragment.

Return type

State

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool