WHAT YOU'LL LEARN
  • What is exported from webiny/api/tasks?
  • How to import and use each exported item?

Overview
anchor

This page documents everything exported from webiny/api/tasks. Import any of the items below directly from this path in your Webiny extensions.

TaskDefinition
anchor

Abstraction — imported from webiny/api/tasks

Interface TaskDefinition.Interface:

Core TaskDefinition - minimal interface

MethodDescription
id: string()
title: string()
description?: string()
maxIterations?: number()
databaseLogs?: boolean()
isPrivate?: boolean()
run()Core run method - receives ONLY input params
All runtime dependencies (logging, state management, etc.) come from TaskController
onBeforeTrigger?()Optional lifecycle hooks - receive task data, no context
onDone?()
onError?()
onAbort?()
onMaxIterations?()
createInputValidation?()Create a validation schema for the task input.
This will be used to validate the input before the task is triggered.

Types:

TaskService
anchor

Abstraction — imported from webiny/api/tasks

Interface TaskService.Interface:

Types: