StepFunctionsClient.test_state
rboto-sfn==0.4.0 · Service index · Types
Model summary (excerpt): Accepts the definition of a single state and executes it. You can test a state without creating a state machine or updating an existing state machine. Using this API, you can test the following: A state's input and output processing data flow An Amazon Web Services service integration request and response An HTTP Task request and response You can call this API on only one state at a time. The...
Install and imports
from rboto import StepFunctionsClient
from rboto_sfn.types import (
InspectionLevel,
MockInput,
TestStateConfiguration,
TestStateOutput,
)
Signature
async def test_state(
*,
definition: str,
role_arn: str | None = None,
input: str | None = None,
inspection_level: InspectionLevel | None = None,
reveal_secrets: bool | None = None,
variables: str | None = None,
state_name: str | None = None,
mock: MockInput | None = None,
context: str | None = None,
state_configuration: TestStateConfiguration | None = None,
) -> TestStateOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
definition |
Yes | The Amazon States Language (ASL) definition of the state or state machine. |
role_arn |
No | The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state. |
input |
No | A string that contains the JSON input data for the state. |
inspection_level |
No | Determines the values to return when a state is tested. You can specify one of the following types: INFO : Shows the final state output. By default, Step Functions sets inspectionLevel to INFO if you don't specify a level. DEBUG : Shows the final state output along with the input and output data processing result. TRACE : Shows the HTTP request and response for an HTTP Task. This level also... |
reveal_secrets |
No | Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response. If you set revealSecrets to true , you must make sure that the IAM user that... |
variables |
No | JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values. |
state_name |
No | Denotes the particular state within a state machine definition to be tested. If this field is specified, the definition must contain a fully-formed state machine definition. |
mock |
No | Defines a mocked result or error for the state under test. A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown. |
context |
No | A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request. |
state_configuration |
No | Contains configurations for the state under test. |
Output
TestStateOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
output |
str | None |
Always present | — |
error |
str | None |
Always present | — |
cause |
str | None |
Always present | — |
inspection_data |
InspectionDataOutput | None |
Always present | InspectionDataOutput |
next_state |
str | None |
Always present | — |
status |
TestExecutionStatusOutput | None |
Always present | TestExecutionStatusOutput |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
InspectionLevel, MockInput, TestStateConfiguration, TestStateOutput
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_sfn.exceptions:
InvalidArnError, InvalidDefinitionError, InvalidExecutionInputError, ValidationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.