How to identify the longest running workflow?

@maxim How to identify the longest running workflow across all namespaces ?
Is there a tctl command or some way to do it

Via your SDK client api you could:
a) List all namespaces via ListNameSpaces
b) For each namespace get the first result of ListWorkflowExecutions setting the namespace and query
ExecutionStatus="Completed" ORDER BY StartTime ASC
in its request
(default sort order for running executions is by StartTime descending)
c) Compare the StartTime for each exec you got in b), report the one with earliest start time.

Note that to run the shown visibility query you have to enable enhanced visibility (ordering is not currently available for standard visibility).