Most efficient way for moving multiple jobs to another workspace

I am a little new to CryoSPARC and I have a frequent problem when organizing workspaces.

If I want to move many jobs from workspace A to workspace B, I have to do so one by one, by:

  • Navigating to workspace A
  • Navigating to job X
  • Clicking Move Job in job actions
  • Wait for the job to move to workspace B, upon which cryoSPARC navigates me to workspace B

Repeat the above for each job.

This can be very inefficient especially if running on a remote machine where there is a delay.

I was able to use the API to successfully move jobs to a different workspace. The jobs show up in the new workspace in the CryoSPARC GUI, but once moved, the GUI can no longer interact with them (cannot click on the job to view it in any way).

For reference the commands I used (I would NOT recommend doing this):
cryosparcm cli 'update_job("P1", "J1", {"workspace_id" : "W2"})'
cryosparcm cli 'update_job("P1", "J1", {"workspace_uids" : "W2"})'

My question: Is there a more efficient way than moving each job one by one that does not break the job?

Hi @hti-ryan,
Thanks for your post. Can I ask what is the reason for moving so many jobs from one workspace to another?
It’s relatively easy to move an entire Project and therefore all of its jobs, in cryoSPARC from one instance to another, or to archive it and re-import it later. But we don’t usually see users wanting to move so many jobs within a single project - if you can shed some light on the reason that would be helpful.

Also, the correct CLI functions to move jobs from one workspace to another are:
job_add_to_workspace(project_uid, job_uid, workspace_uid)
job_remove_from_workspace(project_uid, job_uid, workspace_uid)

e.g., cryosparcm cli "job_add_to_workspace('P1', 'J20', 'W3')"

Thank you for your response @spunjani

I think if other users are not needing to move many jobs, then I am probably the issue. Probably not using a good workflow.

I typically find myself moving many jobs when I run through a long chain of jobs, and find the end result unsatisfactory. Then I go back to somewhere in the middle of the chain, where I think the problem occurred, make some changes, and redo the rest of the process from there forward. So I end up with 2 branches; one success and one failure (more several branches if I do this several times).

I then move the jobs in the failed branch to a new workspace to document what happened. Then it is very clean and organized; since I have a start-to-finish successful thread with failed branches in their own workspaces.

(or I do vice-versa and move all the jobs in the successful thread to its own workspace)

I can easily just use one workspace; it just gets cluttered that way.

Hi @hti-ryan,

Thanks for the info, that’s very helpful. I edited my previous message with the correct cli commands for moving jobs to another workspace, but I’m not sure if you would have received the notification. With the updated commands, you should be able to easily move all the jobs you would like to move.

As a side note, for visualizing a “clean” tree, without moving jobs, you can use a trick - locate the last job in a workflow e.g., Sharpening, and move just that job to a new workspace. Then, view the new workspace in Tree view. This will allow you to see all the previous jobs in the workflow that led to this last Sharpening job.

Thank you very much! That helps a lot.

I hope I have enough reasons to revive this topic.

I see that no other people demonstrated support to @hti-ryan here. I come now to say that I very often organize my projects in the very same way as @hti-ryan does. I also cannot believe that we are the only ones. Even yesterday I posted on the topic of ‘clean tree view’ Deleted job still appear in tree view - #10 by jipsaro Seems that the only work around for a clean three view is presented on that thread. Furthermore, not all the jobs that I move to another workspace are disappearing from the previous. Not entirely sure, but it could be a bug.

So, a request to the @team. Could you work on developing a bit on the organization of jobs between workspaces for one of the next releases? I am going to try out the CLI functions that @spunjani gave in this thread, but it would be great to have GUI options working properly.

Have a great day,