State machine calls a lambda but lambda times out (when I understand there shouldn't be one)

Hey guys;

I have a process that can take some time and I don’t want things to time out in an uncontrolled fashion…so I reached for a step function.

I declared a state machine with a single task that references a Lambda hoping my Lambda could happily churn away until completion (and I would set a TimeoutSeconds just in case things got ridiculous).

But no, vision and reality conflict. The reality is the lambda function times out (after the default timeout of 6 seconds). I don’t want a timeout on the Lambda itself.

The error displayed when I click on the failed step in the AWS console is like so:
"The cause could not be determined because Lambda did not return an error type. Returned payload: {“errorMessage”:“2021-07-05T21:01:14.951Z f2fd7db1-33ca-4a8c-a7fe-b6fcf8a167b9 Task timed out after 6.01 seconds”}

I am starting the state machine in a API Gateway Lambda trigger using AWS.StepFunctions().startExecution.

How do I hook things up so the Lambda does not time out? Do I need to send a heartbeat?

Any pointers greatly appreciated…I feel stumped on this.


StepFunctions Can run up to 1 year.
But the individual Lambda functions still have the same limitations they have when used outside of a StepFunction. So you can set a timeout on your individual Lambda functions of up to 15 minutes, but not remove it completely.

That being said, if you have a single process that needs to run longer, you need to break it up in smaller pieces that can fit without the 15 minute max timeout.

1 Like

Thanks for that clarification Brett!