Problem with AI-Task

I have a problem with creating my automation using AI Task.
The variable that I want to write and insert into a text helper does not work.
I always get the following error:
Error rendering data template: UndefinedError: ‘ai_response’ is undefined

Does anyone have a working automation so that I can test this?

Here is my yaml:

alias: Tatortkritik aktualisieren
description: >
  Ruft über AI den nächsten Tatort oder Polizeiruf ab und schreibt die
  Zusammenfassung in input_text.tatortkritik
triggers:
  - at: "09:00:00"
    trigger: time
conditions: []
actions:
  - response_variable: ai_response
    data:
      task_name: Tatortkritik
      entity_id: ai_task.openai_ai_task
      instructions: >-
        Suche im Internet nach dem nächsten Tatort oder Polizeiruf 110, der
        ausgestrahlt wird. Fasse die Informationen in 5 Sätzen zusammen: 1. Wo
        die Folge spielt 2. Wann sie im Fernsehen läuft 3. Wer ermittelt 4.
        Worum es inhaltlich geht 5. Wie die ersten Kritiken oder
        Zuschauerreaktionen ausfallen. Bitte antworte kompakt, sachlich und ohne
        HTML. Bitte achte auch darauf 250 zeichen nicht zu überschreiten.
    action: ai_task.generate_data
  - target:
      entity_id: input_text.tatortkritik
    data:
      value: "{{ ai_response.data }}"
    action: input_text.set_value
mode: single

Have you compared yours with the example in the docs?

template:
  - triggers:
      - trigger: homeassistant
        event: start
      - trigger: time_pattern
        minutes: "/5"  # update every 5 minutes
    actions:
      - action: ai_task.generate_data
        data:
          task_name: "{{ this.entity_id }}"
          instructions: >-
            This is the inside of my goose coop. How many birds (chickens, geese, and
            ducks) are inside the coop?
          structure:
            birds:
              selector:
                number:
          attachments:
            media_content_id: media-source://camera/camera.chicken_coop
            media_content_type: image/jpeg
        response_variable: result
    sensor:
      - name: "Chickens"
        state: "{{ result.data.birds }}"
        state_class: total

Yes, I have compared it with the examples from the website.
Unfortunately no success.