See How can I convert multiple pages file to … - Apple Community
I provided two different approaches for exporting Pages documents to PDF (or Word) as Apple Shortcuts solutions.
The first, on May 16, is intended for macOS Sequoia only as it uses a Shortcut action unique to that operating system. It quickly and silently exports Pages documents that you have previously selected in the Finder. The exported document is written in the same location.
The second Shortcut solution posted on May 20 can be used on Sequoia, Sonoma, or Monterey allowing one to select a combination of Pages documents and/or folders containing them. It then performs Pages document conversions to user-selected PDF or Word documents. Again, the exported documents are written in the original Pages document location(s). This Shortcut is "noisy" as it must open each Pages document in Pages and perform the export.
I have never written anything to automate the export of Numbers worksheets to Excel.