Skip to content

[TypeScript SDK] schedules.create rejects v1 workflow declarations and crons/schedules do not share the workflow ID cache #5328

Open

Description

@shafiktanbir

Describe the bug

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

  1. Declare a v1 workflow with const wf = hatchet.workflow({ name: 'greet' }) and pass wf to hatchet.schedules.create(wf, { triggerAt: new Date(), input: {} }).
  2. Observe the TypeScript type error on schedules.create.
  3. 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!

Activity

  1. Akhand0ps commented on Oct 26, 2026

    @Akhand0ps

    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.

  2. Akhand0ps commented on Oct 27, 2026

    @Akhand0ps

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions