StateMachineFragment

class aws_cdk.aws_stepfunctions.StateMachineFragment(scope, id)

Bases: aws_cdk.core.Construct

Base class for reusable state machine fragments.

stability :stability: experimental

__init__(scope, id)

Creates a new construct node.

Parameters
  • scope (Construct) – The scope in which to define this construct.

  • id (str) – The scoped construct ID. Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash --.

Return type

None

Methods

next(next)

Continue normal execution with the given state.

Parameters

next (IChainable) –

stability :stability: experimental

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.

stability :stability: experimental

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
  • options

  • 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 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 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 DISCARD, which will cause the state’s input to become its output. Default: $

stability :stability: experimental

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.

stability :stability: experimental

Return type

List[INextable]

id

Descriptive identifier for this chainable.

stability :stability: experimental

Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

start_state

The start state of this state machine fragment.

stability :stability: experimental

Return type

State

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool