# DistributedMapJsonataProps

Properties for configuring a Distribute Map state that using JSONata.

Extends: [StateBaseProps](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateBaseProps.html), [MapBaseOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.MapBaseOptions.html), [MapBaseJsonataOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.MapBaseJsonataOptions.html)

- Source: [`aws-stepfunctions/lib/states/distributed-map.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map.ts#L119)
- Type last changed: v2.190.0 · 17 Apr 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const assign: any;
declare const itemBatcher: stepfunctions.ItemBatcher;
declare const itemReader: stepfunctions.IItemReader;
declare const itemSelector: any;
declare const outputs: any;
declare const provideItems: stepfunctions.ProvideItems;
declare const resultWriter: stepfunctions.ResultWriter;
declare const resultWriterV2: stepfunctions.ResultWriterV2;
const distributedMapJsonataProps: stepfunctions.DistributedMapJsonataProps = {
  assign: {
    assignKey: assign,
  },
  comment: 'comment',
  itemBatcher: itemBatcher,
  itemReader: itemReader,
  items: provideItems,
  itemSelector: {
    itemSelectorKey: itemSelector,
  },
  jsonataItemSelector: 'jsonataItemSelector',
  jsonataMaxConcurrency: 'jsonataMaxConcurrency',
  label: 'label',
  mapExecutionType: stepfunctions.StateMachineType.EXPRESS,
  maxConcurrency: 123,
  outputs: outputs,
  queryLanguage: stepfunctions.QueryLanguage.JSON_PATH,
  resultWriter: resultWriter,
  resultWriterV2: resultWriterV2,
  stateName: 'stateName',
  toleratedFailureCount: 123,
  toleratedFailurePercentage: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions as stepfunctions

# assign: Any
# item_batcher: stepfunctions.ItemBatcher
# item_reader: stepfunctions.IItemReader
# item_selector: Any
# outputs: Any
# provide_items: stepfunctions.ProvideItems
# result_writer: stepfunctions.ResultWriter
# result_writer_v2: stepfunctions.ResultWriterV2

distributed_map_jsonata_props = stepfunctions.DistributedMapJsonataProps(
    assign={
        "assign_key": assign
    },
    comment="comment",
    item_batcher=item_batcher,
    item_reader=item_reader,
    items=provide_items,
    item_selector={
        "item_selector_key": item_selector
    },
    jsonata_item_selector="jsonataItemSelector",
    jsonata_max_concurrency="jsonataMaxConcurrency",
    label="label",
    map_execution_type=stepfunctions.StateMachineType.EXPRESS,
    max_concurrency=123,
    outputs=outputs,
    query_language=stepfunctions.QueryLanguage.JSON_PATH,
    result_writer=result_writer,
    result_writer_v2=result_writer_v2,
    state_name="stateName",
    tolerated_failure_count=123,
    tolerated_failure_percentage=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.*;

Object assign;
ItemBatcher itemBatcher;
IItemReader itemReader;
Object itemSelector;
Object outputs;
ProvideItems provideItems;
ResultWriter resultWriter;
ResultWriterV2 resultWriterV2;

DistributedMapJsonataProps distributedMapJsonataProps = DistributedMapJsonataProps.builder()
        .assign(Map.of(
                "assignKey", assign))
        .comment("comment")
        .itemBatcher(itemBatcher)
        .itemReader(itemReader)
        .items(provideItems)
        .itemSelector(Map.of(
                "itemSelectorKey", itemSelector))
        .jsonataItemSelector("jsonataItemSelector")
        .jsonataMaxConcurrency("jsonataMaxConcurrency")
        .label("label")
        .mapExecutionType(StateMachineType.EXPRESS)
        .maxConcurrency(123)
        .outputs(outputs)
        .queryLanguage(QueryLanguage.JSON_PATH)
        .resultWriter(resultWriter)
        .resultWriterV2(resultWriterV2)
        .stateName("stateName")
        .toleratedFailureCount(123)
        .toleratedFailurePercentage(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions;

var assign;
ItemBatcher itemBatcher;
IItemReader itemReader;
var itemSelector;
var outputs;
ProvideItems provideItems;
ResultWriter resultWriter;
ResultWriterV2 resultWriterV2;

var distributedMapJsonataProps = new DistributedMapJsonataProps {
    Assign = new Dictionary<string, object> {
        { "assignKey", assign }
    },
    Comment = "comment",
    ItemBatcher = itemBatcher,
    ItemReader = itemReader,
    Items = provideItems,
    ItemSelector = new Dictionary<string, object> {
        { "itemSelectorKey", itemSelector }
    },
    JsonataItemSelector = "jsonataItemSelector",
    JsonataMaxConcurrency = "jsonataMaxConcurrency",
    Label = "label",
    MapExecutionType = StateMachineType.EXPRESS,
    MaxConcurrency = 123,
    Outputs = outputs,
    QueryLanguage = QueryLanguage.JSON_PATH,
    ResultWriter = resultWriter,
    ResultWriterV2 = resultWriterV2,
    StateName = "stateName",
    ToleratedFailureCount = 123,
    ToleratedFailurePercentage = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign interface{}
var itemBatcher ItemBatcher
var itemReader IItemReader
var itemSelector interface{}
var outputs interface{}
var provideItems ProvideItems
var resultWriter ResultWriter
var resultWriterV2 ResultWriterV2

distributedMapJsonataProps := &DistributedMapJsonataProps{
	Assign: map[string]interface{}{
		"assignKey": assign,
	},
	Comment: jsii.String("comment"),
	ItemBatcher: itemBatcher,
	ItemReader: itemReader,
	Items: provideItems,
	ItemSelector: map[string]interface{}{
		"itemSelectorKey": itemSelector,
	},
	JsonataItemSelector: jsii.String("jsonataItemSelector"),
	JsonataMaxConcurrency: jsii.String("jsonataMaxConcurrency"),
	Label: jsii.String("label"),
	MapExecutionType: awscdk.Aws_stepfunctions.StateMachineType_EXPRESS,
	MaxConcurrency: jsii.Number(123),
	Outputs: outputs,
	QueryLanguage: awscdk.*Aws_stepfunctions.QueryLanguage_JSON_PATH,
	ResultWriter: resultWriter,
	ResultWriterV2: resultWriterV2,
	StateName: jsii.String("stateName"),
	ToleratedFailureCount: jsii.Number(123),
	ToleratedFailurePercentage: jsii.Number(123),
}
```

## Properties

- `assign`: { [key: string]: any } — Workflow variables to store in this step.

  **Default:** Not assign variables

  Using workflow variables, you can store data in a step and retrieve that data in future steps.

- `comment`: string — A comment describing this state.

  **Default:** No comment

- `itemBatcher`: [ItemBatcher](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.ItemBatcher.html) — Specifies to process a group of items in a single child workflow execution.

  **Default:** No itemBatcher

- `itemReader`: [IItemReader](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.IItemReader.html) — ItemReader.

  **Default:** No itemReader

  Configuration for where to read items dataset in S3 to iterate

- `items`: [ProvideItems](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.ProvideItems.html) — The array that the Map state will iterate over.

  **Default:** The state input as is.

- `itemSelector`: { [key: string]: any } = $ — The JSON that you want to override your default iteration input (mutually exclusive with `parameters` and `jsonataItemSelector`).

- `jsonataItemSelector`: string = $ — Jsonata expression that evaluates to a JSON array to override your default iteration input (mutually exclusive with `parameters` and `itemSelector`).

  Example value: `{% {\"foo\": \"foo\", \"input\": $states.input} %}`

- `jsonataMaxConcurrency`: string — JSONata expression for MaxConcurrency.

  **Default:** full concurrency

  A JSONata expression that evaluates to an integer, specifying the maximum
  concurrency dynamically. Mutually exclusive with `maxConcurrency` and
  `maxConcurrencyPath`.

  Example value: `{% $states.input.maxConcurrency %}`

- `label`: string — Label.

  **Default:** No label

  Unique name for the Distributed Map state added to each Map Run

- `mapExecutionType`: [StateMachineType](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachineType.html) = StateMachineType.STANDARD — MapExecutionType.

  The execution type of the distributed map state

  This property overwrites ProcessorConfig.executionType

- `maxConcurrency`: number — MaxConcurrency.

  **Default:** full concurrency

  An upper bound on the number of iterations you want running at once.

- `outputs`: any — Used to specify and transform output from the state.

  **Default:** $states.result or $states.errorOutput

  When specified, the value overrides the state output default.
  The output field accepts any JSON value (object, array, string, number, boolean, null).
  Any string value, including those inside objects or arrays,
  will be evaluated as JSONata if surrounded by {% %} characters.
  Output also accepts a JSONata expression directly.

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

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

- `resultWriter`: [ResultWriter](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.ResultWriter.html) — Use {@link resultWriterV2 }

  **Default:** No resultWriter

- `resultWriterV2`: [ResultWriterV2](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.ResultWriterV2.html) — Configuration for S3 location in which to save Map Run results Enable "@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2" feature in the context to use resultWriterV2 Example: stack.node.setContext("@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2", true);

  **Default:** No resultWriterV2

- `stateName`: string — Optional name for this state.

  **Default:** The construct ID will be used as state name

- `toleratedFailureCount`: number — ToleratedFailureCount.

  **Default:** No toleratedFailureCount

  Number of failed items to tolerate in a Map Run, as static number

- `toleratedFailurePercentage`: number — ToleratedFailurePercentage.

  **Default:** No toleratedFailurePercentage

  Percentage of failed items to tolerate in a Map Run, as static number
