It always makes it easier for us to give advice specific to your situation if you share the properly-formatted configuration of your automation or script.
Depending on how the automation is designed, that's probably not how it works... so you probably don't need to worry about that.
You may want to review Automation Modes. Again, whether that applies to your situation will depend on the design of the automation.