How to add a 5-minute pause in Shortcuts while screen is locked?

Hi everyone,

I’m trying to build a Shortcut that includes a pause (like “Wait 5 minutes”) before continuing. The problem is that the built-in “Wait” action only works while the screen is unlocked — as soon as I lock the phone, the countdown stops.

Is there any way to make a pause work with the screen locked?

  • Maybe with JavaScript for Automation?

  • Or using third-party apps/integrations with Shortcuts?

  • Or some trick with timers or notifications?

Basically I want the Shortcut to continue automatically after 5 minutes, without me keeping the screen on the whole time.

Has anyone managed to set this up? Any suggestions are welcome!

The OS is limiting the resources and sleeping any long running shortcut. You need to move the timing outside the reach of the OS. So if your next action is something other than say a notification (which you could have some web services generate to your device with the right apps and setup, you probably want to be looking at Pushcut and in particular the server component.

2 Likes

I think Shortcuts would timeout on a 5 minute wait, even if your screen was unlocked.

An option would be to use Pushcut – the paid version would be needed, I think, and it’s Schedule Shortcut action. You could split your Shortcut in two; at the end of the first Shortcut, you submit the second Shortcut to run in 5 minutes time.

If you need to pass data into the second Shortcut, the free app Data Jar can allow for that.

I am not affiliated with either app at all, just a user of them.

Hope this helps.

(Beaten to the post by @sylumer :grin::+1:)

A shortcut will keep running constantly when the phone is locked if you play music or background sounds. You can set the volume to zero:

1 Like

@gluebyte Worked as a charm! Thank you!