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.1should become
flowdrop_ai_provider_chat.1)nodes[].data.metadata.id(e.g.,chat_modelshould become
flowdrop_ai_provider_chat)nodes[].data.nodeId(mirrorsnodes[].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
- Install a version of flowdrop_ai_provider that uses the old bare node type IDs (e.g.,
chat_model,embeddings). - Create a workflow with a Chat node connected to other nodes via edges.
- Run
drush updbto execute the update hooks. - Export config and inspect the workflow YAML: node IDs and edge source/target/handle references still contain
the old type names. - 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:
- While iterating workflow nodes, build a
$node_id_mapmapping old node IDs (e.g.,
chat_model.1) to new ones (e.g.,flowdrop_ai_provider_chat.1). - Update
metadata.idandnodeIdin the same pass. - In a second pass, apply the map to all edge fields.
Remaining tasks
Review and commit the patch.
Issue fork flowdrop_ai_provider-3579838
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
Comment #3
gxleano commentedComment #4
gxleano commented