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.
This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginCreateStateMachine and EndCreateStateMachine.
Namespace: Amazon.StepFunctions
Assembly: AWSSDK.StepFunctions.dll
Version: 3.x.y.z
public abstract Task<CreateStateMachineResponse> CreateStateMachineAsync( CreateStateMachineRequest request, CancellationToken cancellationToken )
Container for the necessary parameters to execute the CreateStateMachine service method.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Exception | Condition |
---|---|
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. |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5