Hi guys, my organization just started working with temporal. I have this problem and I don’t know how to solve it.
dt_string = datetime.now().strftime("%Y_%m_%d_%H%M%S") async def main(): client = await Client.connect("localhost:7233") await client.create_schedule( "workflow-schedule-id", Schedule( action=ScheduleActionStartWorkflow( YourSchedulesWorkflow.run, dt_string, id="schedules-workflow-id", task_queue="schedules-task-queue", ), spec=ScheduleSpec( intervals=[ScheduleIntervalSpec(every=timedelta(minutes=2))] ), state=ScheduleState(note="Here's a note on my Schedule."), ), ) if __name__ == "__main__": asyncio.run(main())
I want to print current datetime in this “%Y_%m_%d_%H%M%S” format. But every time the workflow ran, it just prints out the first instance of datetime it ran like shown below. How can I print current datetime every time the schedule ran?