Skip to content

Custom Hook Tokens Cannot Be Reused After Workflow Completion #305

@rRakarare

Description

@rRakarare

Environment

  • Next.js: 15.5.6
  • Workflow Devkit: 4.0.1-beta.12

Issue

Workflows with custom hook tokens cannot be rerun. After first completion, attempting to rerun with the same token fails with:

Workflow "wrun_01K9SDEB1B6A1JZHH..." has status "completed", skipping

Reproduction

"use workflow";

// First run - works
const hook = createHook({
  token: `slack_messages:${channelId}`
});
const result = await hook;

// Resume
await resumeHook(`slack_messages:${channelId}`, slackEvent);

// Second run with same channelId - fails with "completed" status

Expected

Should be able to rerun workflows with the same custom token multiple times, with each creating a new workflow instance.

Question

Is this intended behavior? The docs example uses stable identifiers (like channel IDs) which suggests tokens should be reusable. How should recurring workflows with deterministic tokens be handled?

Metadata

Metadata

Assignees

No one assigned

    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