Skip to main content
Answer

Turn automations ON and OFF from script

  • November 27, 2021
  • 3 replies
  • 77 views

Forum|alt.badge.img

Hey everyone,
Is it possible to turn automations on and off from a script?
I’m trying to turn them all off automatically during weekends, so messages don’t show up until monday. My caveman way would be something like

const d = new Date();
let day = d.getDay();

if (day !== 0 && day !== 6) {
//Turn all automations off
}

Would that make any sense? Or would it be better if I leave my automations on forever and try to script them in order to only activate on weekdays?

Thanks in advance

Best answer by Justin_Barrett

Welcome to the community, @Gerardo_Hormazabal! :grinning_face_with_big_eyes: Automations can only be turned on/off via the UI at this time. However, there are some early rumblings about a beta for conditional automation branching, which would allow specific parts of automations to only run under certain conditions. Once that is finalized, what you want should be doable, though perhaps not exactly as you outlined.

3 replies

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • November 27, 2021

Welcome to the community, @Gerardo_Hormazabal! :grinning_face_with_big_eyes: Automations can only be turned on/off via the UI at this time. However, there are some early rumblings about a beta for conditional automation branching, which would allow specific parts of automations to only run under certain conditions. Once that is finalized, what you want should be doable, though perhaps not exactly as you outlined.


Forum|alt.badge.img
  • Author
  • New Participant
  • November 27, 2021

Welcome to the community, @Gerardo_Hormazabal! :grinning_face_with_big_eyes: Automations can only be turned on/off via the UI at this time. However, there are some early rumblings about a beta for conditional automation branching, which would allow specific parts of automations to only run under certain conditions. Once that is finalized, what you want should be doable, though perhaps not exactly as you outlined.


Thank you very much for your quick response


Databaser
Forum|alt.badge.img+25
  • Brainy
  • November 28, 2021

Welcome to the community, @Gerardo_Hormazabal! :grinning_face_with_big_eyes: Automations can only be turned on/off via the UI at this time. However, there are some early rumblings about a beta for conditional automation branching, which would allow specific parts of automations to only run under certain conditions. Once that is finalized, what you want should be doable, though perhaps not exactly as you outlined.


Yep, I volunteered, but haven’t seen any changes just yet :pray: