Before digging deeper into the details of writing tasks, you should read the fundamentals of tasks to understand what tasks are and how they work.

Writing tasks

TopicDescription
LoggingView and send logs and traces from your tasks.
Errors & retryingHow to deal with errors and write reliable tasks.
WaitWait for periods of time or for external events to occur before continuing.
Concurrency & QueuesConfigure what you want to happen when there is more than one run at a time.
VersioningHow versioning works.
MachinesConfigure the CPU and RAM of the machine your task runs on
IdempotencyProtect against mutations happening twice.
Reattempting & ReplayingYou can reattempt a task that has failed all of its attempts. You can also replay a task with a new version of your code.
NotificationsSend realtime notifications from your task that you can subscribe to from your backend or frontend.
RollbacksRollback code inside a task when errors happen to provide transactional guarantees.
Using APIsHow to use APIs from within your tasks.
Trigger filtersPrevent unwanted filters where the payload doesn’t match your filter.
MiddlewareMiddleware can wrap the task run function.
Automated testsWrite automated tests in code.