Core Development Concepts > Background Tasks
What to Be Careful About?
You will learn about Background Tasks, how to create new definitions, how to trigger them and how to handle the task run.
This feature is available since Webiny v5.39.0.
What to Be Careful About
Lambda Timeout
AWS Lambda can run up to 15 minutes. Webiny provides a mechanism for checking on how much time is there left before the Lambda times out, but it is up to the developer to use it. You can read about it here.
Step Function Timeout
AWS Step Function can live up to 1 year. This is the maximum time for the Step Function, set by AWS, and it cannot be increased.
Step Function Execution Limit
AWS Step Function has a hard limit of 25,000 state changes - executions. It cannot be increased.
Step Function State Change Limit
AWS Step Function does not provide a built-in mechanism to limit the number of state changes on each task run.
This means that a task can go into unwanted loop and execute up to 25,000 times, which is something that we want to avoid, or at least, control it.
What Webiny does to help with this is count the number of the Lambda handler executions, and if the number is greater than defined, it will end the task with an error.
Default limit: 500
.
To change the limit, see maxIterations
parameter when defining the Background Task.