Seqera Platform API - Easily resume a workflow with same settings
acknowledged
E
Emerald Warbler
Last weekend, we had a rare anomaly in which all Nextflow workflows silently "stalled".
I've written code to identify workflows in this condition using the Seqera Platform API. Next I want to cancel and resume the workflows.
Cancel
is straightforward and it's also easy to Resume
via the Seqera Platform/Tower web UI by selecting Resume
from the kebab menu on the right-hand side. But what is a good way to do this via the Seqera Platfom API? We use the /workflow/launch endpoint to initiate workflows. When a workflow is cancelled, Seqera Platform/Tower should have all the information to immediately resume the workflow since it was passed by the initial API POST request.
As I understand the API, the
workflow/launch
endpoint has a Boolean resume
attribute and I see no alternative. It seems rather long-winded to query the API and use those values to repopulate all the payload attributes for the workflow/launch
endpoint, set resume
to True
and send all this back to the endpoint.Is this the recommended approach or is there a better alternative?
Andrew Dawson
Yes, this is the best way to currently resume a workflow (pipeline run). "To resume a workflow, first retrieve the launch configuration using GET /workflow/{workflowId}/launch. Then set workDir to the value from resumeDir, revision to the value from resumeCommitId, and resume to true, then submit the modified payload to this endpoint."
I acknowledge that's not the most user-friendly way I could imagine supporting resume and we'll look to improve this in the future.
Rob Newman
updated the status to
acknowledged