You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
[TypeScript SDK] schedules.create rejects v1 workflow declarations and crons/schedules do not share the workflow ID cache #5328
In @hatchet-dev/typescript-sdk (main commit 09e3522), hatchet.schedules.create(workflow, input) only accepts legacy v0 workflow types in its TypeScript signature instead of v1 workflow declarations/definitions (and passing a workflow definition object at runtime fails to resolve the workflow name). In addition, hatchet.crons and hatchet.schedules do not share the main hatchet.workflows cache, so calling await hatchet.workflows.delete(name) leaves stale workflow IDs cached when subsequently calling hatchet.crons.list or hatchet.schedules.list.
Steps to reproduce
Declare a v1 workflow with const wf = hatchet.workflow({ name: 'greet' }) and pass wf to hatchet.schedules.create(wf, { triggerAt: new Date(), input: {} }).
Observe the TypeScript type error on schedules.create.
Call await hatchet.crons.list({ workflow: 'greet' }), delete and recreate 'greet' via await hatchet.workflows.delete('greet'), and call await hatchet.crons.list({ workflow: 'greet' }) again; observe that crons.list still uses the deleted workflow's cached ID.
Expected behavior
schedules.create should accept v1 workflow declarations/definitions consistently with schedules.list, and crons and schedules should share the client's workflow cache so workflows.delete() invalidates cached IDs across all feature clients. Happy to open a PR if the team accepts this issue!
Hey @shafiktanbir & @mrkaye97 , let me know if you're already actively working on this PR or if you'd like me to take this over and open a PR with the fixes and unit tests , I've reproduced the issue and the cause.
Hi @mrkaye97 , I've implemented the fix and comprehensive unit tests in PR #5339 (covering schedules.create with v1 workflow definitions/declarations, shared cache eviction on workflows.delete(), and OTel attribute handling).
Whenever a maintainer has a chance to mark this issue accepted and assign it to me, I'll click "Reopen pull request" so it can be reviewed. Thank you!
Activity
Akhand0ps commentedon Oct 26, 2026
Hey @shafiktanbir & @mrkaye97 , let me know if you're already actively working on this PR or if you'd like me to take this over and open a PR with the fixes and unit tests , I've reproduced the issue and the cause.
Akhand0ps commentedon Oct 27, 2026
Hi @mrkaye97 , I've implemented the fix and comprehensive unit tests in PR #5339 (covering
schedules.createwith v1 workflow definitions/declarations, shared cache eviction onworkflows.delete(), and OTel attribute handling).Whenever a maintainer has a chance to mark this issue
acceptedand assign it to me, I'll click "Reopen pull request" so it can be reviewed. Thank you!