Strange Date Behavior in Parent-Child Workflow Pattern - Date Changes During Execution

Hi Temporal community,

I’m experiencing unexpected behavior with date handling in a parent-child workflow pattern and would appreciate any insights.

Setup

  • Parent Workflow A: Long-running workflow that orchestrates multiple child workflows

  • Child Workflows: 1000+ child workflows, each processing ~5 minutes per activity

  • Total execution time: Spans across midnight (starts one day, finishes the next)

Expected Behavior

// Parent workflow - called ONCE at the top
currentDate := getCurrentDate() // Returns "2025-05-01"

// Loop to start child workflows
for i := 0; i < 1000; i++ {
    childWorkflow.Start(currentDate) // Should always pass "2025-05-01"
}

Actual Behavior

  • First batch of child workflows receive 2025-05-01 :white_check_mark:

  • Later child workflows (after midnight) receive 2025-05-02 :cross_mark:

Questions

  1. Why is the date changing? I only call getCurrentDate() once at the parent level and pass the same variable to all children.

  2. Is this related to Temporal’s replay mechanism? Could workflow replay be re-executing the date capture logic?

  3. Determinism concerns? Should I be using workflow.Now() instead of a custom getCurrentDate() function?

Are you using workflow.Now to get current date?

we are using time.Now().UTC()

This API is prohibited inside the workflow code as it is not deterministic.