Why do some time-triggered shortcuts run on a locked iPhone and others fail?

I have multiple shortcuts triggered by date / time:

  • In the ‘Automation’ tab they are all set to ‘Run immediately’ and ‘Notify When Run’ is turned off.
  • In the Shortcut Privacy screen ‘Allow running while locked’ is on and access is allowed / always allowed for the required apps and calendars it uses.

Some run while the phone is locked but others consistently don’t.

The only pattern I can see is that the shortcuts with fewer steps seem to be the ones that work.

I know iOS18 introduced more restrictions over shortcuts running while locked but I can’t find any info on what should / shouldn’t work.

Anyone understand this well enough to explain or have a link to help me please?

I am assuming that the shortcuts that only run when the device is unlocked are ones that consistently will only run when the device is unlocked rather than sometimes when it is locked and sometimes when unlocked.

There are actions that can only run when the device is unlocked. These are often donated by third party apps, but not necessarily exclusively. Some processing needs interaction, or for an app to operate in a way it is only permitted to do on an unlocked device, or the action is not written in such a way as to allow it to run when the device is locked.

I have never seen a list of what does and does not worked when locked. Actions get updates when apps get updated and there are potentially a lot of actions out there. To compile a list people would need to test them out, and in some cases it may even be that particular options on an action affect the behaviour.

The only way I know to determine it for a use case is to iteratively test step by step to identify behaviours.

Hope that helps.

1 Like

Thanks for your feedback. Your assumption is correct - all the shortcuts run when unlocked and the same few consistently ‘fail’ (?) when locked.

My shortcuts (both working and failing) all use the same app / data - AnyText (an app to show text in a widget) and iCloud calendars so I know these can both be used whilst locked (in this case - I see what you mean about each app being different though).

As a next step I’ve ‘Reset Privacy’ on one of the problem shortcuts to see if re-granting permissions helps. If that doesn’t work next step is to test my theory that the failure is related to number of steps / data items, but that’s a pain to test.

Resetting privacy caused this message on the next scheduled trigger of the shortcut. I clicked it and gave the permissions (although I thought I already had).

Subsequently I’ve been testing lots of different scenarios and am getting more and more confused:

  • If I schedule the problem shortcut to run in one minute and lock the phone it runs correctly.
  • If I schedule the problem shortcut to run in one hour and lock the phone (for all of that time) it runs correctly.
  • If I force-quit all the app used by the shortcut and try the 2 tests above it runs correctly.
  • If I schedule it for 00:01hrs and lock the phone it fails.

Logging output (now added via the Logger app) shows me all the data is being retrieved and processed correctly - only the step to update AnyText fails (if it fails).

Do you have a particular focus mode active at that time that isn’t active at the other times?

That’s a good point - the 00:01hrs trigger is always when Sleep focus is on. I just tried a single test manually scheduling the shortcut and turning Sleep focus on and it ran successfully. Will need to test with longer delays later.