Combine / Template Automation?

My automation is below. Is there a way to automate this to allow for Fermentation Step N number of steps? Right now I hard coded 10 in, but I could see a scenario where I need more.

I would love a single automation that can handle every step, as they are all essentially the same, but with different input_datetime and input_target_temp

alias: Fermenter 2 Fermentation Step 1
description: ""
  - platform: time
    at: input_datetime.fermenter_2_fermentation_step_1
  - condition: numeric_state
    entity_id: input_number.fermenter_2_fermentation_step_1_temp
    above: 33
  - condition: state
    entity_id: input_boolean.fermenter_2_auto_temperature_control
    state: "on"
  - service: input_number.set_value
      entity_id: input_number.fermenter_2_target_temperature
      value: "{{ states('input_number.fermenter_2_fermentation_step_1_temp') }}"
  - service: notify.joe
      message: >-
        Fermenter 2 Temp set to {{
        states('input_number.fermenter_2_fermentation_step_1_temp') }}
      title: "#2 Fermentation Step 1"
        clickAction: lovelace-brewery/fermenter-2
        color: white
        notification_icon: mdi:beer
mode: single

I’ve done something like that for my hot water scheduling. See this topic: Setting up multiple / complex automation — I start off hard-coding the entities and end up (at this post) using groups. Other people also suggest things that may help.

My current code:

- alias: Hot water - tank target manager

  description: >-
    This automation updates the value of the tank target based on the values in the
    schedule. The action identifies which slot matches the current time, then sets
    the target to that slot's target value. Slots at midnight are considered unset,
    and ignored. Schedule helpers must be put into one of four groups:
    group.wdhw_times - time helpers for workdays
    group.wehw_times - time helpers for non-workdays
    group.wdhw_tgts -  target number helpers for workdays
    group.wehw_tgts -  target number helpers for non-workdays

  id: 0ac52ecb-3e29-4474-b64b-9261ee9dce4e

    - platform: template
      value_template: "{{ states('sensor.time')~':00' in expand('group.w'~{'on':'d','off':'e'}[states('binary_sensor.workday_sensor')]~'hw_times')|map(attribute='state') }}"

  condition: "{{ states('sensor.time') != '00:00' }}"

    - service: input_number.set_value
        entity_id: input_number.tank_target
        value: >
          {% set g = 'group.'~{'on':'wdhw_','off':'wehw_'}[states('binary_sensor.workday_sensor')] %}
          {{ (expand(g~'tgts')|map(attribute='state')|list)[(expand(g~'times')|map(attribute='state')|list).index(states('sensor.time')~":00")] }}

This looks great. I’ll work my way through the examples today! Thank you