Skip to main content

Assignment Template

What is it?​

The Assignment Template is a global, single-row configuration that defines the default set of roles and their stage ordering for episode creator assignments. It acts as a reusable blueprint — instead of manually adding the same roles and stages to every episode, a user can click Use Template to instantly populate an episode's creator modal with the standard structure.

Data model​

The template is stored in a single row in the episode_assignment_template table (UUID 00000000-0000-0000-0000-000000000000):

CREATE TABLE episode_assignment_template (
id UUID PRIMARY KEY,
stages JSONB NOT NULL DEFAULT '[]'
);

stages is a JSON array of arrays — each inner array is one stage, containing the role IDs that belong to that stage:

[
["role-uuid-a", "role-uuid-b"],
["role-uuid-c"]
]

How stages work​

Stages define the sequential workflow:

  • Stage 1 starts immediately when the episode begins
  • Stage 2 waits for Stage 1 to complete
  • Stage 3 waits for Stage 2 to complete
  • …

Roles within the same stage run in parallel.

Applying the template to an episode​

  1. Open an episode's Creators modal (episodes list → "Assign" button)
  2. Click Use Template
  3. The template stages are loaded from the API and applied to the modal state
  4. New tasks are created for any roles not already present on the episode
  5. Roles that were already assigned retain their user assignment

If a role in the template already exists in the episode (matched by roleId), its user assignment and order are preserved — the template only adds missing roles, it does not overwrite existing ones.

API​

MethodEndpointPermissionDescription
GET/api/episodes/assignment-templateauthenticatedFetch the template stages
PUT/api/episodes/assignment-templatetemplate:editSave the template stages

Admin management​

See Admin → Assignment Template for how to edit the global template.