Parallel

class aws_cdk.aws_stepfunctions.Parallel(scope, id, *, comment=None, input_path=None, output_path=None, result_path=None)

Bases: aws_cdk.aws_stepfunctions.State

Define a Parallel state in the state machine.

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

stability :stability: experimental

__init__(scope, id, *, comment=None, input_path=None, output_path=None, result_path=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • 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

None

Methods

add_catch(handler, *, errors=None, result_path=None)

Add a recovery handler for this state.

When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.

Parameters
  • handler (IChainable) –

  • props

  • errors (Optional[List[str]]) – Errors to recover from by going to the given state. A list of error strings to retry, which can be either predefined errors (for example Errors.NoChoiceMatched) or a self-defined error. Default: All errors

  • result_path (Optional[str]) – JSONPath expression to indicate where to inject the error data. May also be the special value DISCARD, which will cause the error data to be discarded. Default: $

stability :stability: experimental

Return type

Parallel

add_prefix(x)

Add a prefix to the stateId of this state.

Parameters

x (str) –

stability :stability: experimental

Return type

None

add_retry(*, backoff_rate=None, errors=None, interval=None, max_attempts=None)

Add retry configuration for this state.

This controls if and how the execution will be retried if a particular error occurs.

Parameters
  • props

  • backoff_rate (Union[int, float, None]) – Multiplication for how much longer the wait interval gets on every retry. Default: 2

  • errors (Optional[List[str]]) – Errors to retry. A list of error strings to retry, which can be either predefined errors (for example Errors.NoChoiceMatched) or a self-defined error. Default: All errors

  • interval (Optional[Duration]) – How many seconds to wait initially before retrying. Default: Duration.seconds(1)

  • max_attempts (Union[int, float, None]) – How many times to retry this particular error. May be 0 to disable retry for specific errors (in case you have a catch-all retry policy). Default: 3

stability :stability: experimental

Return type

Parallel

bind_to_graph(graph)

Register this state as part of the given graph.

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

Parameters

graph (StateGraph) –

stability :stability: experimental

Return type

None

branch(*branches)

Define one or more branches to run in parallel.

Parameters

branches (IChainable) –

stability :stability: experimental

Return type

Parallel

next(next)

Continue normal execution with the given state.

Parameters

next (IChainable) –

stability :stability: experimental

Return type

Chain

to_state_json()

Return the Amazon States Language object for this state.

stability :stability: experimental

Return type

Mapping[Any, Any]

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

end_states

Continuable states of this Chainable.

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

First state of this Chainable.

stability :stability: experimental

Return type

State

state_id

Tokenized string that evaluates to the state’s ID.

stability :stability: experimental

Return type

str

Static Methods

classmethod filter_nextables(states)

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

Parameters

states (List[State]) –

stability :stability: experimental

Return type

List[INextable]

classmethod find_reachable_end_states(start, *, include_error_handlers=None)

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

Parameters
  • start (State) –

  • options

  • include_error_handlers (Optional[bool]) – Whether or not to follow error-handling transitions. Default: false

stability :stability: experimental

Return type

List[State]

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

classmethod prefix_states(root, prefix)

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

Parameters

stability :stability: experimental

Return type

None