uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
339 stars 128 forks source link

Provide workflow start time same as in Temporal GoSDK #1204

Open longquanzheng opened 1 year ago

longquanzheng commented 1 year ago

Need to sync this small feature from Temporal GoSDK

It is useful to know the start time in workflow for business.

Groxx commented 1 year ago

Yeah, we were actually just discussing this lately too. Along with cron-"fired at" time.

How is it built in temporal, and which times do you use? (task-scheduled, workflow-created, cron-timer-fired-database-time, etc?) It'd be interesting for a reference at least.

longquanzheng commented 1 year ago

@Groxx ahh sorry for late response. I think it's the workflow created time or the first task scheduled time based on the description -- these two won't be too different to use in practice.

https://github.com/temporalio/sdk-go/blob/eaa3802876de77500164f80f378559c51d6bb0e2/internal/workflow.go#L957

longquanzheng commented 1 year ago

@Groxx looks like it's from the start event as I guessed: https://github.com/temporalio/sdk-go/blob/eaa3802876de77500164f80f378559c51d6bb0e2/internal/internal_task_handlers.go#L586