How to get Bot start time within a workflow

I have a custom activity and added to my workflow. While executing, the bot must write the start time of the workflow to a text file. How can i get the start time within my custom activity and write to output.

DateTime.Now.ToString() gets you the current time and date

I need the start time of the workflow instead of the current time. How can i get when the workflow execution started?

@dineshary I’m not sure that’s a necessary add-on to your custom activity. You can just use an Assign activity at the beginning of your workflow to mark Now.ToString.

1 Like

assign it in the starting of the workflow as @pathLessTaken said above

I am building a custom activity which can be used by anyone in their workflow. Cant force to add an assign activity to the users.

So i am searching for a way to get the properties of a particular execution

@dineshary

If I understood correctly, you are building a custom activity and need to have property to capture the Start execution time of your activity?
Where does your custom activity derive from? CodeActivity or NativeActivty or AsyncCodeActivty

Yes… right

I am using native activity

Sorry for resurrecting this ancient thread, but I was just searching for the same. The way I would do it now it to search for the latest entry containing message “… execution started” from yyyy-MM-dd_Execution.log file - you can see log file folders from studio by pressing CTRL+L in Studio.
Small problem is that when you want to read contents of that file it won’t let you since robot is actively using it for writing logs when it executes workflow.
Having this available from some kind of environmental variable would be nice tough :slight_smile: