How to send user to new page while Server Action is still processing data?

Maybe I need to break this up somehow. Currently, I have a form on page 1 that triggers a Server Action. The server action calls two APIs and then the user is supposed to be sent to another page. The first API gets the parent object and the second API gets all items related to the parent object. The second API has about 10,000 records and I can only get 50 at a time, so it takes a few minutes to complete. I want to send the user to the second page as soon as they have submitted the form, but that is not happening. Currently, the user is stuck on the first page while the Server Action retrieves all data from the second API.

Is there a way to send them to the second page before the Server Action finishes?

I tried to send a 200 Response in the middle of the Server Action, but that appears to stop the Server Action.

Community Page
Last updated: