api icon indicating copy to clipboard operation
api copied to clipboard

User metadata on workflows/events for user interface usage

Open cretz opened this issue 1 year ago • 1 comments

What changed?

  • Added temporal.api.sdk.v1.UserMetadata containing payloads for summary and details for general metadata use
  • Added temporal.api.command.v1.Command.user_metadata for general use (initially only for timers and child workflow)
  • Added temporal.api.history.v1.HistoryEvent.user_metadata for general use (initially only for timers)
  • Added temporal.api.workflowservice.v1.StartWorkflowExecutionRequest.user_metadata for general use (initially for populating execution config)
  • Added temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest.user_metadata for same reason as start
  • Added temporal.api.workflow.v1.NewWorkflowExecutionInfo.user_metadata for same reason as start
  • Added temporal.api.workflow.v1.WorkflowExecutionConfig.user_metadata for general use (initially for fixed as-of-start summary/details)
  • Added temporal.api.sdk.v1.WorkflowMetadata.current_details for the ability to have queryable long-form text representing current details of a workflow
  • Removed temporal.api.sdk.v1.WorkflowDefinition.definition because a workflow definition's description isn't best placed on a query (but "current details" is good on the metadata itself)

Why?

  • Users need a way to set fixed summary/details when starting a workflow for use by UIs
  • Users need a way to have query-obtainable live "current details" for use by UIs
  • Users need a way to set a summary when starting a timer for use by UIs
  • All of this needs to be encrypted if the user wants
  • We need to take into account future user-metadata use

Breaking changes

  • Yes for workflow metadata which was only used in JSON form by one SDK (TypeScript) and not even invoked by UI yet

cretz avatar Mar 18 '24 19:03 cretz

All of the fields are just plain text at the moment, right?

Yes, this is documented on the field

Would be nice to understand what the format is.

Mentioned here, I am intentionally leaving that as out-of-scope for now pending some UI discussions. We should not block this progress on that.

cretz avatar Mar 18 '24 20:03 cretz