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 #48

Open dhiaayachi opened 1 month ago

dhiaayachi commented 1 month 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 1 month ago

Thanks for reporting this issue. It seems you're encountering an issue with user metadata not propagating to child workflows when scheduling a workflow.

Unfortunately, the current behavior is as expected. User metadata is not automatically propagated to child workflows when scheduling.

There are a couple of ways to work around this:

  1. Pass the user metadata manually: You can access the user metadata from the parent workflow and pass it to the child workflow as an argument.
  2. Use a workflow context: You can set the user metadata on a custom workflow context and then pass that context to the child workflow.

For more information on working with user metadata and workflow contexts, please refer to the Temporal documentation:

Let me know if you have any further questions.

dhiaayachi commented 1 month ago

Thank you for reporting this issue! I understand that you're expecting the user metadata from scheduled workflows to be propagated to the child workflow's execution config, similar to how it works with started workflows. Currently, this behavior is not supported.

As a workaround, you can consider storing the user metadata in a shared location accessible by both the scheduled workflow and the child workflow. This could be a Temporal namespace, a database, or a file storage system.

Let me know if you have any further questions or need additional guidance on implementing this workaround.

dhiaayachi commented 1 month ago

Thank you for reporting this issue! It seems like you're expecting scheduled workflow user metadata to propagate to the child workflow execution config, similar to how it works with start workflow.

Unfortunately, this behavior is not currently supported. The user metadata associated with a scheduled workflow is not automatically propagated to the child workflow's execution configuration.

For now, you can work around this by manually setting the user metadata on the child workflow execution. This can be achieved by using the WorkflowOptions builder when starting the child workflow:

WorkflowOptions.newBuilder()
    .setUserMetadata(Map.of("key", "value")) // Replace with desired user metadata
    .build();

We are aware of this issue and are actively considering options for improving the propagation of user metadata. We will keep you updated on any progress.