Skip to content

workflows: this.name is not set when trying to run inside an alarm #933

@jcheese1

Description

@jcheese1

Describe the bug
A clear and concise description of what the bug is.

@callable()
async testSchedule() {
  this.schedule("0 0 * * *", "startWorkflow", {});
}

async startWorkflow() {
  const workflowId = await this.runWorkflow("PROCESSING_WORKFLOW", {});
  ///
}

The above code will result in:

error executing callback "startWorkflow" Error: Attempting to read .name on TestAgent before it was set. The name can be set by explicitly calling .setName(name) on the stub, or by using routePartyKitRequest(). This is a known issue and will be fixed soon. Follow https://github.com/cloudflare/workerd/issues/2240 for more updates.

I attempted a temp fix on the partyserver level here: cloudflare/partykit#331

Expected behavior
The workflow executes even in a scheduled/alarm function on cold wake

Version:
0.4.1

Metadata

Metadata

Assignees

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