-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create type safe way to pass workflow arguments to ScheduleWorkflow
#1
Comments
it works because i just grab the name of the function if given a function 🤷♂️ but appreciate the other points... will get to it eventually |
regarding this - i actually think this is correct, because these types are meant for the child workflow, NOT the top/parent/scheduler workflow |
I don't think it should work because you need to serialize the function into a payload which isn't possible |
You're correct, I forgot that the workflow is always executed as a child |
ok ok i understand you now. good point |
Current example in README is both type unsafe and doesn't work because functions are not JSON serializable, this helper addresses the issue and adds type-safety:
Also this type uses the child workflow options which aren't the same as the client's workflow options, you might want to fix that while you're at it https://github.com/sw-yx/temporal-time-utils/blob/d2f6d7aebcc6c537c518e49abadd1245ce4b126d/packages/temporal-time-utils/ScheduleWorkflow.ts#L30
The text was updated successfully, but these errors were encountered: