Succeed

class aws_cdk.aws_stepfunctions.Succeed(scope, id, *, comment=None, input_path=None, output_path=None, state_name=None)

Bases: State

Define a Succeed state in the state machine.

Reaching a Succeed state terminates the state execution in success.

ExampleMetadata:

infused

Example:

success = sfn.Succeed(self, "We did it!")
Parameters:
  • scope (Construct) –

  • id (str) – Descriptive identifier for this chainable.

  • 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: $

  • state_name (Optional[str]) – Optional name for this state. Default: - The construct ID will be used as state name

Methods

add_prefix(x)

Add a prefix to the stateId of this state.

Parameters:

x (str) –

Return type:

None

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) –

Return type:

None

to_state_json()

Return the Amazon States Language object for this state.

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.

id

Descriptive identifier for this chainable.

node

The tree node.

start_state

First state of this Chainable.

state_id

Tokenized string that evaluates to the state’s ID.

Static Methods

classmethod filter_nextables(states)

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

Parameters:

states (Sequence[State]) –

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) –

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

Return type:

List[State]

classmethod find_reachable_states(start, *, include_error_handlers=None)

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.

Parameters:
  • start (State) –

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

Return type:

List[State]

classmethod is_construct(x)

Checks if x is a construct.

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:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod prefix_states(root, prefix)

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

Parameters:
Return type:

None