Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Programmatically Triggered Workflows Do Not Retry on Failure #11354

Open
amrsaud opened this issue Feb 23, 2025 · 2 comments
Open

Programmatically Triggered Workflows Do Not Retry on Failure #11354

amrsaud opened this issue Feb 23, 2025 · 2 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@amrsaud
Copy link

amrsaud commented Feb 23, 2025

Describe the Bug

Description:
When running workflows programmatically in payloadcms3, the workflow is executed only once regardless of its success or failure. This behavior leads to no automatic retries even in cases where the workflow fails. This lack of retry mechanism can cause significant issues in production environments where failures are not uncommon and retrying is critical to ensure task completion.

Steps to Reproduce:

  1. Trigger a workflow programmatically using the payloadcms3 API.
  2. Simulate a failure in the workflow (e.g., by introducing an error or returning a failure status).
  3. Observe that the workflow does not retry after the failure.

Expected Behavior:
The workflow should retry according to the configured retry logic or documented behavior, ensuring that transient failures do not lead to permanent task abandonment.

Actual Behavior:
The workflow is executed only once and does not retry regardless of whether it fails.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload

Reproduction Steps

Steps to Reproduce:

  1. Trigger a workflow programmatically using the payloadcms3 API.
  2. Simulate a failure in the workflow (e.g., by introducing an error or returning a failure status).
  3. Observe that the workflow does not retry after the failure.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
  Node: 22.3.0
  npm: 10.8.3
  Yarn: N/A
  pnpm: 9.13.0
Relevant Packages:
  payload: 3.22.0
  next: 15.1.1
  @payloadcms/db-mongodb: 3.22.0
  @payloadcms/db-postgres: 3.22.0
  @payloadcms/email-nodemailer: 3.22.0
  @payloadcms/graphql: 3.22.0
  @payloadcms/next/utilities: 3.22.0
  @payloadcms/payload-cloud: 3.22.0
  @payloadcms/richtext-lexical: 3.22.0
  @payloadcms/translations: 3.22.0
  @payloadcms/ui/shared: 3.22.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
@amrsaud amrsaud added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Feb 23, 2025
@amrsaud
Copy link
Author

amrsaud commented Feb 23, 2025

Hey @denolfe @DracoBlue @colinramsay @jmas , I really could use your help on this since it's a production issue, thanks for everything you do and the great framework!

@gor3a
Copy link

gor3a commented Feb 23, 2025

@amrsaud Thanks! for reported this issue

@denolfe @colinramsay Can you test current workflow mechanism, because I have same issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants