AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a state machine. A state machine consists of a collection of states that can do work (Task states), determine to which states to transition next (Choice states), stop an execution with an error (Fail states), and so on. State machines are specified using a JSON-based, structured language. For more information, see Amazon States Language in the Step Functions User Guide.

If you set the publish parameter of this API action to true, it publishes version 1 as the first revision of the state machine.

This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

CreateStateMachine is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. CreateStateMachine's idempotency check is based on the state machine name, definition, type, LoggingConfiguration, and TracingConfiguration. The check is also based on the publish and versionDescription parameters. If a following request has a different roleArn or tags, Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, roleArn and tags will not be updated, even if they are different.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateStateMachineAsync.

Namespace: Amazon.StepFunctions
Assembly: AWSSDK.StepFunctions.dll
Version: 3.x.y.z

Syntax

C#
public virtual CreateStateMachineResponse CreateStateMachine(
         CreateStateMachineRequest request
)

Parameters

request
Type: Amazon.StepFunctions.Model.CreateStateMachineRequest

Container for the necessary parameters to execute the CreateStateMachine service method.

Return Value


The response from the CreateStateMachine service method, as returned by StepFunctions.

Exceptions

ExceptionCondition
ConflictException Updating or deleting a resource can cause an inconsistent state. This error occurs when there're concurrent requests for DeleteStateMachineVersion, PublishStateMachineVersion, or UpdateStateMachine with the publish parameter set to true. HTTP Status Code: 409
InvalidArnException The provided Amazon Resource Name (ARN) is not valid.
InvalidDefinitionException The provided Amazon States Language definition is not valid.
InvalidLoggingConfigurationException
InvalidNameException The provided name is not valid.
InvalidTracingConfigurationException Your tracingConfiguration key does not match, or enabled has not been set to true or false.
StateMachineAlreadyExistsException A state machine with the same name but a different definition or role ARN already exists.
StateMachineDeletingException The specified state machine is being deleted.
StateMachineLimitExceededException The maximum number of state machines has been reached. Existing state machines must be deleted before a new state machine can be created.
StateMachineTypeNotSupportedException
TooManyTagsException You've exceeded the number of tags allowed for a resource. See the Limits Topic in the Step Functions Developer Guide.
ValidationException The input does not satisfy the constraints specified by an Amazon Web Services service.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also