Has anyone encountered Workflows failing
Has anyone encountered Workflows failing with the following error:
(instance.in_finite_state) Instance reached a finite state, cannot send events to it15 Replies
Hey 👋 , this means that your instance has completed or errored (or was terminated) before you sent your event to it.
Interesting. The Workflow in question doesn't receive events, but instead is supposed to send them. I'd think there would be an error if it failed, no?
The caller of sendEvent should receive an error if the instance that should receive the event is in a terminal state.
Isn't that the case with yours? (not sure if I understood)
I have parent-child workflows setup, where the parent will spawn other workflows and wait for them to finish with waitForEvent. As far as I can tell, the parent is still waiting when the child fails with that error. See attached for the most recent time I encountered it.


Can you send me the instance ids? You can just link me to both dash pages I can get instance ids from there
Yeah I've had this but it tends to be when one of the workflow internal errors happens
@avenceslau Wanted to followup to see if you had any thoughts
Not yet will investigate as soon as I can sorry about that
No worries! Thanks a lot
Hi would you mind sharing the relevant code, you can send it to me via DM if you prefer
Apologies for the delay. Here's the relevant code. The idea behind it is to get around the 1k subrequest limit per worker invocation. So for any subrequest-intensive work, I dispatch the relevent information to a separate Workflow to make all of the subrequests.
Hi, I have a couple of questions:
- Is your
SubrequestManager.ts supposed to run as a workflow? or will it run inside a step?
- Are you still getting the same errors as of right now? We made a few changes that will minimize internal workflows errors and help with send/receive eventHey!
1. Yes, you would create a
new SubRequestManager in the primary Workflow, which would then create and wait for an instance of a separate (secondary) Workflow to run to completion. The odd thing is that I was getting the above errors in the secondary Workflow, even though the primary Workflow was still waiting on an event.
2. I have not, but also haven't tried! I will test and report backIf you run SubRequestManager as a workflow I would do this
await subRequestWorkflow.create({ params: payload }); inside of a step.do, a workflow might "restart" for many reasons, and operations with side effects should run inside a step.do so that we can ensure that it only runs once.