client.commands.workflow

Workflow-related commands.

Commands for querying and managing workflow state, including: - Status queries - Task listings - Reset and resume operations - Concurrency limits - Log file paths

Attributes

logger

Functions

workflow_status(→ pandas.DataFrame)

Get metadata about workflow progress.

workflow_tasks(→ pandas.DataFrame)

Get metadata about task state for a given workflow.

workflow_reset(→ str)

Reset a workflow to allow re-running.

concurrency_limit(→ str)

Update a workflow's max_concurrently_running field in the database.

get_filepaths(→ dict)

Get the stdout/stderr paths of tasks in a workflow.

resume_workflow_from_id(→ None)

Resume a workflow from its ID.

Module Contents

client.commands.workflow.logger
client.commands.workflow.workflow_status(workflow_id: List[int] | None = None, user: List[str] | None = None, json: bool = False, limit: int | None = 5, requester: jobmon.core.requester.Requester | None = None) pandas.DataFrame

Get metadata about workflow progress.

Parameters:
  • workflow_id – workflow_id/s to retrieve info for. If not specified will pull all workflows by user

  • user – user/s to retrieve info for. If not specified will return for current user.

  • limit – return # of records order by wf id desc. Return 5 if not provided; return all if [], [<0].

  • json – Flag to return data as JSON

  • requester – object to communicate with the flask services

Returns:

dataframe of all workflows and their status

client.commands.workflow.workflow_tasks(workflow_id: int, status: List[str] | None = None, json: bool = False, limit: int = 5, requester: jobmon.core.requester.Requester | None = None) pandas.DataFrame

Get metadata about task state for a given workflow.

Parameters:
  • workflow_id – workflow_id/s to retrieve info for

  • status – limit task state to one of [PENDING, RUNNING, DONE, FATAL] tasks

  • json – Flag to return data as JSON

  • limit – return # of records order by wf id desc. Return 5 if not provided

  • requester – object to communicate with the flask services

Returns:

Dataframe of tasks for a given workflow

client.commands.workflow.workflow_reset(workflow_id: int, partial_reset: bool = False, requester: jobmon.core.requester.Requester | None = None) str

Reset a workflow to allow re-running.

Parameters:
  • workflow_id – the workflow id to be reset.

  • partial_reset – if False, tasks in D state will be reset as well

  • requester – http server interface.

Returns:

A string indicating the workflow_reset result.

client.commands.workflow.concurrency_limit(workflow_id: int, max_tasks: int, requester: jobmon.core.requester.Requester | None = None) str

Update a workflow’s max_concurrently_running field in the database.

Used to dynamically adjust the allowed number of jobs concurrently running.

Parameters:
  • workflow_id – ID of the running workflow whose max_running value needs to be reset

  • max_tasks – new allowed value of parallel tasks

  • requester – object to communicate with the flask services

Returns:

String displaying success or failure of the update.

client.commands.workflow.get_filepaths(workflow_id: int, array_name: str = '', job_name: str = '', limit: int = 5, requester: jobmon.core.requester.Requester | None = None) dict

Get the stdout/stderr paths of tasks in a workflow.

Parameters:
  • workflow_id – ID of the workflow to query

  • array_name – Optional filter by array name

  • job_name – Optional filter by job name

  • limit – Maximum number of results to return

  • requester – object to communicate with the flask services

Returns:

Dictionary of file paths for task instances

client.commands.workflow.resume_workflow_from_id(workflow_id: int, cluster_name: str, reset_if_running: bool = True, log: bool = True, timeout: int = 180, seconds_until_timeout: int = 36000, increase_resource: bool = True, force_cleanup: bool = False) None

Resume a workflow from its ID.

Given a workflow ID, resume the workflow. Raises an error if the workflow is not completed successfully on resume.

Parameters:
  • workflow_id – The workflow ID to resume

  • cluster_name – Name of the cluster to run on

  • reset_if_running – Whether to reset currently running jobs (cold resume)

  • log – Whether to configure client logging

  • timeout – Timeout for distributor heartbeat and waiting for resume

  • seconds_until_timeout – Overall execution timeout

  • increase_resource – Whether to increase resources for failed tasks

  • force_cleanup – Force cleanup of stuck KILL_SELF task instances