# QueryLanguage

The name of the query language used by the state machine or state.

- Source: [`aws-stepfunctions/lib/types.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-stepfunctions/lib/types.ts#L279)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

```ts
const jsonata = sfn.Pass.jsonata(this, 'JSONata');
const jsonPath = sfn.Pass.jsonPath(this, 'JSONPath');
const definition = jsonata.next(jsonPath);

new sfn.StateMachine(this, 'MixedStateMachine', {
  // queryLanguage: sfn.QueryLanguage.JSON_PATH, // default
  definitionBody: sfn.DefinitionBody.fromChainable(definition),
});

// This throws an error. If JSONata is specified at the top level, JSONPath cannot be used in the state machine definition.
new sfn.StateMachine(this, 'JSONataOnlyStateMachine', {
  queryLanguage: sfn.QueryLanguage.JSONATA,
  definitionBody: sfn.DefinitionBody.fromChainable(definition),
});
```

## Members

| Member | Description |
| --- | --- |
| `JSON_PATH` | Use JSONPath. |
| `JSONATA` | Use JSONata. |

## Referenced by

- [`State`](/v2/docs/aws-cdk-lib.aws_stepfunctions.State).queryLanguage
- [`StateBaseProps`](/v2/docs/aws-cdk-lib.aws_stepfunctions.StateBaseProps).queryLanguage
- [`StateMachineProps`](/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachineProps).queryLanguage
