Skip to content

feature request: [v4] Failed runs are cached when an idempotencyKey is provided. Add the option to not cache failed runs. #2052

Open
@perostlin

Description

@perostlin

Provide environment information

System:
OS: macOS 15.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 133.09 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.11.0 - /opt/homebrew/bin/npm
pnpm: 8.15.6 - /opt/homebrew/bin/pnpm
bun: 1.2.10 - /opt/homebrew/bin/bun

Describe the bug

Hello,

I'm trying to setup Durable Execution, using v4-beta (since 3.3.0 and later doesn't support idempotencyKey).

What I'm currently experiencing is that failed sub task responses are being cached, it feels like completed sub tasks should be cached, but not failed sub tasks.

Maybe I'm missing something, any help is much appreciated!

Reproduction repo

https://github.com/perostlin/trigger.dev-v4-beta

To reproduce

  1. Change the "project" in the trigger.config.ts.
  2. Run the app and trigger.dev:
pnpm install && pnpm dev && pnpm trigger:dev
  1. Test the main task (no payload required).

Additional information

As the screenshot shows it runs the main task two times, the first time the sub-task-2 fails and the second time the sub-task-2 uses cached response.
Image

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