AWS step function getting executed non-stop

23 Views Asked by At

I am trying to execute an AWS step function from AWS Lamda.
I AWS console, I was able to create the step function and the lamda to execute it. When I try to test the lamda using AWs console, it ends up getting step function invoked non stop.
Although I just tested the lamda once my step function keeps getting invoked util there were 500+ execution in a short time.
I had to delete the step function to stop this endless exection.
Any clue what might be going on here?
Here is my Lamda function code
import { SFNClient, StartExecutionCommand } from "@aws-sdk/client-sfn";
export const handler = async (event) => {
const client = new SFNClient({ region: "my region" });
const input = {
  stateMachineArn: "valid arn for my step function"
};
const command = new StartExecutionCommand(input);
const stepResponse = await client.send(command);

const response = {
 statusCode: 200,
 body: JSON.stringify(' response ' + stepResponse),
};
return response;
};
0

There are 0 best solutions below