Creating stateless cron should not require thread_id #323

Closed
opened 2026-02-15 18:15:54 -05:00 by yindo · 4 comments
Owner

Originally created by @nigel-daniels on GitHub (Aug 3, 2025).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).

Example Code

The following code in this repository should result in a cron job that runs every ten minutes to greet with a timestamp. However this line in start.ts throws an error:

// Create the cron job
const cron = await client.crons.create(
    'cron',					// Graph name (found in the langgraph.json)
    {
        schedule: schedule, 	// A cron schedule expression : https://crontab.cronhub.io
        input: cronInput		// Input for the cron graph (see ../cron.ts)
    }
);

Looking at the input values the schedule and cronInput look to be correct and the error complains about a required thread_id and an incorrect assistant_id.

Error Message and Stack Trace (if applicable)

Error: HTTP 400: {"success":false,"error":{"issues":[{"code":"invalid_type","expected":"string","received":"undefined","path":["thread_id"],"message":"Required"},{"validation":"uuid","code":"invalid_string","message":"Invalid uuid","path":["assistant_id"]}],"name":"ZodError"}}

Description

The graph deploys as expected but using the cron start.ts throws an error. The code used follows the example of a stateless cron task found here.

System Info

Package versions:

test-repo@1.0.0 /Users/nigel/git/test-repo
├── @langchain/langgraph-cli@0.0.56
├── @langchain/langgraph@0.4.2
├── commander@14.0.0
├── langsmith@0.3.50
├── tsx@4.20.3
└── zod@4.0.14

node version: v22.15.0
npm version: 11.5.2
OS version: macOS Sequoia 15.5

Originally created by @nigel-daniels on GitHub (Aug 3, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I searched the LangGraph.js documentation with the integrated search. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangGraph.js rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package). ### Example Code The following code in this [repository](https://github.com/nigel-daniels/test-repo) should result in a cron job that runs every ten minutes to greet with a timestamp. However this line in `start.ts` throws an error: ```javascript // Create the cron job const cron = await client.crons.create( 'cron', // Graph name (found in the langgraph.json) { schedule: schedule, // A cron schedule expression : https://crontab.cronhub.io input: cronInput // Input for the cron graph (see ../cron.ts) } ); ``` Looking at the input values the schedule and cronInput look to be correct and the error complains about a required `thread_id` and an incorrect `assistant_id`. ### Error Message and Stack Trace (if applicable) ``` Error: HTTP 400: {"success":false,"error":{"issues":[{"code":"invalid_type","expected":"string","received":"undefined","path":["thread_id"],"message":"Required"},{"validation":"uuid","code":"invalid_string","message":"Invalid uuid","path":["assistant_id"]}],"name":"ZodError"}} ``` ### Description The graph deploys as expected but using the cron `start.ts` throws an error. The code used follows the example of a stateless cron task found [here](https://langchain-ai.github.io/langgraphjs/cloud/how-tos/cron_jobs/#cron-job-stateless). ### System Info Package versions: ``` test-repo@1.0.0 /Users/nigel/git/test-repo ├── @langchain/langgraph-cli@0.0.56 ├── @langchain/langgraph@0.4.2 ├── commander@14.0.0 ├── langsmith@0.3.50 ├── tsx@4.20.3 └── zod@4.0.14 ``` node version: `v22.15.0` npm version: `11.5.2` OS version: macOS `Sequoia 15.5`
yindo closed this issue 2026-02-15 18:15:54 -05:00
Author
Owner

@dqbd commented on GitHub (Aug 8, 2025):

Hello! Cron jobs are not implemented on the dev server. Please use @langchain/langgraph up to test cron jobs

@dqbd commented on GitHub (Aug 8, 2025): Hello! Cron jobs are not implemented on the dev server. Please use `@langchain/langgraph up` to test cron jobs
Author
Owner

@nigel-daniels commented on GitHub (Aug 8, 2025):

Hi, could this be reflected in the documentation? I took a look here:

https://langchain-ai.github.io/langgraphjs/concepts/langgraph_server/#cron-jobs (BTW the links are broken on this doc)

and in the how-too:

https://langchain-ai.github.io/langgraphjs/cloud/how-tos/cron_jobs/

This restriction was not obvious and it would be great to let people know how they can test out this feature.

@nigel-daniels commented on GitHub (Aug 8, 2025): Hi, could this be reflected in the documentation? I took a look here: https://langchain-ai.github.io/langgraphjs/concepts/langgraph_server/#cron-jobs (BTW the links are broken on this doc) and in the how-too: https://langchain-ai.github.io/langgraphjs/cloud/how-tos/cron_jobs/ This restriction was not obvious and it would be great to let people know how they can test out this feature.
Author
Owner

@amitchaudharyc commented on GitHub (Nov 27, 2025):

Hi @nigel-daniels , did you manage to run CRON jobs? I am facing same issue. Of course I can at least create CRON on deployed version. But there also it doesn't get triggered. Any idea how to check that the job was at least even triggered or not. I don't see such info in server logs.

@dqbd Any thoughts?

@amitchaudharyc commented on GitHub (Nov 27, 2025): Hi @nigel-daniels , did you manage to run CRON jobs? I am facing same issue. Of course I can at least create CRON on deployed version. But there also it doesn't get triggered. Any idea how to check that the job was at least even triggered or not. I don't see such info in server logs. @dqbd Any thoughts?
Author
Owner

@nigel-daniels commented on GitHub (Nov 27, 2025):

@amitchaudharyc Happy Thanksgiving!! Unfortunately I only have a Dev account so I was unable to fully test this out. If you’re having this issue and have a paid account you may want to reopen.

@nigel-daniels commented on GitHub (Nov 27, 2025): @amitchaudharyc Happy Thanksgiving!! Unfortunately I only have a Dev account so I was unable to fully test this out. If you’re having this issue and have a paid account you may want to reopen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#323