App Intents are Limited to Thirty Seconds: Extend Execution as Live Activity with LongRunningIntent

Normally, App Intents have a 30-second limit to finish running โ€“ LongRunningIntent helps developers get beyond that by moving to a Live Activity. Plus, CancellableIntent makes sure it can be ended gracefully.

In the WWDC 26 session โ€œDiscover new capabilities in the App Intents framework,โ€ App Intents Engineer Moe Mehrabi covered improvements coming to intents that need to run beyond the 30-second limit โ€“ with LongRunningIntent:

Everything weโ€™ve covered so far makes your entities and parameters more expressive and efficient. Now, letโ€™s talk about execution.

When your intent runs โ€“ from Siri, Shortcuts, or any system surface โ€“ it only has 30 seconds to finish. That works for most everyday actions, but not every intent is that quick.

Now that my app supports tagging and organizing photosโ€ฆ

โ€ฆI wanted to let people share their travel photos โ€“ uploading them to a shared album without opening the app.

So I created an upload intent and added a button to my widget to trigger it.

But with large photos, the upload takes time โ€“ and the intent kept failing because it couldnโ€™t finish within the 30-second limit.

LongRunningIntent fixes this. It lets your intent run beyond the 30-second limit โ€“ and manages the background task lifecycle of your app.

And as your intent runs, progress updates appear automatically as a Live Activity.

Now, letโ€™s check out the code.

Hereโ€™s the intent I wrote to upload my photos.

Iโ€™m conforming to LongRunningIntent.

I take a photo file as input.

Then, I wrap my work in performBackgroundTask for extended execution.

LongRunnningIntent requires the intent to report progress, so the system knows itโ€™s still working and hasnโ€™t stalled. And because it builds on ProgressReportingIntent, I get a built-in progress object to track my work.

I calculate the number of chunks for the fileโ€ฆ

โ€ฆand set the total count.

Then, upload each chunkโ€ฆ

โ€ฆand update the progress as I go.

Hereโ€™s what happens when my intent runs. It can run longer and thereโ€™s a stop button right on the Live Activity, so the person can cancel it at anytime.

Though, itโ€™d be great if my intent got a heads-up before being stopped.

CancellableIntent lets your intent clean up gracefully when cancelled โ€“ whether the person tapped cancel, the system timed out, or needed to reclaim resources.

Hereโ€™s how I can add cancellation support.

I add CancellableIntentโ€ฆ

โ€ฆand implement the onCancel handler. When cancellation reason happens, handler gives me the reasonโ€ฆ

โ€ฆand I can use it to clean up partial uploads or cancel in-flight requests.

LongRunningIntent also supports background GPU access on supported devices for tasks like photo processing or on-device inference. Just make sure to add GPU access to your appโ€™s entitlement.

To learn more about the mechanics of running tasks in the background, check out the session Finish tasks in the background from WWDC25.

As tasks being handled by App Intents become more and more complex, LongRunningIntent will be helpful in making things run smoothly for developers and users. Plus, itโ€™s especially helpful for agents to finish their responses โ€“ like Codex for iOSโ€™ release today.

Watch the full segment on YouTube and check out the Apple Developer documentation on LongRunningIntent, as well as ProgressReportingIntent and Finish tasks in the background.

P.S. If you’re looking for help with your App Intents integration, you can always hire me as a consultant.

Posts You Might Like

Drafts 50 released! Shortcuts Revisited, AppleScript Improved (Client Work)
I had the pleasure of helping Greg Pierce update his Shortcuts support for Drafts โ€“ check out the release.
App Intents: Grouping Parent Parameters Using a Unified Entity Approach
Streaks developer Quentin Zervaas shared this great technique for working with complex parent parameters in App Intents โ€“ grouping them into a single, separate entity.
5 WWDC features Iโ€™ll actually use more than Appleโ€™s new Siri AI ยป
Graham Barlow at TechRadar talks about Describe a Shortcut and how it's coming to Shortcuts for Mac.
Blackbox: Rebooting an Inventive Puzzle Game for VisionOS ยป
Developer Ryan McLeod is featured on the Apple Developer blog to talk about bringing his app Blackbox to Apple Vision Pro and turn his game into a spatial computing experience.