Resume to a suspended Workflow run
I am trying to return to a suspended workflow run using
workflow.createRunAsync({runId: ... }) and I see in the method that it is looking inside the run-map if the run already exists and than looks it up in the snapshot storage but never returns this data, but instead the one in the process run-map. Why is that? I want to resume to my workflow but this way it always creates a new pending one if i am not in the same instance of this workflow class. Like if I have two different requests. How would i approach this? โ Like have a first API call that is starting the workflow and is causing a suspend and second request is continuing the same workflow using the latest workflow run with the specific runId. Help is appreciated ๐ thank u!GitHub
mastra/packages/core/src/workflows/workflow.ts at c710c1652dccfdc41...
The TypeScript AI agent framework. โก Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. - mastra-ai/mastra
4 Replies
๐ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/9441
GitHub
[DISCORD:1432982149681778698] Resume to a suspended Workflow run ยท...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1432982149681778698 I am trying to return to a suspended workflow run using workflow.createRunAsync({runId...
Hi @ewald ! Could you share the code you're using to first start the workflow, and then resume it? Thanks
Sure it is smth like this, I never had a a working state but thats my idea of it:
So this happens on an API endpoint which calls a workflow. But
run.workflowRunStatus might be stale when I call it in the next request.I see, try removing the
step option when you call resume