Problem/Motivation

The update hooks (update_10001, update_10002) and the idempotent
post_update_rename_chat_model hook only rename the executor_plugin field inside workflow
node metadata. They do not update the other fields that reference the old node type ID, leaving workflows in a
broken state after the rename.

Affected fields that are not updated:

  • nodes[].id (e.g., chat_model.1 should become
    flowdrop_ai_provider_chat.1)
  • nodes[].data.metadata.id (e.g., chat_model should become
    flowdrop_ai_provider_chat)
  • nodes[].data.nodeId (mirrors nodes[].id)
  • edges[].source / edges[].target (reference node IDs)
  • edges[].sourceHandle / edges[].targetHandle (prefixed with node IDs, e.g.,
    chat_model.1-output-response)
  • edges[].id (auto-generated string embedding node IDs)

This causes the workflow editor (React Flow) to lose edge connections and the workflow executor to fail
resolving node references after running updates.

Steps to reproduce

  1. Install a version of flowdrop_ai_provider that uses the old bare node type IDs (e.g.,
    chat_model, embeddings).
  2. Create a workflow with a Chat node connected to other nodes via edges.
  3. Run drush updb to execute the update hooks.
  4. Export config and inspect the workflow YAML: node IDs and edge source/target/handle references still contain
    the old type names.
  5. Open the workflow in the editor — edges are disconnected or missing.

Proposed resolution

Update all three hooks to also rename node IDs, metadata.id, nodeId, and all edge
references (source, target, sourceHandle, targetHandle,
id) within saved workflow config entities.

The approach:

  1. While iterating workflow nodes, build a $node_id_map mapping old node IDs (e.g.,
    chat_model.1) to new ones (e.g., flowdrop_ai_provider_chat.1).
  2. Update metadata.id and nodeId in the same pass.
  3. In a second pass, apply the map to all edge fields.

Remaining tasks

Review and commit the patch.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gxleano created an issue. See original summary.

gxleano’s picture

Assigned: gxleano » d34dman
Status: Active » Needs review
gxleano’s picture

Assigned: d34dman » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • gxleano committed 20bab3f5 on 1.0.x
    Issue #3579838: Fix post-update and update hooks to rename node IDs,...
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.