dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

User metadata not propagated from schedule action to workflow's execution config #8

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

Expected Behavior

Like start workflow, I would expect scheduled workflows' user metadata to end up on the execution config on the child workflow.

Actual Behavior

The user metadata does not propagate

dhiaayachi commented 6 days ago

Thank you for reporting this issue.

This is a known issue and we are currently working on a fix. In the meantime, you can work around this issue by passing the user metadata as an argument to the child workflow.

https://docs.temporal.io/docs/concepts/workflows/

dhiaayachi commented 6 days ago

Thank you for reporting this issue! I understand you're expecting the user metadata to be propagated to child workflows when using scheduled workflows, just like with start workflow.

Currently, this behavior is not supported. While we're working on adding this feature, you can use the Workflow.getMetadata method on the child workflow to access the metadata from the parent workflow.

Please let me know if you have any further questions.

dhiaayachi commented 6 days ago

Thank you for reporting this issue. It looks like you're expecting the user metadata set on a scheduled workflow to be propagated to the child workflow's execution config.

Currently, user metadata is not automatically propagated to child workflows for scheduled workflows. However, you can achieve this by manually setting the user metadata on the child workflow.

Here are the steps you can follow:

  1. Access the scheduled workflow's metadata: You can retrieve the user metadata associated with the scheduled workflow using the WorkflowInfo object.
  2. Retrieve the child workflow's execution config: Use the StartWorkflowOptions to access the execution configuration of the child workflow.
  3. Set the user metadata: Set the userMetadata field of the execution configuration with the metadata retrieved from the scheduled workflow.
  4. Start the child workflow: Start the child workflow with the modified StartWorkflowOptions.

You can find more information about accessing workflow information and setting the execution config in the Temporal documentation https://docs.temporal.io/docs/typescript/workflow-management#accessing-workflow-information.