StateGraph

class aws_cdk.aws_stepfunctions.StateGraph(start_state, graph_description)

Bases: object

A collection of connected states.

A StateGraph is used to keep track of all states that are connected (have transitions between them). It does not include the substatemachines in a Parallel’s branches: those are their own StateGraphs, but the graphs themselves have a hierarchical relationship as well.

By assigning states to a definintive StateGraph, we verify that no state machines are constructed. In particular:

  • Every state object can only ever be in 1 StateGraph, and not inadvertently be used in two graphs.

  • Every stateId must be unique across all states in the entire state machine.

All policy statements in all states in all substatemachines are bubbled so that the top-level StateMachine instantiation can read them all and add them to the IAM Role.

You do not need to instantiate this class; it is used internally.

stability :stability: experimental

__init__(start_state, graph_description)
Parameters
  • start_state (State) –

  • graph_description (str) –

stability :stability: experimental

Return type

None

Methods

register_policy_statement(statement)

Register a Policy Statement used by states in this graph.

Parameters

statement (PolicyStatement) –

stability :stability: experimental

Return type

None

register_state(state)

Register a state as part of this graph.

Called by State.bindToGraph().

Parameters

state (State) –

stability :stability: experimental

Return type

None

register_super_graph(graph)

Register this graph as a child of the given graph.

Resource changes will be bubbled up to the given graph.

Parameters

graph (StateGraph) –

stability :stability: experimental

Return type

None

to_graph_json()

Return the Amazon States Language JSON for this graph.

stability :stability: experimental

Return type

Mapping[Any, Any]

to_string()

Return a string description of this graph.

stability :stability: experimental

Return type

str

Attributes

policy_statements

The accumulated policy statements.

stability :stability: experimental

Return type

List[PolicyStatement]

start_state

stability :stability: experimental

Return type

State

timeout

Set a timeout to render into the graph JSON.

Read/write. Only makes sense on the top-level graph, subgraphs do not support this feature.

default :default: No timeout

stability :stability: experimental

Return type

Optional[Duration]