I recently built a LangGraph graph to summarize news on a daily basis to Slack and then wait for replies to the Slack message. When I run the graph from LG Studio in LGP it works great and the Slack replies the graph thread to restart. However, when the graph is run from a cron job, replying to the Slack message doesn’t restart the graph.
After some investigation I found out that there are two modes to set up cron jobs:
- stateless - these don’t persist the thread after they finish
- on an existing thread - add new runs to an existing thread
Stateless is the default and causes the behavior explained above. Running on an existing thread means that I won’t be able to have multiple graphs waiting on replies to different Slack threads.
Neither of these match what I want which is to start on new thread on a schedule and persist the thread after the thread is interrupted. Is this on the development roadmap or is there some reason it wasn’t implemented?