> **Experimental**
>
> `@aws-cdk/aws-pipes-targets-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# StateMachineInvocationType

InvocationType for invoking the State Machine.

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/stepfunctions.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-pipes-targets-alpha/lib/stepfunctions.ts#L31)

## Example

TypeScript:

```ts
declare const sourceQueue: sqs.Queue;
declare const targetStateMachine: sfn.IStateMachine;

const pipeTarget = new targets.SfnStateMachine(targetStateMachine, {
    invocationType: targets.StateMachineInvocationType.FIRE_AND_FORGET,
});

const pipe = new pipes.Pipe(this, 'Pipe', {
    source: new SqsSource(sourceQueue),
    target: pipeTarget
});
```

Python:

```python
# source_queue: sqs.Queue
# target_state_machine: sfn.IStateMachine

pipe_target = targets.SfnStateMachine(target_state_machine,
    invocation_type=targets.StateMachineInvocationType.FIRE_AND_FORGET
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

Java:

```java
Queue sourceQueue;
IStateMachine targetStateMachine;

SfnStateMachine pipeTarget = SfnStateMachine.Builder.create(targetStateMachine)
        .invocationType(StateMachineInvocationType.FIRE_AND_FORGET)
        .build();

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SqsSource(sourceQueue))
        .target(pipeTarget)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Targets.Alpha
Queue sourceQueue;
IStateMachine targetStateMachine;

var pipeTarget = new SfnStateMachine(targetStateMachine, new SfnStateMachineParameters {
    InvocationType = StateMachineInvocationType.FIRE_AND_FORGET
});

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SqsSource(sourceQueue),
    Target = pipeTarget
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkpipestargetsalpha/v2
var sourceQueue Queue
var targetStateMachine IStateMachine

pipeTarget := targets.NewSfnStateMachine(targetStateMachine, &SfnStateMachineParameters{
	InvocationType: targets.StateMachineInvocationType_FIRE_AND_FORGET,
})

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: awscdkpipessourcesalpha.NewSqsSource(sourceQueue),
	Target: pipeTarget,
})
```

## Members

| Member | Description |
| --- | --- |
| `FIRE_AND_FORGET` | Invoke StepFunction asynchronously (`StartExecution`). |
| `REQUEST_RESPONSE` | Invoke StepFunction synchronously (`StartSyncExecution`) and wait for the execution to complete. |

## Referenced by

- [`SfnStateMachineParameters`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-pipes-targets-alpha.SfnStateMachineParameters.html).invocationType
