Open Quinn-With-Two-Ns opened 1 year ago
I also run into this problem, one possible way is to use the deprecated GetInfo
api
var startTime time.Time
p := workflow.GetInfo(ctx).SearchAttributes.GetIndexedFields()["TemporalScheduledStartTime"]
err := converter.GetDefaultDataConverter().FromPayload(p, &startTime)
The new typed api workflow.GetTypedSearchAttributes(ctx).GetTime()
requires internal.SearchAttributeKeyTime
, which cannot be referenced inside workflow
requires internal.SearchAttributeKeyTime, which cannot be referenced inside workflow
This is available on the temporal
package: https://pkg.go.dev/go.temporal.io/sdk/temporal#SearchAttributeKeyTime
Is your feature request related to a problem? Please describe.
When a workflow is started by a schedule some extra information is written to search attributes
Currently the only way to access this info is through search attributes, this is difficult for users to discover and work with in some SDKs
Describe the solution you'd like
A separate API to return this information if the workflow was started by a schedule.
Additional context
(https://temporalio.slack.com/archives/CTDTU3J4T/p1678200766095479)