Metadata
Introduction
Metadata is a key-value store available on Tasks and Runs. It lets you attach your own data to resources for tracking, filtering, or identification.
For example, you might store the uploader's user_id to identify who triggered the task.
Usage
Keys
- You can add up to 32 keys per object
- Metadata keys can be up to 32 characters
- Metadata keys must contain only letters, numbers and underscores
- Keys must use UTF-8 encoding
Values
- Metadata values must be 2048 characters or fewer
- Metadata values must be strings. If you need to use non-string values in your application, you will need to parse them (e.g.
const episodeNumber = parseInt(metadata.episode)) - Values must use UTF-8 encoding
Be careful when checking boolean values. Because metadata values are strings, you will need to check for "true" or "false" instead of true or false.
Adding metadata
Include a metadata object when creating a task or run:
You can also add metadata to individual tasks within a Run or Workflow: