# ProcessorMode

Mode of the Map workflow.

- Source: [`aws-stepfunctions/lib/types.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-stepfunctions/lib/types.ts#L215)
- Type last changed: v2.116.0 · 22 Dec 2023

## Example

TypeScript:

```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,
});
```

Python:

```python
map = sfn.Map(self, "Map State",
    max_concurrency=1,
    items_path=sfn.JsonPath.string_at("$.inputForMap"),
    item_selector={
        "item": sfn.JsonPath.string_at("$.Map.Item.Value")
    },
    result_path="$.mapOutput"
)

map.item_processor(sfn.Pass(self, "Pass State"),
    mode=sfn.ProcessorMode.DISTRIBUTED,
    execution_type=sfn.ProcessorType.STANDARD
)
```

Java:

```java
Map map = Map.Builder.create(this, "Map State")
        .maxConcurrency(1)
        .itemsPath(JsonPath.stringAt("$.inputForMap"))
        .itemSelector(Map.of(
                "item", JsonPath.stringAt("$.Map.Item.Value")))
        .resultPath("$.mapOutput")
        .build();

map.itemProcessor(new Pass(this, "Pass State"), ProcessorConfig.builder()
        .mode(ProcessorMode.DISTRIBUTED)
        .executionType(ProcessorType.STANDARD)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var map = new Map(this, "Map State", new MapProps {
    MaxConcurrency = 1,
    ItemsPath = JsonPath.StringAt("$.inputForMap"),
    ItemSelector = new Dictionary<string, object> {
        { "item", JsonPath.StringAt("$.Map.Item.Value") }
    },
    ResultPath = "$.mapOutput"
});

map.ItemProcessor(new Pass(this, "Pass State"), new ProcessorConfig {
    Mode = ProcessorMode.DISTRIBUTED,
    ExecutionType = ProcessorType.STANDARD
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
map := sfn.NewMap(this, jsii.String("Map State"), &MapProps{
	MaxConcurrency: jsii.Number(1),
	ItemsPath: sfn.JsonPath_StringAt(jsii.String("$.inputForMap")),
	ItemSelector: map[string]interface{}{
		"item": sfn.JsonPath_*StringAt(jsii.String("$.Map.Item.Value")),
	},
	ResultPath: jsii.String("$.mapOutput"),
})

map.ItemProcessor(sfn.NewPass(this, jsii.String("Pass State")), &ProcessorConfig{
	Mode: sfn.ProcessorMode_DISTRIBUTED,
	ExecutionType: sfn.ProcessorType_STANDARD,
})
```

## Members

| Member | Description |
| --- | --- |
| `INLINE` | Inline Map mode. |
| `DISTRIBUTED` | Distributed Map mode. |

## Referenced by

- [`ProcessorConfig`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.ProcessorConfig.html).mode
- [`State`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.State.html).processorMode
