Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Validation Rules Reference

This chapter is an exhaustive checklist of rules that a validation SDK must enforce when checking a workflow template ZIP. Rules are categorized by severity.

ERROR rules block import — Agent Studio will reject the ZIP if these fail.

WARNING rules indicate issues that won’t prevent import but may cause problems at runtime.

Structural Rules (ERROR)

RuleDescription
S-001ZIP must contain workflow_template.json at the root level (not nested in a subdirectory)
S-002workflow_template.json must be valid JSON
S-003If any tool templates exist, the studio-data/tool_templates/ directory must exist in the ZIP
S-004If any icons are referenced, the studio-data/dynamic_assets/ directory must exist in the ZIP

Manifest Rules (ERROR)

RuleDescription
M-001template_version field must be present (currently "0.0.1")
M-002workflow_template field must be present and be an object
M-003agent_templates field must be present and be an array
M-004tool_templates field must be present and be an array
M-005task_templates field must be present and be an array
M-006mcp_templates field must be present and be an array (may be empty)
M-007workflow_template.id must be a non-empty string
M-008workflow_template.name must be a non-empty string
M-009Every element in agent_templates, tool_templates, mcp_templates, task_templates must have an id field

Cross-Reference Integrity Rules (ERROR)

RuleDescription
X-001Every UUID in workflow_template.agent_template_ids must match an agent_templates[].id
X-002Every UUID in workflow_template.task_template_ids must match a task_templates[].id
X-003If workflow_template.manager_agent_template_id is set, it must match an agent_templates[].id
X-004Every UUID in each agent_templates[].tool_template_ids must match a tool_templates[].id
X-005Every UUID in each agent_templates[].mcp_template_ids must match a mcp_templates[].id
X-006If task_templates[].assigned_agent_template_id is set, it must match an agent_templates[].id
X-007No duplicate IDs across all entity arrays (all IDs must be unique within the manifest)

Tool Validation Rules (ERROR)

RuleDescription
T-001Every tool_templates[].source_folder_path must reference a directory that exists in the ZIP
T-002Each tool directory must contain a file matching python_code_file_name (typically tool.py)
T-003Each tool directory must contain a file matching python_requirements_file_name (typically requirements.txt)
T-004tool.py must parse as valid Python (no syntax errors)
T-005tool.py must contain a class named UserParameters
T-006tool.py must contain a class named ToolParameters
T-007tool.py must contain a function named run_tool

Tool Validation Rules (WARNING)

RuleDescription
T-W01tool.py should define OUTPUT_KEY at module level
T-W02tool.py should contain an if __name__ == "__main__": block
T-W03requirements.txt should list pydantic as a dependency
T-W04UserParameters should inherit from BaseModel
T-W05ToolParameters should inherit from BaseModel

Name Validation Rules (ERROR)

RuleDescription
N-001Every tool_templates[].name must match the regex ^[a-zA-Z0-9 ]+$ (alphanumeric and spaces only)
N-002Tool template names must be unique within the manifest

Icon Validation Rules (ERROR)

RuleDescription
I-001If tool_image_path is non-empty, the file must exist in the ZIP
I-002If agent_image_path is non-empty, the file must exist in the ZIP
I-003If mcp_image_path is non-empty, the file must exist in the ZIP
I-004Icon file extensions (lowercased) must be one of: .png, .jpg, .jpeg

Process Mode Rules (WARNING)

RuleDescription
P-W01If process is "hierarchical", either manager_agent_template_id should be set or use_default_manager should be true
P-W02If process is "sequential", all task templates should have assigned_agent_template_id set

ID Format Rules (WARNING)

RuleDescription
F-W01All id fields should be valid UUID format (8-4-4-4-12 hex pattern)