A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/step-functions/latest/dg/statemachine-structure.html below:

State machine structure in Amazon States Language for Step Functions workflows

State machine structure in Amazon States Language for Step Functions workflows

State machines are defined using JSON text that represents a structure containing the following fields.

Comment (Optional)

A human-readable description of the state machine.

QueryLanguage (Optional; when omitted, defaults to JSONPath)
StartAt (Required)

A string that must exactly match (is case sensitive) the name of one of the state objects.

TimeoutSeconds (Optional)

The maximum number of seconds an execution of the state machine can run. If it runs longer than the specified time, the execution fails with a States.Timeout Error Name.

Version (Optional)

The version of the Amazon States Language used in the state machine (default is "1.0").

States (Required)

An object containing a comma-delimited set of states.

The States field contains States.

{
    "State1" : {
    },

    "State2" : {
    },
    ...
}

A state machine is defined by the states it contains and the relationships between them.

The following is an example.

{
  "Comment": "A Hello World example of the Amazon States Language using a Pass state",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Pass",
      "Result": "Hello World!",
      "End": true
    }
  }
}

When an execution of this state machine is launched, the system begins with the state referenced in the StartAt field ("HelloWorld"). If this state has an "End": true field, the execution stops and returns a result. Otherwise, the system looks for a "Next": field and continues with that state next. This process repeats until the system reaches a terminal state (a state with "Type": "Succeed", "Type": "Fail", or "End": true), or a runtime error occurs.

The following rules apply to states within a state machine:

Common state fields in workflows

The following fields are common to all state elements.

Type (Required)

The state's type.

QueryLanguage (Optional; when omitted, defaults to JSONPath)
Next

The name of the next state that is run when the current state finishes. Some state types, such as Choice, allow multiple transition states.

If the current state is the last state in your workflow, or a terminal state, such as Succeed workflow state or Fail workflow state, you don't need to specify the Next field.

End

Designates this state as a terminal state (ends the execution) if set to true. There can be any number of terminal states per state machine. Only one of Next or End can be used in a state. Some state types, such as Choice, or terminal states, such as Succeed workflow state and Fail workflow state, don't support or use the End field.

Comment (Optional)

Holds a human-readable description of the state.

Assign (Optional)

Used to store variables. The Assign field accepts a JSON object with key/value pairs that define variable names and their assigned values. Any string value, including those inside objects or arrays, will be evaluated as JSONata when surrounded by {% %} characters

For more information, see Passing data between states with variables.

Output (Optional, JSONata only)

Used to specify and transform output from the state. When specified, the value overrides the state output default.

The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters.

Output also accepts a JSONata expression directly, for example: "Output": "{% jsonata expression %}"

For more information, see Input and Output Processing.

InputPath (Optional, JSONPath only)

A path that selects a portion of the state's input to be passed to the state's task for processing. If omitted, it has the value $ which designates the entire input. For more information, see Input and Output Processing.

OutputPath (Optional, JSONPath only)

A path that selects a portion of the state's output to be passed to the next state. If omitted, it has the value $ which designates the entire output. For more information, see Input and Output Processing.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4