(aws-events-targets): Allow setting executionName on EventBridge => StepFunctions SfnStateMachine target
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Currently, the aws-events-targets.SfnStateMachine target in CDK does not allow setting a custom executionName when triggering a Step Function via EventBridge.
However, the [Step Functions StartExecution API](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html) does support passing a custom name. This is extremely useful for observability, debugging, and idempotency — especially in recurring scheduled workflows.
In the CDK L2 construct, the SfnStateMachineProps interface does not include an executionName field.
### Use Case
- Makes executions easier to track with human-readable names.
- Enables idempotency strategies (using name to dedupe).
- Avoids requiring a proxy Lambda just to pass through custom execution names.
### Proposed Solution
Add an optional executionName property to SfnStateMachineProps:
```ts
interface SfnStateMachineProps {
...
executionName?: string | events.EventField;
}
```
This would allow code like:
```ts
new events.Rule(this, 'MyRule', {
schedule: events.Schedule.rate(Duration.minutes(15)),
targets: [
new targets.SfnStateMachine(myStateMachine, {
executionName: "something" + events.EventField.fromPath('$.id'),
input: events.RuleTargetInput.fromObject({ ... }),
}),
],
});
```
### Other Information
Workaround Today:
Only option is to use a Lambda as a proxy, which defeats the simplicity of direct EventBridge => Step Functions integration.
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
2.196.1
### AWS CDK CLI version
2.1016.0 (build 66e0b2d)
### Environment details (OS name and version, etc.)
Ubuntu 24.04.2 LTS
Contributor guide
Research direction
Start by locating the aws-events-targets SfnStateMachine target and its SfnStateMachineProps interface, then inspect how the target maps options to the Step Functions StartExecution request. Add the optional executionName string or EventField support and verify that the generated EventBridge target passes it through correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100