Start and end timestamp of component

Hi all,
Can anyone please help me how to get start and end timestamp of each component in a workflow?

Thank you!

Hi @Anoshpananda
A simple way to do it would be to connect this 2 nodes at the end of each process that you want to capture:

At the end you can collect all the variables created along the workflow.



It’s just giving one column with start time I think, I want two columns with start and end time of component

Just have to capture it before and after … then you can capture both variables.

Hi @Anoshpananda , does it have to be the actual timestamps, or are you just needing to know the elapsed time for each to execute, because if you are wanting the elapsed time, you can drop a Timer Info node onto the end of your flow.


I need actual timestamp (start and end time) of all the components (not nodes but components ) in my workflow.

This is the idea behind…

20210628_TimeStamps.knwf (53.3 KB)

Hi @Anoshpananda, sorry my bad and thanks for the clarification. I cannot think of any “automatic” solutions, and the only solutions I can think of are ultimately variations on what @gonhaddock has said as I don’t think there is going to be any automatic mechanism for this.

Whatever you do will almost certainly involve inserting additional nodes or components into your workflow at the points you wish to monitor.

I have decided to try approaching this from the point of view of creating a component to do some of the work for us. I’ve called it “Record Component Time”, and the idea is that it could be linked into the workflow using the flow variable ports.

So if we had the following workflow, containing two components and a bunch of other nodes:

We could “monitor” the times of those components by stitching in a “Record Component Time” component on either side. This would be configured with a “label/component” name and an indicator of whether it is recording start or stop…


Of course this isn’t just restricted to monitoring components. These could be placed around anything for which you wanted to record start and end times.

Provided they are connected in with the flow variable ports, at the end of this, the final “Record Component Time” component can have its data port read to retrieve the timing information.


The flow data ports are purely for orchestration. The component doesn’t use them for passing the timing data… So just how this data makes its way to the final data port is “using magic” :wink:

(Oh and it might also uses an in-memory H2 database)

Joining up flow ports isn’t ideal, but I cannot think of any simpler way of achieving this. I guess it depends on just how many components you have as to whether this is practical!

Monitoring Start and End.knwf (139.6 KB)

I’ve disconnected the components in this workflow from the hub, so that you don’t get “update?” messages. But you can find it on the hub if need be, here

(Because the “timing” information is stored in H2, the information isn cleared if the workflow gets reset. It also means that it can remain between invocations, so you might find that running a part of the workflow multiple times results in timing data remaining from previous invocations. Reset the whole workflow to clear it down!)


Maybe the console log can give you details as well.

Thanks @takbb , did not know about the in memory h2 database and interesting to see how you use it to adjust the id. I would never have thought that way :laughing:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.