# MapProps

Properties for defining a Map state.

Extends: MapProps
Extends: MapBaseProps, MapBaseOptions
Used as props by: Map

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

## Example

```ts
const map = new sfn.Map(this, 'Map State', {
  maxConcurrency: 1,
  itemsPath: sfn.JsonPath.stringAt('$.inputForMap'),
  itemSelector: {
    item: sfn.JsonPath.stringAt('$$.Map.Item.Value'),
  },
  resultPath: '$.mapOutput',
});

map.itemProcessor(new sfn.Pass(this, 'Pass State'), {
  mode: sfn.ProcessorMode.DISTRIBUTED,
  executionType: sfn.ProcessorType.STANDARD,
});
```

## 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

- `inputPath`: string = $ — JSONPath expression to select part of the state to be the input to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  input to be the empty object {}.

- `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`).

- `itemsPath`: string = $ — JSONPath expression to select the array to iterate over.

- `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 %}`

- `maxConcurrency`: number — MaxConcurrency.

  **Default:** full concurrency

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

- `maxConcurrencyPath`: string — MaxConcurrencyPath.

  **Default:** full concurrency

  A JsonPath that specifies the maximum concurrency dynamically from the state input.

- `outputPath`: string = $ — JSONPath expression to select part of the state to be the output to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  output to be the empty object {}.

- `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.

- `parameters`: { [key: string]: any } = $ — Step Functions has deprecated the `parameters` field in favor of the new `itemSelector` field

- `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.

- `resultPath`: string = $ — JSONPath expression to indicate where to inject the state's output.

  May also be the special value JsonPath.DISCARD, which will cause the state's
  input to become its output.

- `resultSelector`: { [key: string]: any } = None — The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.

  You can use ResultSelector to create a payload with values that are static
  or selected from the state's raw result.

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

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