Skip to main content

Overview

Every job can have its own custom data stored in the data attribute. This data is serialized to JSON and stored in Redis.

Data Structure

From src/classes/job.ts:206:
The data parameter accepts any type, which will be serialized to JSON when stored in Redis.

Update Job Data

You can update a job’s data after creation using the updateData method:
From src/classes/job.ts:599:

Data Serialization

Job data is stored as a JSON string in Redis. From src/classes/job.ts:522:
Ensure your job data is JSON-serializable. Objects with circular references, functions, or other non-serializable values will cause errors.

Size Limits

You can set a size limit for job data to prevent extremely large payloads:
From src/classes/job.ts:1557:

Best Practices

Store only the data needed to process the job. Large payloads increase memory usage and network transfer costs.
Instead of storing large files directly, store references (URLs, S3 keys) and fetch the data during processing.
Use TypeScript generics to ensure type safety:
From src/interfaces/base-job-options.ts:75:

API Reference

View the Update Data API Reference