Script operation failure - fails the entire execution

i used the following configuration to make a test - the endpoint “http://192.168.0.82:2005/test” does not exist and causing a failure so the var set to 0 never happens. is there a way to make the script continue the sequence execution even if one of the calls along the way fails?

  var:
    test:
      friendly_name: "Var Test"

  rest_command:
    rest_test:
      url: http://192.168.0.82:2005/test
      method: POST

  script:
    testing:
      alias: test!
      sequence:
      - service: var.set
        data_template:
          entity_id: var.test
          value: "1"
      - service: rest_command.rest_test
      - delay:
          seconds: 30
      - service: var.set
        data_template:
          entity_id: var.test
          value: "0"

you can call another script or automation at that point in the script and then that script could fail but won’t impact the main script.

1 Like