function validateWorkflow(data) { const errors = []; if (!data.name || data.name.trim().length === 0) { errors.push('Name is required'); } if (data.name && data.name.length > 100) { errors.push('Name must be less than 100 characters'); } if (errors.length > 0) { throw new ValidationError(errors); } return true;}