Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

"Update One by One" Mode Fails to Trigger Workflow in a Collection After Record Update #5295

Closed
emelo7 opened this issue Sep 20, 2024 · 0 comments
Assignees

Comments

@emelo7
Copy link

emelo7 commented Sep 20, 2024

* Describe the bug

In workflows (post action event), when an "Update Record" node is created, there are two update modes available: "Update in a batch" and "Update one by one."

According to the documentation on update modes:

Update in a batch: Updates all eligible data at once, offering better performance when dealing with large amounts of data. However, the updated data will not trigger other workflows, and audit logs will not be recorded.
Update one by one: Updates data sequentially, allowing the updated data to trigger other workflows, and ensuring that audit logs are recorded. This mode is typically suited for a small number of records, as using it for large data sets may result in performance issues.
According to the documentation, in order to trigger a workflow on the updated record, I should select the "Update one by one" mode in the update record node. However, this is not happening.

In a workflow triggered by an update to a collection (performed through the UI), I created an update node to update my leads collection with "Update one by one" selected. While the lead updates successfully, the lead's workflow does not execute.

* Environment

  • NocoBase version: v1.3.22-beta.20240918092631

  • Database type and version: PostgreSQL 15

  • OS: Ubuntu

  • Deployment Methods: Docker Swarm

  • Docker image version: nocobase/nocobase:latest

* How To Reproduce

  1. Create two collections:
  • Opportunity Collection:
    Fields: Opportunity ID, Deal Value, Lead ID (reference to a lead), Status (e.g., "Open," "Closed-Won," "Closed-Lost")

  • Lead Collection:
    Fields: Lead ID, Lead Name, Lead Score, Last Deal Value

  1. Set up a workflow triggered by an update to the Opportunity Collection:
  • Trigger: When the Status field of an opportunity is updated.

  • Action: Add an Update Record Node to update the Last Deal Value field in the Lead Collection based on the Opportunity’s Lead ID.

  • Set the Update Record Node to use the "Update one by one" mode.

  1. Create another workflow in the Lead Collection:
  • Trigger: When the Last Deal Value is updated.
  • Action: Update the Lead Score field based on the Last Deal Value.
  1. In the UI, update an opportunity's Status to "Closed-Won" in the Opportunity Collection to trigger the update workflow.

Expected behavior

  • The Last Deal Value field in the Lead Collection should be updated.
  • The workflow in the Lead Collection should be triggered, and the Lead Score field should be refreshed based on the updated Last Deal Value.
@emelo7 emelo7 changed the title "Update One by One" Mode Fails to Trigger Workflow in Lead Collection After Record Update "Update One by One" Mode Fails to Trigger Workflow in a Collection After Record Update Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants