Represents a task in a plan. A task is associated with a plan and can have various statuses, execution times, and retries.

Constructors

  • Creates an instance of the Task class.

    Parameters

    • id: string

      The unique identifier for the task.

    • plan_id: string

      The ID of the plan this task belongs to.

    • partition_key: number

      A partition key for sharding or distribution.

    • status: TaskStatus

      The status of the task (e.g., CREATED, PROCESSING, SUCCESS).

    • created_at: number

      The timestamp when the task was created.

    • Optionalexecuted_at: number

      The timestamp when the task was executed. Optional.

    • Optionalnext_execution_at: number

      The timestamp for the next task execution. Optional.

    Returns Task

Properties

created_at: number

The timestamp (in milliseconds) when the task was created.

executed_at?: number

The timestamp (in milliseconds) when the task was executed. Optional.

id: string

The unique identifier for the task.

next_execution_at?: number

The timestamp (in milliseconds) when the task is scheduled to be executed next. Optional.

partition_key: number

A partition key for sharding or distribution.

plan_id: string

The ID of the plan this task belongs to.

status: TaskStatus

The status of the task (e.g., CREATED, PROCESSING, SUCCESS).