# StateMachineProps

Properties for defining a State Machine.

Extends: StateMachineProps
Used as props by: StateMachine

- Source: [`aws-stepfunctions/lib/state-machine.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-stepfunctions/lib/state-machine.ts#L96)
- Type last changed: v2.221.1 · 29 Oct 2025

## Example

```ts
import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions';

const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const inputArtifact = new codepipeline.Artifact();
const startState = new stepfunctions.Pass(this, 'StartState');
const simpleStateMachine  = new stepfunctions.StateMachine(this, 'SimpleStateMachine', {
  definition: startState,
});
const stepFunctionAction = new codepipeline_actions.StepFunctionInvokeAction({
  actionName: 'Invoke',
  stateMachine: simpleStateMachine,
  stateMachineInput: codepipeline_actions.StateMachineInput.filePath(inputArtifact.atPath('assets/input.json')),
});
pipeline.addStage({
  stageName: 'StepFunctions',
  actions: [stepFunctionAction],
});
```

## Properties

- `comment`: string — Comment that describes this state machine.

  **Default:** No comment

- `definition`: [IChainable](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.IChainable.html) — use definitionBody: DefinitionBody.fromChainable()

- `definitionBody`: [DefinitionBody](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.DefinitionBody.html) — Definition for this state machine.

- `definitionSubstitutions`: { [key: string]: string } — substitutions for the definition body as a key-value map.

- `encryptionConfiguration`: [EncryptionConfiguration](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.EncryptionConfiguration.html) — Configures server-side encryption of the state machine definition and execution history.

  **Default:** data is transparently encrypted using an AWS owned key

- `logs`: [LogOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.LogOptions.html) — Defines what execution history events are logged and where they are logged.

  **Default:** No logging

- `queryLanguage`: [QueryLanguage](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.QueryLanguage.html) = JSON_PATH — The name of the query language used by the state machine.

  If the state does not contain a `queryLanguage` field,
  then it will use the query language specified in this `queryLanguage` field.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.DESTROY — The removal policy to apply to state machine.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The execution role for the state machine service.

  **Default:** A role is automatically created

- `stateMachineName`: string — A name for the state machine.

  **Default:** A name is automatically generated

- `stateMachineType`: [StateMachineType](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachineType.html) = StateMachineType.STANDARD — Type of the state machine.

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Maximum run time for this state machine.

  **Default:** No timeout

- `tracingEnabled`: boolean = false — Specifies whether Amazon X-Ray tracing is enabled for this state machine.
