Map<String, dynamic> toJson() => { type: args, if (nestedSteps.isNotEmpty) 'steps': nestedSteps.map((s) => s.toJson()).toList(), };