Overview
Every job can have its own custom data stored in thedata attribute. This data is serialized to JSON and stored in Redis.
Data Structure
Fromsrc/classes/job.ts:206:
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 theupdateData method:
src/classes/job.ts:599:
Data Serialization
Job data is stored as a JSON string in Redis. Fromsrc/classes/job.ts:522:
Size Limits
You can set a size limit for job data to prevent extremely large payloads:src/classes/job.ts:1557:
Best Practices
Keep data minimal
Keep data minimal
Store only the data needed to process the job. Large payloads increase memory usage and network transfer costs.
Use references for large data
Use references for large data
Instead of storing large files directly, store references (URLs, S3 keys) and fetch the data during processing.
Validate data types
Validate data types
Use TypeScript generics to ensure type safety:
Related Options
Fromsrc/interfaces/base-job-options.ts:75:
API Reference
View the Update Data API Reference
