Skip to content

Capturing Apache Hop workflow execution time for logging or email #5810

@rocaver

Description

@rocaver

I have been trying to capture the execution time of a workflow to be able to pass it down to a file or email.
An AI bot showed me that Apache Hop managed this internal variables:
${Internal.Workflow.ExecutionDuration} Total execution time of the workflow, expressed in seconds (e.g., 306 for 5 min 6 sec) or also start/end timestamps (${Internal.Workflow.StartDateTime} / ${Internal.Workflow.EndDateTime}) .

The issue is that I always get 0 seconds as a result. Any guidance is appreciated.

I have been trying:
Add a “Dummy” transform as the last step of the workflow – it does nothing but lets you attach downstream steps.
Connect the dummy to a Calculator (or JavaScript) transform.
Inside the calculator, create three new fields:
duration_min Divide by constant ${Internal.Workflow.ExecutionDuration} / 60
duration_sec Modulo constant ${Internal.Workflow.ExecutionDuration} % 60
duration_str Concatenate ROUND(duration_min,0) + ' min ' + ROUND(duration_sec,0) + ' sec'

Now you have a string like "5 min 6 sec" stored in duration_str.

(If you prefer to keep the raw seconds, you can skip this step and just use ${Internal.Workflow.ExecutionDuration} directly.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions