Workspaces are a great tool to define a filtered view of the draft list, but sometime you have searches/filters you only want to apply occasionally, or which are based on inputs that change - like input from a prompt in an action.
This Load Temporary Workspace action is a demonstration of something enabled by the recent addition of Workspace scripting.
It is now possible to create a workspace in script, define its various tag filters, query string, sort options, etc., and apply it to the draft list without ever saving that Workspace - so it will not be added to your Workspaces list.
Download the example action. Including the script below as well:
// BEGIN config variables
// setup tags or searches you wish to load...
let name = "Blue Things";
let tagFilter = "blue, !green"
let queryString = "";
// END config variables
// create workspace
// for other options, see:
// https://reference.getdrafts.com/objects/Workspace.html
let ws = Workspace.create();
ws.name = name;
ws.tagFilter = tagFilter;
ws.queryString = queryString;
ws.setInboxSort("modified", true);
// unless you call `ws.update()`, this ws is temporary
// load this workspace, and display draft list
app.applyWorkspace(ws);
app.showDraftList();