Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions metaflow/plugins/argo/argo_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def __init__(
incident_io_metadata: List[str] = None,
enable_heartbeat_daemon=True,
enable_error_msg_capture=False,
workflow_title=None,
workflow_description=None,
):
# Some high-level notes -
#
Expand Down Expand Up @@ -177,6 +179,8 @@ def __init__(
)
self.enable_heartbeat_daemon = enable_heartbeat_daemon
self.enable_error_msg_capture = enable_error_msg_capture
self.workflow_title = workflow_title
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider keeping the title as the current.project_flow_name or current.flow_name and description as the doc strring of the flow

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed changes

self.workflow_description = workflow_description
self.parameters = self._process_parameters()
self.config_parameters = self._process_config_parameters()
self.triggers, self.trigger_options = self._process_triggers()
Expand Down Expand Up @@ -430,6 +434,25 @@ def _base_kubernetes_annotations(self):
"metaflow/project_flow_name": current.project_flow_name,
}
)

# Add Argo Workflows title and description annotations
# https://argo-workflows.readthedocs.io/en/latest/title-and-description/
# Use CLI-provided values or auto-populate from metadata
title = (
(self.workflow_title.strip() if self.workflow_title else None)
or current.get("project_flow_name")
or self.flow.name
)

description = (
self.workflow_description.strip() if self.workflow_description else None
) or (self.flow.__doc__.strip() if self.flow.__doc__ else None)

if title:
annotations["workflows.argoproj.io/title"] = title
if description:
annotations["workflows.argoproj.io/description"] = description

return annotations

def _get_schedule(self):
Expand Down
20 changes: 20 additions & 0 deletions metaflow/plugins/argo/argo_workflows_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ def argo_workflows(obj, name=None):
show_default=True,
help="Capture stack trace of first failed task in exit hook.",
)
@click.option(
"--workflow-title",
default=None,
type=str,
help="Custom title for the workflow displayed in Argo Workflows UI. Defaults to `project_flow_name`. Supports markdown formatting.",
)
@click.option(
"--workflow-description",
default=None,
type=str,
help="Custom description for the workflow displayed in Argo Workflows UI. Defaults to the flow's docstring if available. Supports markdown formatting and multi-line text.",
)
Comment on lines +230 to +241
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an existing use-case for the CLI options for setting custom title/description that warrants adding these as well? Not opposed to adding this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown support does not seem to be working, unless there's something off with my argo setup?

  • markdown in custom title/description is not being formatted in Argo UI
  • multi-line descriptions are rendered as one-liners (e.g. multi-line docstring)

Copy link
Contributor Author

@ShreehariVaasishta ShreehariVaasishta Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an existing use-case for the CLI options for setting custom title/description that warrants adding these as well? Not opposed to adding this.

The CLI flags let users provide concise, meaningful titles and descriptions (e.g. ETL [Prod], ML Pipeline v2.3.1) without changing code or flow names. It’s fully optional and backward-compatible, just giving flexibility for UI readability and dynamic deployments.


The markdown support does not seem to be working, unless there's something off with my argo setup?

  • markdown in custom title/description is not being formatted in Argo UI
  • multi-line descriptions are rendered as one-liners (e.g. multi-line docstring)

Verified working with Argo Workflows v3.6+ - headers, bold/italic, and multi-line formatting render correctly. Older UI versions may flatten multi-line text.

@click.pass_obj
def create(
obj,
Expand All @@ -248,6 +260,8 @@ def create(
incident_io_alert_source_config_id=None,
incident_io_metadata=None,
enable_heartbeat_daemon=True,
workflow_title=None,
workflow_description=None,
deployer_attribute_file=None,
enable_error_msg_capture=False,
):
Expand Down Expand Up @@ -312,6 +326,8 @@ def create(
incident_io_metadata,
enable_heartbeat_daemon,
enable_error_msg_capture,
workflow_title,
workflow_description,
)

if only_json:
Expand Down Expand Up @@ -658,6 +674,8 @@ def make_flow(
incident_io_metadata,
enable_heartbeat_daemon,
enable_error_msg_capture,
workflow_title,
workflow_description,
):
# TODO: Make this check less specific to Amazon S3 as we introduce
# support for more cloud object stores.
Expand Down Expand Up @@ -750,6 +768,8 @@ def make_flow(
incident_io_metadata=incident_io_metadata,
enable_heartbeat_daemon=enable_heartbeat_daemon,
enable_error_msg_capture=enable_error_msg_capture,
workflow_title=workflow_title,
workflow_description=workflow_description,
)


Expand Down
Loading