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.
Realtime notificationsSend realtime notifications from your task that you can subscribe to from your backend or frontend.
VersioningHow versioning works.
MachinesConfigure the CPU and RAM of the machine your task runs on
IdempotencyProtect against mutations happening twice.
ReplayingYou can replay a single task or many at once with a new version of your code.
Max durationSet a maximum duration for your task to run.
TagsTags allow you to easily filter runs in the dashboard and when using the SDK.
MetadataAttach a small amount of data to a run and update it as the run progresses.
UsageGet compute duration and cost from inside a run, or for a specific block of code.
ContextAccess the context of the task run.
Bulk actionsRun actions on many task runs at once.

Our library of examples, guides and projects